[dpdk-stable] [PATCH 1/3] eal: access hugepage_file in reverse order for powerpc

Gowrishankar gowrishankar.m at linux.vnet.ibm.com
Thu Jun 21 07:27:36 CEST 2018


From: Gowrishankar Muthukrishnan <gowrishankar.m at linux.vnet.ibm.com>

In powerpc, secondary process has to read hugepage_files in
its reverse order of indexing, so that correct VA addr is
read from hp for hugepage mapping.

Fixes: 284ae3e9ff ("eal/ppc: fix mmap for memory initialization")
Cc: stable at dpdk.org

Signed-off-by: Gowrishankar Muthukrishnan <gowrishankar.m at linux.vnet.ibm.com>
---
 lib/librte_eal/linuxapp/eal/eal_memory.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lib/librte_eal/linuxapp/eal/eal_memory.c b/lib/librte_eal/linuxapp/eal/eal_memory.c
index 16a181c..2dcb3b5 100644
--- a/lib/librte_eal/linuxapp/eal/eal_memory.c
+++ b/lib/librte_eal/linuxapp/eal/eal_memory.c
@@ -1455,7 +1455,11 @@ void numa_error(char *where)
 		/* find the hugepages for this segment and map them
 		 * we don't need to worry about order, as the server sorted the
 		 * entries before it did the second mmap of them */
+#ifdef RTE_ARCH_PPC_64
+		for (i = num_hp-1; i < num_hp && offset < mcfg->memseg[s].len; i--){
+#else
 		for (i = 0; i < num_hp && offset < mcfg->memseg[s].len; i++){
+#endif
 			if (hp[i].memseg_id == (int)s){
 				fd = open(hp[i].filepath, O_RDWR);
 				if (fd < 0) {
-- 
1.9.1



More information about the stable mailing list