DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] ethdev: add enum type for loop on Rx/Tx offloads
@ 2018-03-20  4:00 Wei Dai
  2018-03-20 11:59 ` Ferruh Yigit
  2018-03-20 12:00 ` Ananyev, Konstantin
  0 siblings, 2 replies; 6+ messages in thread
From: Wei Dai @ 2018-03-20  4:00 UTC (permalink / raw)
  To: thomas; +Cc: dev, Wei Dai

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.dai@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
+};
+
 /*
  * 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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dpdk-dev] [PATCH] ethdev: add enum type for loop on Rx/Tx offloads
  2018-03-20  4:00 [dpdk-dev] [PATCH] ethdev: add enum type for loop on Rx/Tx offloads Wei Dai
@ 2018-03-20 11:59 ` Ferruh Yigit
  2018-03-20 12:00 ` Ananyev, Konstantin
  1 sibling, 0 replies; 6+ messages in thread
From: Ferruh Yigit @ 2018-03-20 11:59 UTC (permalink / raw)
  To: Wei Dai, thomas; +Cc: dev

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 <wei.dai@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
> +};
> +
>  /*
>   * 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.
> 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dpdk-dev] [PATCH] ethdev: add enum type for loop on Rx/Tx offloads
  2018-03-20  4:00 [dpdk-dev] [PATCH] ethdev: add enum type for loop on Rx/Tx offloads Wei Dai
  2018-03-20 11:59 ` Ferruh Yigit
@ 2018-03-20 12:00 ` Ananyev, Konstantin
  2018-03-21 14:08   ` Dai, Wei
  1 sibling, 1 reply; 6+ messages in thread
From: Ananyev, Konstantin @ 2018-03-20 12:00 UTC (permalink / raw)
  To: Dai, Wei, thomas; +Cc: dev, Dai, Wei


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 <wei.dai@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
> +};
> +
>  /*
>   * 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
> +};

What is the purpose to introduce  these enums?
It looks like they are not used anywhere?
Konstantin

> +
>  /*
>   * 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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dpdk-dev] [PATCH] ethdev: add enum type for loop on Rx/Tx offloads
  2018-03-20 12:00 ` Ananyev, Konstantin
@ 2018-03-21 14:08   ` Dai, Wei
  2018-03-21 14:23     ` Zhang, Qi Z
  0 siblings, 1 reply; 6+ messages in thread
From: Dai, Wei @ 2018-03-21 14:08 UTC (permalink / raw)
  To: Ananyev, Konstantin, thomas; +Cc: dev

Hi, Konstantin
Thanks for your feedback.

> -----Original Message-----
> From: Ananyev, Konstantin
> Sent: Tuesday, March 20, 2018 8:00 PM
> To: Dai, Wei <wei.dai@intel.com>; thomas@monjalon.net
> Cc: dev@dpdk.org; Dai, Wei <wei.dai@intel.com>
> 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 <wei.dai@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
> > +};
> > +
> >  /*
> >   * 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
> > +};
> 
> 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.

> 
> > +
> >  /*
> >   * 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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dpdk-dev] [PATCH] ethdev: add enum type for loop on Rx/Tx offloads
  2018-03-21 14:08   ` Dai, Wei
@ 2018-03-21 14:23     ` Zhang, Qi Z
  2018-03-22  0:41       ` Dai, Wei
  0 siblings, 1 reply; 6+ messages in thread
From: Zhang, Qi Z @ 2018-03-21 14:23 UTC (permalink / raw)
  To: Dai, Wei, Ananyev, Konstantin, thomas; +Cc: dev



> -----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 <konstantin.ananyev@intel.com>;
> 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 <wei.dai@intel.com>; thomas@monjalon.net
> > Cc: dev@dpdk.org; Dai, Wei <wei.dai@intel.com>
> > 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 <wei.dai@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
> > > +};
> > > +
> > >  /*
> > >   * 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
> > > +};
> >
> > 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.

If you want to know the total offload count, You can just create an api like 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 testpmd, 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

Regards
Qi

> 
> >
> > > +
> > >  /*
> > >   * 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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dpdk-dev] [PATCH] ethdev: add enum type for loop on Rx/Tx offloads
  2018-03-21 14:23     ` Zhang, Qi Z
@ 2018-03-22  0:41       ` Dai, Wei
  0 siblings, 0 replies; 6+ messages in thread
From: Dai, Wei @ 2018-03-22  0:41 UTC (permalink / raw)
  To: Zhang, Qi Z, Ananyev, Konstantin, thomas; +Cc: dev

Thanks Zhang Qi

> -----Original Message-----
> From: Zhang, Qi Z
> Sent: Wednesday, March 21, 2018 10:24 PM
> To: Dai, Wei <wei.dai@intel.com>; Ananyev, Konstantin
> <konstantin.ananyev@intel.com>; thomas@monjalon.net
> Cc: dev@dpdk.org
> Subject: RE: [dpdk-dev] [PATCH] ethdev: add enum type for loop on Rx/Tx
> offloads
> 
> 
> 
> > -----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 <konstantin.ananyev@intel.com>;
> > 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 <wei.dai@intel.com>; thomas@monjalon.net
> > > Cc: dev@dpdk.org; Dai, Wei <wei.dai@intel.com>
> > > 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 <wei.dai@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
> > > > +};
> > > > +
> > > >  /*
> > > >   * 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
> > > > +};
> > >
> > > 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.
> 
> If you want to know the total offload count, You can just create an api like
> 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 testpmd,
> 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
> 
> Regards
> Qi
> 
Yes, you are right. 
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

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-03-22  0:41 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-20  4:00 [dpdk-dev] [PATCH] ethdev: add enum type for loop on Rx/Tx offloads Wei Dai
2018-03-20 11:59 ` Ferruh Yigit
2018-03-20 12:00 ` Ananyev, Konstantin
2018-03-21 14:08   ` Dai, Wei
2018-03-21 14:23     ` Zhang, Qi Z
2018-03-22  0:41       ` Dai, Wei

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).