[v4,2/3] ethdev: extend RSS offload types

Message ID 1569574449-47991-3-git-send-email-simei.su@intel.com (mailing list archive)
State Superseded, archived
Delegated to: Ferruh Yigit
Headers
Series extend RSS offload types |

Checks

Context Check Description
ci/Intel-compilation success Compilation OK
ci/checkpatch success coding style OK

Commit Message

Simei Su Sept. 27, 2019, 8:54 a.m. UTC
  This patch reserves several bits as input set selection from the
high end of the 64 bits. It is combined with exisiting ETH_RSS_*
to represent rss types.

for example:
  ETH_RSS_IPV4 | ETH_RSS_L3_SRC_ONLY: hash on src ip address only
  ETH_RSS_IPV4_UDP | ETH_RSS_L4_DST_ONLY: hash on src/dst IP and
                                          dst UDP port

Signed-off-by: Simei Su <simei.su@intel.com>
---
 lib/librte_ethdev/rte_ethdev.h | 13 +++++++++++++
 1 file changed, 13 insertions(+)
  

Comments

Qi Zhang Sept. 28, 2019, 1:03 a.m. UTC | #1
> -----Original Message-----
> From: Su, Simei
> Sent: Friday, September 27, 2019 4:54 PM
> To: Zhang, Qi Z <qi.z.zhang@intel.com>; Wu, Jingjing <jingjing.wu@intel.com>;
> Ye, Xiaolong <xiaolong.ye@intel.com>
> Cc: dev@dpdk.org; Su, Simei <simei.su@intel.com>
> Subject: [PATCH v4 2/3] ethdev: extend RSS offload types
> 
> This patch reserves several bits as input set selection from the high end of the
> 64 bits. It is combined with exisiting ETH_RSS_* to represent rss types.
> 
> for example:
>   ETH_RSS_IPV4 | ETH_RSS_L3_SRC_ONLY: hash on src ip address only
>   ETH_RSS_IPV4_UDP | ETH_RSS_L4_DST_ONLY: hash on src/dst IP and
>                                           dst UDP port
> 
> Signed-off-by: Simei Su <simei.su@intel.com>
> ---
>  lib/librte_ethdev/rte_ethdev.h | 13 +++++++++++++
>  1 file changed, 13 insertions(+)
> 
> diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
> index 1605467..106b67f 100644
> --- a/lib/librte_ethdev/rte_ethdev.h
> +++ b/lib/librte_ethdev/rte_ethdev.h
> @@ -505,6 +505,19 @@ struct rte_eth_rss_conf {
>  #define ETH_RSS_GENEVE             (1ULL << 20)
>  #define ETH_RSS_NVGRE              (1ULL << 21)
> 
> +/*
> + * We use the following macros to combine with above ETH_RSS_* for
> + * more specific input set selection. These bits are defined starting
> + * from the high end of the 64 bits.
> + * Note: If we use above ETH_RSS_* without SRC/DST_ONLY, it represents
> + * both SRC and DST are taken into account. SRC_ONLY and DST_ONLY can't

To be more accurate, should be SRC_ONLY and DST_ONLY of the same level can't be used simultaneously.

> + * be used simultaneously.
> + */
> +#define ETH_RSS_L3_SRC_ONLY        (1ULL << 63)
> +#define ETH_RSS_L3_DST_ONLY        (1ULL << 62)
> +#define ETH_RSS_L4_SRC_ONLY        (1ULL << 61)
> +#define ETH_RSS_L4_DST_ONLY        (1ULL << 60)
> +
>  #define ETH_RSS_IP ( \
>  	ETH_RSS_IPV4 | \
>  	ETH_RSS_FRAG_IPV4 | \
> --
> 1.8.3.1
  
Simei Su Sept. 28, 2019, 1:39 a.m. UTC | #2
Hi, Zhangqi

> -----Original Message-----
> From: Zhang, Qi Z
> Sent: Saturday, September 28, 2019 9:04 AM
> To: Su, Simei <simei.su@intel.com>; Wu, Jingjing <jingjing.wu@intel.com>; Ye,
> Xiaolong <xiaolong.ye@intel.com>
> Cc: dev@dpdk.org
> Subject: RE: [PATCH v4 2/3] ethdev: extend RSS offload types
> 
> 
> 
> > -----Original Message-----
> > From: Su, Simei
> > Sent: Friday, September 27, 2019 4:54 PM
> > To: Zhang, Qi Z <qi.z.zhang@intel.com>; Wu, Jingjing
> > <jingjing.wu@intel.com>; Ye, Xiaolong <xiaolong.ye@intel.com>
> > Cc: dev@dpdk.org; Su, Simei <simei.su@intel.com>
> > Subject: [PATCH v4 2/3] ethdev: extend RSS offload types
> >
> > This patch reserves several bits as input set selection from the high
> > end of the
> > 64 bits. It is combined with exisiting ETH_RSS_* to represent rss types.
> >
> > for example:
> >   ETH_RSS_IPV4 | ETH_RSS_L3_SRC_ONLY: hash on src ip address only
> >   ETH_RSS_IPV4_UDP | ETH_RSS_L4_DST_ONLY: hash on src/dst IP and
> >                                           dst UDP port
> >
> > Signed-off-by: Simei Su <simei.su@intel.com>
> > ---
> >  lib/librte_ethdev/rte_ethdev.h | 13 +++++++++++++
> >  1 file changed, 13 insertions(+)
> >
> > diff --git a/lib/librte_ethdev/rte_ethdev.h
> > b/lib/librte_ethdev/rte_ethdev.h index 1605467..106b67f 100644
> > --- a/lib/librte_ethdev/rte_ethdev.h
> > +++ b/lib/librte_ethdev/rte_ethdev.h
> > @@ -505,6 +505,19 @@ struct rte_eth_rss_conf {
> >  #define ETH_RSS_GENEVE             (1ULL << 20)
> >  #define ETH_RSS_NVGRE              (1ULL << 21)
> >
> > +/*
> > + * We use the following macros to combine with above ETH_RSS_* for
> > + * more specific input set selection. These bits are defined starting
> > + * from the high end of the 64 bits.
> > + * Note: If we use above ETH_RSS_* without SRC/DST_ONLY, it
> > +represents
> > + * both SRC and DST are taken into account. SRC_ONLY and DST_ONLY
> > +can't
> 
> To be more accurate, should be SRC_ONLY and DST_ONLY of the same level can't
> be used simultaneously.

 Ok, I will modify it in v5. Thanks.

> 
> > + * be used simultaneously.
> > + */
> > +#define ETH_RSS_L3_SRC_ONLY        (1ULL << 63)
> > +#define ETH_RSS_L3_DST_ONLY        (1ULL << 62)
> > +#define ETH_RSS_L4_SRC_ONLY        (1ULL << 61)
> > +#define ETH_RSS_L4_DST_ONLY        (1ULL << 60)
> > +
> >  #define ETH_RSS_IP ( \
> >  	ETH_RSS_IPV4 | \
> >  	ETH_RSS_FRAG_IPV4 | \
> > --
> > 1.8.3.1
  

Patch

diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
index 1605467..106b67f 100644
--- a/lib/librte_ethdev/rte_ethdev.h
+++ b/lib/librte_ethdev/rte_ethdev.h
@@ -505,6 +505,19 @@  struct rte_eth_rss_conf {
 #define ETH_RSS_GENEVE             (1ULL << 20)
 #define ETH_RSS_NVGRE              (1ULL << 21)
 
+/*
+ * We use the following macros to combine with above ETH_RSS_* for
+ * more specific input set selection. These bits are defined starting
+ * from the high end of the 64 bits.
+ * Note: If we use above ETH_RSS_* without SRC/DST_ONLY, it represents
+ * both SRC and DST are taken into account. SRC_ONLY and DST_ONLY can't
+ * be used simultaneously.
+ */
+#define ETH_RSS_L3_SRC_ONLY        (1ULL << 63)
+#define ETH_RSS_L3_DST_ONLY        (1ULL << 62)
+#define ETH_RSS_L4_SRC_ONLY        (1ULL << 61)
+#define ETH_RSS_L4_DST_ONLY        (1ULL << 60)
+
 #define ETH_RSS_IP ( \
 	ETH_RSS_IPV4 | \
 	ETH_RSS_FRAG_IPV4 | \