From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 003564C92 for ; Mon, 19 Mar 2018 15:05:51 +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 orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Mar 2018 07:05:49 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,330,1517904000"; d="scan'208";a="35050207" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by FMSMGA003.fm.intel.com with ESMTP; 19 Mar 2018 07:05:49 -0700 Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 19 Mar 2018 07:05:48 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.235]) by shsmsx102.ccr.corp.intel.com ([169.254.2.80]) with mapi id 14.03.0319.002; Mon, 19 Mar 2018 22:05:46 +0800 From: "Zhang, Qi Z" To: "Dai, Wei" , "Lu, Wenzhuo" , "Wu, Jingjing" CC: "dev@dpdk.org" , "Dai, Wei" Thread-Topic: [dpdk-dev] [PATCH v4 1/3] ethdev: add enum type for loop on Rx/Tx offloads Thread-Index: AQHTv4IRHT7sGEiOQkW57XFpnZycuaPXknOw Date: Mon, 19 Mar 2018 14:05:46 +0000 Message-ID: <039ED4275CED7440929022BC67E706115316FAB1@SHSMSX103.ccr.corp.intel.com> References: <1521293510-31421-1-git-send-email-wei.dai@intel.com> <1521463235-16451-1-git-send-email-wei.dai@intel.com> <1521463235-16451-2-git-send-email-wei.dai@intel.com> In-Reply-To: <1521463235-16451-2-git-send-email-wei.dai@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v4 1/3] 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: Mon, 19 Mar 2018 14:05:53 -0000 Hi Daiwei: > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Wei Dai > Sent: Monday, March 19, 2018 8:41 PM > To: Lu, Wenzhuo ; Wu, Jingjing > > Cc: dev@dpdk.org; Dai, Wei > Subject: [dpdk-dev] [PATCH v4 1/3] ethdev: add enum type for loop on Rx/T= x > offloads >=20 > 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. >=20 > Signed-off-by: Wei Dai > --- > lib/librte_ether/rte_ethdev.h | 44 > +++++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 44 insertions(+) >=20 > 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) >=20 > +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 > +}; This looks a little duplicate with rte_rx_offload_names in rte_ethdev.c In patch 2/3 and 3/3, I think if you simply loop from offload bit 0 to bit = 63 to check the name, that should still work right? then this patch could be unnecessary. =09 Regards Qi > + > /* > * 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 >=20 > +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 > +}; > + > /* > * 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