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 918972A66 for ; Tue, 20 Mar 2018 12:59:54 +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 orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 20 Mar 2018 04:59:53 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,335,1517904000"; d="scan'208";a="35324894" Received: from fyigit-mobl.ger.corp.intel.com (HELO [10.237.221.63]) ([10.237.221.63]) by FMSMGA003.fm.intel.com with ESMTP; 20 Mar 2018 04:59:52 -0700 To: Wei Dai , thomas@monjalon.net Cc: dev@dpdk.org References: <1521518424-3603-1-git-send-email-wei.dai@intel.com> From: Ferruh Yigit Message-ID: <44e0ca58-a0fe-50ae-3e2b-cef1510b251f@intel.com> Date: Tue, 20 Mar 2018 11:59:51 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <1521518424-3603-1-git-send-email-wei.dai@intel.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit 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: Tue, 20 Mar 2018 11:59:55 -0000 On 3/20/2018 4:00 AM, Wei Dai wrote: > 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. Hi Wei, It may be confusing to have both ETH_RX_OFFLOAD_VLAN_STRIP and DEV_RX_OFFLOAD_VLAN_STRIP. Will it work only to have a definition of the OFFLOAD_TOTAL_NUM? Can you please put some sample usage of the enums? > > 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 = 0, > + ETH_RX_OFFLOAD_VLAN_STRIP = 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 = 0, > + ETH_TX_OFFLOAD_VLAN_INSERT = 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. >