diff mbox

[dpdk-dev,v3,14/14] Fix the compiling of test-pmd on IBM Power Architecture

Message ID 1416792142-23132-15-git-send-email-chaozhu@linux.vnet.ibm.com (mailing list archive)
State Superseded, archived
Headers show

Commit Message

Chao Zhu Nov. 24, 2014, 1:22 a.m. UTC
This patch fixes compiling problems on IBM Power architecture and turn
on the test-pmd compiling option in configuration file. Actually, this
is an big endian compiling fix.

Signed-off-by: Chao Zhu <chaozhu@linux.vnet.ibm.com>
---
 app/test-pmd/config.c          |   33 +++++++++++++++++++--------------
 config/common_linuxapp_powerpc |    6 +++---
 2 files changed, 22 insertions(+), 17 deletions(-)
diff mbox

Patch

diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index 9bc08f4..ba26da1 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -612,8 +612,13 @@  ring_dma_zone_lookup(const char *ring_name, uint8_t port_id, uint16_t q_id)
 union igb_ring_dword {
 	uint64_t dword;
 	struct {
+#ifdef RTE_ARCH_BIG_ENDIAN
+		uint32_t lo;
+		uint32_t hi;
+#else
 		uint32_t hi;
 		uint32_t lo;
+#endif
 	} words;
 };
 
@@ -656,23 +661,23 @@  ring_rx_descriptor_display(const struct rte_memzone *ring_mz,
 		/* 32 bytes RX descriptor, i40e only */
 		struct igb_ring_desc_32_bytes *ring =
 			(struct igb_ring_desc_32_bytes *)ring_mz->addr;
+        ring[desc_id].lo_dword.dword = rte_le_to_cpu_64(ring[desc_id].lo_dword.dword);
+		ring_rxd_display_dword(ring[desc_id].lo_dword);
+		ring[desc_id].hi_dword.dword = rte_le_to_cpu_64(ring[desc_id].hi_dword.dword);
+		ring_rxd_display_dword(ring[desc_id].hi_dword);
+        ring[desc_id].resv1.dword = rte_le_to_cpu_64(ring[desc_id].resv1.dword);
+		ring_rxd_display_dword(ring[desc_id].resv1);
+		ring[desc_id].resv2.dword = rte_le_to_cpu_64(ring[desc_id].resv2.dword);
+		ring_rxd_display_dword(ring[desc_id].resv2);		
 
-		ring_rxd_display_dword(rte_le_to_cpu_64(
-				ring[desc_id].lo_dword));
-		ring_rxd_display_dword(rte_le_to_cpu_64(
-				ring[desc_id].hi_dword));
-		ring_rxd_display_dword(rte_le_to_cpu_64(
-				ring[desc_id].resv1));
-		ring_rxd_display_dword(rte_le_to_cpu_64(
-				ring[desc_id].resv2));
 		return;
 	}
 #endif
 	/* 16 bytes RX descriptor */
-	ring_rxd_display_dword(rte_le_to_cpu_64(
-			ring[desc_id].lo_dword));
-	ring_rxd_display_dword(rte_le_to_cpu_64(
-			ring[desc_id].hi_dword));
+    ring[desc_id].lo_dword.dword = rte_le_to_cpu_64(ring[desc_id].lo_dword.dword);
+	ring_rxd_display_dword(ring[desc_id].lo_dword);
+	ring[desc_id].hi_dword.dword = rte_le_to_cpu_64(ring[desc_id].hi_dword.dword);
+	ring_rxd_display_dword(ring[desc_id].hi_dword);	
 }
 
 static void
@@ -682,8 +687,8 @@  ring_tx_descriptor_display(const struct rte_memzone *ring_mz, uint16_t desc_id)
 	struct igb_ring_desc_16_bytes txd;
 
 	ring = (struct igb_ring_desc_16_bytes *)ring_mz->addr;
-	txd.lo_dword = rte_le_to_cpu_64(ring[desc_id].lo_dword);
-	txd.hi_dword = rte_le_to_cpu_64(ring[desc_id].hi_dword);
+	txd.lo_dword.dword = rte_le_to_cpu_64(ring[desc_id].lo_dword.dword);
+	txd.hi_dword.dword = rte_le_to_cpu_64(ring[desc_id].hi_dword.dword);
 	printf("    0x%08X - 0x%08X / 0x%08X - 0x%08X\n",
 			(unsigned)txd.lo_dword.words.lo,
 			(unsigned)txd.lo_dword.words.hi,
diff --git a/config/common_linuxapp_powerpc b/config/common_linuxapp_powerpc
index d230a0b..68f1b6b 100644
--- a/config/common_linuxapp_powerpc
+++ b/config/common_linuxapp_powerpc
@@ -146,8 +146,8 @@  CONFIG_RTE_NIC_BYPASS=n
 #
 # Compile burst-oriented IGB & EM PMD drivers
 #
-CONFIG_RTE_LIBRTE_EM_PMD=n
-CONFIG_RTE_LIBRTE_IGB_PMD=n
+CONFIG_RTE_LIBRTE_EM_PMD=y
+CONFIG_RTE_LIBRTE_IGB_PMD=y
 CONFIG_RTE_LIBRTE_E1000_DEBUG_INIT=n
 CONFIG_RTE_LIBRTE_E1000_DEBUG_RX=n
 CONFIG_RTE_LIBRTE_E1000_DEBUG_TX=n
@@ -389,6 +389,6 @@  CONFIG_RTE_APP_TEST=y
 #
 # Compile the PMD test application
 #
-CONFIG_RTE_TEST_PMD=n
+CONFIG_RTE_TEST_PMD=y
 CONFIG_RTE_TEST_PMD_RECORD_CORE_CYCLES=n
 CONFIG_RTE_TEST_PMD_RECORD_BURST_STATS=n