From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from e28smtp07.in.ibm.com (e28smtp07.in.ibm.com [122.248.162.7]) by dpdk.org (Postfix) with ESMTP id 988E17F55 for ; Tue, 25 Nov 2014 11:05:37 +0100 (CET) Received: from /spool/local by e28smtp07.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 25 Nov 2014 15:46:25 +0530 Received: from d28dlp03.in.ibm.com (9.184.220.128) by e28smtp07.in.ibm.com (192.168.1.137) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 25 Nov 2014 15:46:22 +0530 Received: from d28relay01.in.ibm.com (d28relay01.in.ibm.com [9.184.220.58]) by d28dlp03.in.ibm.com (Postfix) with ESMTP id 2E431125805C for ; Tue, 25 Nov 2014 15:46:34 +0530 (IST) Received: from d28av05.in.ibm.com (d28av05.in.ibm.com [9.184.220.67]) by d28relay01.in.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id sAPAGIYw66060408 for ; Tue, 25 Nov 2014 15:46:18 +0530 Received: from d28av05.in.ibm.com (localhost [127.0.0.1]) by d28av05.in.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id sAPAGLgA021789 for ; Tue, 25 Nov 2014 15:46:21 +0530 Received: from os_controller.crl.ibm.com ([9.186.57.58]) by d28av05.in.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id sAPAG3kx020283 for ; Tue, 25 Nov 2014 15:46:20 +0530 From: Chao Zhu To: dev@dpdk.org Date: Tue, 25 Nov 2014 17:17:17 -0500 Message-Id: <1416953837-15894-15-git-send-email-chaozhu@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1416953837-15894-1-git-send-email-chaozhu@linux.vnet.ibm.com> References: <1416953837-15894-1-git-send-email-chaozhu@linux.vnet.ibm.com> X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 14112510-0025-0000-0000-00000211618E Subject: [dpdk-dev] [PATCH v5 14/14] Fix the compiling of test-pmd on IBM Power Architecture X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Nov 2014 10:05:38 -0000 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 --- app/test-pmd/config.c | 39 +++++++++++++++++++++++++-------------- 1 files changed, 25 insertions(+), 14 deletions(-) diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index 9bc08f4..4fee6c0 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,29 @@ 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 +693,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, -- 1.7.1