Skip to contentSkip to conversation

eal:ppc: fix incorrect ifdef for ppc_64

PATCH Applied David Christensen 4 participants 9 messages Sep 25, 2019 – Oct 24, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 eal:ppc: fix incorrect ifdef for ppc_64

An ifdef present in eal_memory.c references "RTE_ARCH_PPC64" when it should actually use "RTE_ARCH_PPC_64". Simple testing revealed that both the PPC_64 and non-PPC_64 versions of the code involved work, but the PPC_64 version of the code is retained to be consistent with other instances in the same file where mmapped memory is accessed in reverse order on Power platforms.

Fixes 66cc45e ("mem: replace memseg with memseg lists")
Cc Anatoly Burakov <[email protected]>
---
 lib/librte_eal/linux/eal/eal_memory.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/librte_eal/linux/eal/eal_memory.c +1 -1
index 1c089a1ef..1bbdd8a29 100644
@@ -688,7 +688,7 @@ remap_segment(struct hugepage_file *hugepages, int seg_start, int seg_end)
 		return -1;
 	}
 
-#ifdef RTE_ARCH_PPC64
+#ifdef RTE_ARCH_PPC_64
 	/* for PPC64 we go through the list backwards */
 	for (cur_page = seg_end - 1; cur_page >= seg_start;
 			cur_page--, ms_idx++) {
Signature · 1 line
2.18.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 21 lines · David Christensen

An ifdef present in eal_memory.c references "RTE_ARCH_PPC64" when it should actually use "RTE_ARCH_PPC_64". Simple testing revealed that both the PPC_64 and non-PPC_64 versions of the code involved work, but the PPC_64 version of the code is retained to be consistent with other instances in the same file where mmapped memory is accessed in reverse order on Power platforms.

Fixes 66cc45e ("mem: replace memseg with memseg lists")
Cc Anatoly Burakov <[email protected]>
---
 lib/librte_eal/linux/eal/eal_memory.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/librte_eal/linux/eal/eal_memory.c +0 -0
index 1c089a1ef..1bbdd8a29 100644

lib/librte_eal/linux/eal/eal_memory.c remap_segment(struct hugepage_file *hugepages, int seg_start, int seg_end) · line 694

Quoted 8 lines
lib/librte_eal/linux/eal/eal_memory.c +1 -1
@@ -688,7 +688,7 @@ remap_segment(struct hugepage_file *hugepages, int seg_start, int seg_end)
 		return -1;
 	}
 
-#ifdef RTE_ARCH_PPC64
+#ifdef RTE_ARCH_PPC_64
 	/* for PPC64 we go through the list backwards */
 	for (cur_page = seg_end - 1; cur_page >= seg_start;
 			cur_page--, ms_idx++) {
#3 lore raw
In reply to David Christensen
Quoted 7 lines · David Christensen

An ifdef present in eal_memory.c references "RTE_ARCH_PPC64" when it should actually use "RTE_ARCH_PPC_64". Simple testing revealed that both the PPC_64 and non-PPC_64 versions of the code involved work, but the PPC_64 version of the code is retained to be consistent with other instances in the same file where mmapped memory is accessed in reverse order on Power platforms.

The change itself is not that scary, but just reading this commitlog I fail to see the impact for an application.
Can you share some light?

Quoted 2 lines
Fixes 66cc45e ("mem: replace memseg with memseg lists")

Fixes sha1 should be on 12 digits.
Should we copy stable ?

Quoted 21 lines
Cc Anatoly Burakov <[email protected]>
---
 lib/librte_eal/linux/eal/eal_memory.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/librte_eal/linux/eal/eal_memory.c +1 -2
index 1c089a1ef..1bbdd8a29 100644
@@ -688,7 +688,7 @@ remap_segment(struct hugepage_file *hugepages, int seg_start, int seg_end)
                return -1;
        }
 
