From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id A5C1E5F1B for ; Thu, 22 Mar 2018 01:41:35 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 21 Mar 2018 17:41:34 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,341,1517904000"; d="scan'208";a="35788083" Received: from pgsmsx112-dag.png.intel.com (HELO PGSMSX112.gar.corp.intel.com) ([10.108.55.234]) by FMSMGA003.fm.intel.com with ESMTP; 21 Mar 2018 17:41:33 -0700 Received: from pgsmsx110.gar.corp.intel.com (10.221.44.111) by PGSMSX112.gar.corp.intel.com (10.108.55.201) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 22 Mar 2018 08:41:32 +0800 Received: from pgsmsx112.gar.corp.intel.com ([169.254.3.227]) by PGSMSX110.gar.corp.intel.com ([169.254.13.74]) with mapi id 14.03.0319.002; Thu, 22 Mar 2018 08:41:32 +0800 From: "Dai, Wei" To: "Zhang, Qi Z" , "Ananyev, Konstantin" , "thomas@monjalon.net" CC: "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH] ethdev: add enum type for loop on Rx/Tx offloads Thread-Index: AQHTwAJ7QxgUuUcBEkqN2qJ0FlQV46PYf/EAgAI645D//3+DAIABMjjg Date: Thu, 22 Mar 2018 00:41:32 +0000 Message-ID: <49759EB36A64CF4892C1AFEC9231E8D66CF619A6@PGSMSX112.gar.corp.intel.com> References: <1521518424-3603-1-git-send-email-wei.dai@intel.com> <2601191342CEEE43887BDE71AB977258A0AB2111@irsmsx105.ger.corp.intel.com> <49759EB36A64CF4892C1AFEC9231E8D66CF6172C@PGSMSX112.gar.corp.intel.com> <039ED4275CED7440929022BC67E7061153170C71@SHSMSX103.ccr.corp.intel.com> In-Reply-To: <039ED4275CED7440929022BC67E7061153170C71@SHSMSX103.ccr.corp.intel.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNzFmZDM3YTQtZjQwMi00ODE5LTg5ZTQtY2MyMTFiYWMwMmVlIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjUuOS4zIiwiVHJ1c3RlZExhYmVsSGFzaCI6InBwamJVd3BHM3ZyblJqUUZNMEl2MzM2S2Iwa3pOYUVYUXZXYjdpXC8wUEVnPSJ9 x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action x-originating-ip: [172.30.20.206] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH] ethdev: add enum type for loop on Rx/Tx offloads X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Mar 2018 00:41:36 -0000 Thanks Zhang Qi > -----Original Message----- > From: Zhang, Qi Z > Sent: Wednesday, March 21, 2018 10:24 PM > To: Dai, Wei ; Ananyev, Konstantin > ; thomas@monjalon.net > Cc: dev@dpdk.org > Subject: RE: [dpdk-dev] [PATCH] ethdev: add enum type for loop on Rx/Tx > offloads >=20 >=20 >=20 > > -----Original Message----- > > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Dai, Wei > > Sent: Wednesday, March 21, 2018 10:09 PM > > To: Ananyev, Konstantin ; > > thomas@monjalon.net > > Cc: dev@dpdk.org > > Subject: Re: [dpdk-dev] [PATCH] ethdev: add enum type for loop on > > Rx/Tx offloads > > > > Hi, Konstantin > > Thanks for your feedback. > > > > > -----Original Message----- > > > From: Ananyev, Konstantin > > > Sent: Tuesday, March 20, 2018 8:00 PM > > > To: Dai, Wei ; thomas@monjalon.net > > > Cc: dev@dpdk.org; Dai, Wei > > > Subject: RE: [dpdk-dev] [PATCH] ethdev: add enum type for loop on > > > Rx/Tx offloads > > > > > > > > > Hi Wei, > > > > > > > > > > > This patch adds enum rte_eth_rx_offload_type and enum > > > > rte_eth_tx_offload_type. For a loop on all Rx offloads, it is > > > > convenient to begin with the first enum member > > > > ETH_RX_OFFLOAD_FIRST_FEATURE and to end at > > > ETH_RX_OFFLOAD_TOTAL_NUM. > > > > A loop on all Tx offloads can begin with > > > ETH_TX_OFFLOAD_FIRST_FEATURE > > > > and end at ETH_TX_OFFLOAD_TOTAL_NUM. > > > > > > > > Signed-off-by: Wei Dai > > > > --- > > > > lib/librte_ether/rte_ethdev.h | 44 > > > > +++++++++++++++++++++++++++++++++++++++++++ > > > > 1 file changed, 44 insertions(+) > > > > > > > > diff --git a/lib/librte_ether/rte_ethdev.h > > > > b/lib/librte_ether/rte_ethdev.h index 0361533..0089ea3 100644 > > > > --- a/lib/librte_ether/rte_ethdev.h > > > > +++ b/lib/librte_ether/rte_ethdev.h > > > > @@ -946,6 +946,27 @@ struct rte_eth_conf { > > > > DEV_RX_OFFLOAD_VLAN_FILTER | \ > > > > DEV_RX_OFFLOAD_VLAN_EXTEND) > > > > > > > > +enum rte_eth_rx_offload_type { > > > > + ETH_RX_OFFLOAD_FIRST_FEATURE =3D 0, > > > > + ETH_RX_OFFLOAD_VLAN_STRIP =3D > ETH_RX_OFFLOAD_FIRST_FEATURE, > > > > + ETH_RX_OFFLOAD_IPV4_CKSUM, > > > > + ETH_RX_OFFLOAD_UDP_CKSUM, > > > > + ETH_RX_OFFLOAD_TCP_CKSUM, > > > > + ETH_RX_OFFLOAD_TCP_LRO, > > > > + ETH_RX_OFFLOAD_QINQ_STRIP, > > > > + ETH_RX_OFFLOAD_OUTER_IPV4_CKSUM, > > > > + ETH_RX_OFFLOAD_MACSEC_STRIP, > > > > + ETH_RX_OFFLOAD_HEADER_SPLIT, > > > > + ETH_RX_OFFLOAD_VLAN_FILTER, > > > > + ETH_RX_OFFLOAD_VLAN_EXTEND, > > > > + ETH_RX_OFFLOAD_JUMBO_FRAME, > > > > + ETH_RX_OFFLOAD_CRC_STRIP, > > > > + ETH_RX_OFFLOAD_SCATTER, > > > > + ETH_RX_OFFLOAD_TIMESTAMP, > > > > + ETH_RX_OFFLOAD_SECURITY, > > > > + ETH_RX_OFFLOAD_TOTAL_NUM > > > > +}; > > > > + > > > > /* > > > > * If new Rx offload capabilities are defined, they also must be > > > > * mentioned in rte_rx_offload_names in rte_ethdev.c file. > > > > @@ -981,6 +1002,29 @@ struct rte_eth_conf { > > > > */ > > > > #define DEV_TX_OFFLOAD_SECURITY 0x00020000 > > > > > > > > +enum rte_eth_tx_offload_type { > > > > + ETH_TX_OFFLOAD_FIRST_FEATURE =3D 0, > > > > + ETH_TX_OFFLOAD_VLAN_INSERT =3D > > ETH_TX_OFFLOAD_FIRST_FEATURE, > > > > + ETH_TX_OFFLOAD_IPV4_CKSUM, > > > > + ETH_TX_OFFLOAD_UDP_CKSUM, > > > > + ETH_TX_OFFLOAD_TCP_CKSUM, > > > > + ETH_TX_OFFLOAD_SCTP_CKSUM, > > > > + ETH_TX_OFFLOAD_TCP_TSO, > > > > + ETH_TX_OFFLOAD_UDP_TSO, > > > > + ETH_TX_OFFLOAD_OUTER_IPV4_CKSUM, > > > > + ETH_TX_OFFLOAD_QINQ_INSERT, > > > > + ETH_TX_OFFLOAD_VXLAN_TNL_TSO, > > > > + ETH_TX_OFFLOAD_GRE_TNL_TSO, > > > > + ETH_TX_OFFLOAD_IPIP_TNL_TSO, > > > > + ETH_TX_OFFLOAD_GENEVE_TNL_TSO, > > > > + ETH_TX_OFFLOAD_MACSEC_INSERT, > > > > + ETH_TX_OFFLOAD_MT_LOCKFREE, > > > > + ETH_TX_OFFLOAD_MULTI_SEGS, > > > > + ETH_TX_OFFLOAD_MBUF_FAST_FREE, > > > > + ETH_TX_OFFLOAD_SECURITY, > > > > + ETH_TX_OFFLOAD_TOTAL_NUM > > > > +}; > > > > > > What is the purpose to introduce these enums? > > > It looks like they are not used anywhere? > > > Konstantin > > > > When I make the patch for new offloading test with testpmd, I find I > > need loop on all possible offloads, without this enum type, I have to > > loop from bit 0 to bit 63, I think it is better to stop at the last one= and No > need to bit 63. > > I guess it will be helpful for some future application which need loop > > on all offloadings. >=20 > If you want to know the total offload count, You can just create an api l= ike > rte_eth_get_xx_offload_count to reuse the rte_xx_offload_names So we > don't need maintain same information in two place, But still, in your tes= tpmd, > I saw the loop will break at first UNKNOWN, so loop from 0 to 63 is still= no > waste, am I right? > maybe you need to give a better example for why we need this >=20 > Regards > Qi >=20 Yes, you are right.=20 I will withdraw this patch. > > > > > > > > > + > > > > /* > > > > * If new Tx offload capabilities are defined, they also must be > > > > * mentioned in rte_tx_offload_names in rte_ethdev.c file. > > > > -- > > > > 2.7.5