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 8DF3E47D2 for ; Mon, 23 Jun 2014 03:38:13 +0200 (CEST) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.intel.com with ESMTP; 22 Jun 2014 18:38:30 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.01,526,1400050800"; d="scan'208";a="561630218" Received: from fmsmsx104.amr.corp.intel.com ([10.19.9.35]) by orsmga002.jf.intel.com with ESMTP; 22 Jun 2014 18:38:09 -0700 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by FMSMSX104.amr.corp.intel.com (10.19.9.35) with Microsoft SMTP Server (TLS) id 14.3.123.3; Sun, 22 Jun 2014 18:38:09 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.122]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.81]) with mapi id 14.03.0123.003; Mon, 23 Jun 2014 09:38:08 +0800 From: "Zhang, Helin" To: Thomas Monjalon Thread-Topic: [dpdk-dev] [PATCH 7/7] app/testpmd: rework for displaying different size of RX descriptors Thread-Index: AQHPjJTPrvBY6TbrzU+QCL1UjwoV1pt942DA Date: Mon, 23 Jun 2014 01:38:07 +0000 Message-ID: References: <1403244889-21358-1-git-send-email-helin.zhang@intel.com> <1403244889-21358-8-git-send-email-helin.zhang@intel.com> <45267557.BLbedC010Y@xps13> In-Reply-To: <45267557.BLbedC010Y@xps13> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Cc: "dev@dpdk.org" Subject: Re: [dpdk-dev] [PATCH 7/7] app/testpmd: rework for displaying different size of 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: Mon, 23 Jun 2014 01:38:14 -0000 -----Original Message----- From: Thomas Monjalon [mailto:thomas.monjalon@6wind.com]=20 Sent: Friday, June 20, 2014 10:35 PM To: Zhang, Helin Cc: dev@dpdk.org Subject: Re: [dpdk-dev] [PATCH 7/7] app/testpmd: rework for displaying diff= erent size of RX descriptors 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=20 > if 16 or 32 bytes RX descriptors is being used, for reading and=20 > displaying the different sizes of RX descriptors. [...] > + if (strstr(dev_info.driver_name, "i40e") !=3D NULL) { /* i40e */=20 > +#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 =3D > + (struct igb_ring_desc_16_bytes *)ring_mz->addr; > =20 > + 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 =3D > + (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 ---------------------------------------------------------------------------= ------------------------------------- Hi Thomas As RX descriptor size can vary in i40e only, and for other PMD, RTE_LIBRTE_= I40E_16BYTE_RX_DESC will never be defined, we need to handle all possibilit= ies. Yes, I can rework the changes and let it be more graceful. Thanks! Regards, Helin