-#ifdef RTE_ARCH_PPC64
+#ifdef RTE_ARCH_PPC_64
        /* for PPC64 we go through the list backwards */
        for (cur_page = seg_end - 1; cur_page >= seg_start;
                        cur_page--, ms_idx++) {
--
Quoted 2 lines

2.18.1

Thanks.

Signature · 1 line
David Marchand
#4 lore raw
Quoted 11 lines
Quoted 6 lines

An ifdef present in eal_memory.c references "RTE_ARCH_PPC64" when it should actually use "RTE_ARCH_PPC_64". Simple testing revealed that both the PPC_64 and non-PPC_64 versions of the code involved work, but the PPC_64 version of the code is retained to be consistent with other instances in the same file where mmapped memory is accessed in reverse order on Power platforms.

The change itself is not that scary, but just reading this commitlog I fail to see the impact for an application.
Can you share some light?

As far as I can tell there is no impact on any applications. The old code, which walked through the list in a forward direction, worked perfectly well with testpmd and DPDK pktgen applications on Power systems.

With the ifdef fixed, the core walks the list in the reverse direction as intended, the code still worked (i.e. no errors or problems were observed in the same test applications).

I'm not completely familiar with why memseg lists must be traversed in the reverse direction for Power systems. It might be something specific to Power 8 systems which I'm not actually supporting on DPDK, only the Power 9 systems that I use for for development and testing.

Dave

#5 lore raw
Quoted 12 lines · David Christensen
Quoted 11 lines
Quoted 6 lines

An ifdef present in eal_memory.c references "RTE_ARCH_PPC64" when it should actually use "RTE_ARCH_PPC_64".  Simple testing revealed that both the PPC_64 and non-PPC_64 versions of the code involved work, but the PPC_64 version of the code is retained to be consistent with other instances in the same file where mmapped memory is accessed in reverse order on Power platforms.

The change itself is not that scary, but just reading this commitlog I fail to see the impact for an application.
Can you share some light?

Quoted 8 lines

As far as I can tell there is no impact on any applications.  The old code, which walked through the list in a forward direction, worked perfectly well with testpmd and DPDK pktgen applications on Power systems.

With the ifdef fixed, the core walks the list in the reverse direction as intended, the code still worked (i.e. no errors or problems were observed in the same test applications).

I'm not completely familiar with why memseg lists must be traversed in the reverse direction for Power systems.  It might be something specific to Power 8 systems which I'm not actually supporting on DPDK, only the Power 9 systems that I use for for development and testing.

Dave

If the code makes no difference anyway, should we just take it out so?

Signature · 2 lines
Thanks,
Anatoly
#6 lore raw
Quoted 27 lines · Anatoly
Quoted 25 lines · David Christensen
Quoted 11 lines
Quoted 6 lines

An ifdef present in eal_memory.c references "RTE_ARCH_PPC64" when it should actually use "RTE_ARCH_PPC_64". Simple testing revealed that both the PPC_64 and non-PPC_64 versions of the code involved work, but the PPC_64 version of the code is retained to be consistent with other instances in the same file where mmapped memory is accessed in reverse order on Power platforms.

The change itself is not that scary, but just reading this commitlog I fail to see the impact for an application.
Can you share some light?

As far as I can tell there is no impact on any applications. The old code, which walked through the list in a forward direction, worked perfectly well with testpmd and DPDK pktgen applications on Power systems.

With the ifdef fixed, the core walks the list in the reverse direction as intended, the code still worked (i.e. no errors or problems were observed in the same test applications).

I'm not completely familiar with why memseg lists must be traversed in the reverse direction for Power systems. It might be something specific to Power 8 systems which I'm not actually supporting on DPDK, only the Power 9 systems that I use for for development and testing.

Quoted 4 lines
Quoted 2 lines

Dave

If the code makes no difference anyway, should we just take it out so?

+1 :-)

Signature · 1 line
David Marchand
#7 lore raw
Quoted 13 lines
Quoted 13 lines
Quoted 13 lines
Quoted 4 lines

The change itself is not that scary, but just reading this commitlog I fail to see the impact for an application.
Can you share some light?

As far as I can tell there is no impact on any applications. The old code, which walked through the list in a forward direction, worked perfectly well with testpmd and DPDK pktgen applications on Power systems.

With the ifdef fixed, the core walks the list in the reverse direction as intended, the code still worked (i.e. no errors or problems were observed in the same test applications).

Quoted 8 lines
Quoted 6 lines
Quoted 5 lines

I'm not completely familiar with why memseg lists must be traversed in the reverse direction for Power systems. It might be something specific to Power 8 systems which I'm not actually supporting on DPDK, only the Power 9 systems that I use for for development and testing.

If the code makes no difference anyway, should we just take it out so?

+1 :-)

I think there's a need for a larger review of Power8 vs. Power9 support.
You currently need to specify Power8 as the DPDK build target (e.g.
ppc_64-power8-linux-gcc) but all of our internal development and testing efforts are targeting Power9 systems. My preference would be to drop Power8 support all together but I'm reluctant to make such a potentially large change so close to an LTS release target, and not without soliciting some community comment on the idea. As a result, I'd prefer to keep the change "as is" for this release.

Dave

#8 lore raw
Quoted 23 lines · David Christensen
Quoted 14 lines
Quoted 14 lines
Quoted 14 lines
Quoted 5 lines

The change itself is not that scary, but just reading this commitlog I fail to see the impact for an application.
Can you share some light?

As far as I can tell there is no impact on any applications. The old code, which walked through the list in a forward direction, worked perfectly well with testpmd and DPDK pktgen applications on Power systems.

With the ifdef fixed, the core walks the list in the reverse direction as intended, the code still worked (i.e. no errors or problems were observed in the same test applications).

Quoted 8 lines
Quoted 6 lines
Quoted 5 lines

I'm not completely familiar with why memseg lists must be traversed in the reverse direction for Power systems. It might be something specific to Power 8 systems which I'm not actually supporting on DPDK, only the Power 9 systems that I use for for development and testing.

If the code makes no difference anyway, should we just take it out so?

+1 :-)

Quoted 8 lines

I think there's a need for a larger review of Power8 vs. Power9 support.
You currently need to specify Power8 as the DPDK build target (e.g.
ppc_64-power8-linux-gcc) but all of our internal development and testing efforts are targeting Power9 systems. My preference would be to drop Power8 support all together but I'm reluctant to make such a potentially large change so close to an LTS release target, and not without soliciting some community comment on the idea. As a result, I'd prefer to keep the change "as is" for this release.

Ok, I will take it as is, but please do investigate this. The lesser special cases like these, the better.

Signature · 1 line
David Marchand
#2 lore raw
In reply to Ferruh Yigit
Quoted 9 lines · Ferruh Yigit
Quoted 8 lines · David Christensen

An ifdef present in eal_memory.c references "RTE_ARCH_PPC64" when it should actually use "RTE_ARCH_PPC_64". Simple testing revealed that both the PPC_64 and non-PPC_64 versions of the code involved work, but the PPC_64 version of the code is retained to be consistent with other instances in the same file where mmapped memory is accessed in reverse order on Power platforms.

Fixes 66cc45e ("mem: replace memseg with memseg lists")
Quoted 3 lines
Quoted 2 lines

Applied, thanks.

Signature · 1 line
David Marchand