From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH 7/7] app/testpmd: rework for displaying different size of RX descriptors Date: Fri, 20 Jun 2014 16:34:35 +0200 Message-ID: <45267557.BLbedC010Y@xps13> References: <1403244889-21358-1-git-send-email-helin.zhang@intel.com> <1403244889-21358-8-git-send-email-helin.zhang@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev-VfR2kkLFssw@public.gmane.org To: Helin Zhang Return-path: In-Reply-To: <1403244889-21358-8-git-send-email-helin.zhang-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces-VfR2kkLFssw@public.gmane.org Sender: "dev" 2014-06-20 14:14, Helin Zhang: > i40e supports 16 and 32 bytes RX descriptors which can be configured. > It needs to check the driver type and the configuration to determine > if 16 or 32 bytes RX descriptors is being used, for reading and > displaying the different sizes of RX descriptors. [...] > + if (strstr(dev_info.driver_name, "i40e") != NULL) { /* i40e */ > +#ifndef RTE_LIBRTE_I40E_16BYTE_RX_DESC Do we need to handle i40e case if RTE_LIBRTE_I40E_16BYTE_RX_DESC is defined? [simplified diff follows] > #else > + struct igb_ring_desc_16_bytes *ring = > + (struct igb_ring_desc_16_bytes *)ring_mz->addr; > > + 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)); > #endif > + } else { /* not i40e */ > + struct igb_ring_desc_16_bytes *ring = > + (struct igb_ring_desc_16_bytes *)ring_mz->addr; > + > + 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)); > + } You could factorize these 2 cases. -- Thomas