From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id AA672B0A7 for ; Thu, 5 Jun 2014 07:11:27 +0200 (CEST) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.intel.com with ESMTP; 04 Jun 2014 22:11:35 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.98,978,1392192000"; d="scan'208";a="551861458" Received: from shilc102.sh.intel.com ([10.239.39.44]) by orsmga002.jf.intel.com with ESMTP; 04 Jun 2014 22:11:34 -0700 Received: from shecgisg004.sh.intel.com (shecgisg004.sh.intel.com [10.239.29.89]) by shilc102.sh.intel.com (8.13.6/8.13.6/SuSE Linux 0.8) with ESMTP id s555BVJq025156; Thu, 5 Jun 2014 13:11:33 +0800 Received: from shecgisg004.sh.intel.com (localhost [127.0.0.1]) by shecgisg004.sh.intel.com (8.13.6/8.13.6/SuSE Linux 0.8) with ESMTP id s555BRC2023986; Thu, 5 Jun 2014 13:11:29 +0800 Received: (from hzhan75@localhost) by shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id s555BRpc023982; Thu, 5 Jun 2014 13:11:27 +0800 From: Helin Zhang To: dev@dpdk.org Date: Thu, 5 Jun 2014 13:08:57 +0800 Message-Id: <1401944951-23783-14-git-send-email-helin.zhang@intel.com> X-Mailer: git-send-email 1.7.0.7 In-Reply-To: <1401944951-23783-1-git-send-email-helin.zhang@intel.com> References: <1401944951-23783-1-git-send-email-helin.zhang@intel.com> Subject: [dpdk-dev] [PATCH v2 13/27] app/test-pmd: support displaying 32 bytes RX descriptors 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: Thu, 05 Jun 2014 05:11:28 -0000 i40e supports both 16 and 32 bytes RX descriptors, while ixgbe and igb support 16 bytes size only. Code changes have been made in test-pmd to support both 16 and 32 bytes RX descriptors according to the configuration in config files. Signed-off-by: Helin Zhang Signed-off-by: Jing Chen Acked-by: Cunming Liang Acked-by: Jijiang Liu Acked-by: Jingjing Wu Tested-by: Waterman Cao --- app/test-pmd/config.c | 36 +++++++++++++++++++++++++++++++++--- 1 file changed, 33 insertions(+), 3 deletions(-) diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index d6291e7..3dc7fba 100644 --- a/app/test-pmd/config.c +++ b/app/test-pmd/config.c @@ -558,13 +558,43 @@ union igb_ring_dword { } words; }; +#ifndef RTE_LIBRTE_I40E_16BYTE_RX_DESC +struct igb_ring_desc_32B { + union igb_ring_dword lo_dword; + union igb_ring_dword hi_dword; + union igb_ring_dword resv1; + union igb_ring_dword resv2; +}; +#endif + struct igb_ring_desc { union igb_ring_dword lo_dword; union igb_ring_dword hi_dword; }; static void -ring_descriptor_display(const struct rte_memzone *ring_mz, uint16_t desc_id) +ring_rx_descriptor_display(const struct rte_memzone *ring_mz, uint16_t desc_id) +{ +#ifdef RTE_LIBRTE_I40E_16BYTE_RX_DESC + struct igb_ring_desc *ring; + struct igb_ring_desc rd; + + ring = (struct igb_ring_desc *) ring_mz->addr; +#else + struct igb_ring_desc_32B *ring; + struct igb_ring_desc_32B rd; + + ring = (struct igb_ring_desc_32B *) ring_mz->addr; +#endif + rd.lo_dword = rte_le_to_cpu_64(ring[desc_id].lo_dword); + rd.hi_dword = rte_le_to_cpu_64(ring[desc_id].hi_dword); + printf(" 0x%08X - 0x%08X / 0x%08X - 0x%08X\n", + (unsigned)rd.lo_dword.words.lo, (unsigned)rd.lo_dword.words.hi, + (unsigned)rd.hi_dword.words.lo, (unsigned)rd.hi_dword.words.hi); +} + +static void +ring_tx_descriptor_display(const struct rte_memzone *ring_mz, uint16_t desc_id) { struct igb_ring_desc *ring; struct igb_ring_desc rd; @@ -591,7 +621,7 @@ rx_ring_desc_display(portid_t port_id, queueid_t rxq_id, uint16_t rxd_id) rx_mz = ring_dma_zone_lookup("rx_ring", port_id, rxq_id); if (rx_mz == NULL) return; - ring_descriptor_display(rx_mz, rxd_id); + ring_rx_descriptor_display(rx_mz, rxd_id); } void @@ -608,7 +638,7 @@ tx_ring_desc_display(portid_t port_id, queueid_t txq_id, uint16_t txd_id) tx_mz = ring_dma_zone_lookup("tx_ring", port_id, txq_id); if (tx_mz == NULL) return; - ring_descriptor_display(tx_mz, txd_id); + ring_tx_descriptor_display(tx_mz, txd_id); } void -- 1.8.1.4