Hi Daiwei: > -----Original Message----- > From: dev [mailto:dev-boun...@dpdk.org] On Behalf Of Wei Dai > Sent: Monday, March 19, 2018 8:41 PM > To: Lu, Wenzhuo <wenzhuo...@intel.com>; Wu, Jingjing > <jingjing...@intel.com> > Cc: dev@dpdk.org; Dai, Wei <wei....@intel.com> > Subject: [dpdk-dev] [PATCH v4 1/3] ethdev: add enum type for loop on Rx/Tx > offloads > > 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 <wei....@intel.com> > --- > 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 > +};
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. 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 > > +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. > -- > 2.7.5