Currently, when use 'flow' command to create a negative GTP-U rule, it will be created successfully. The list shows the impacted outer and inner 'ipv4' GTP-U patterns with 'ipv4' or 'gtpu' type: - iavf_pattern_eth_ipv4_gtpu_ipv4_udp - iavf_pattern_eth_ipv4_gtpu_eh_ipv4_udp - iavf_pattern_eth_ipv4_gtpu_ipv4_tcp - iavf_pattern_eth_ipv4_gtpu_eh_ipv4_tcp - more impacted patterns with 'gtpu' type: > iavf_pattern_eth_ipv4_gtpu_ipv4 > iavf_pattern_eth_ipv4_gtpu_eh_ipv4 Same as the outer and inner 'ipv6' GTP-U patterns. So, this commit modifies the macro define of the 'IAVF_RSS_TYPE_XXX' to make the result correct. Fixes: 91f27b2e39ab ("net/iavf: refactor RSS") Signed-off-by: Murphy Yang <murphyx.yang@intel.com> --- drivers/net/iavf/iavf_hash.c | 30 ++++++++++-------------------- 1 file changed, 10 insertions(+), 20 deletions(-) diff --git a/drivers/net/iavf/iavf_hash.c b/drivers/net/iavf/iavf_hash.c index c4c73e6644..7a3ea39d66 100644 --- a/drivers/net/iavf/iavf_hash.c +++ b/drivers/net/iavf/iavf_hash.c @@ -326,34 +326,24 @@ struct virtchnl_proto_hdrs ipv6_udp_gtpc_tmplt = { ETH_RSS_S_VLAN | ETH_RSS_C_VLAN) /* IPv4 inner */ #define IAVF_RSS_TYPE_INNER_IPV4 ETH_RSS_IPV4 -#define IAVF_RSS_TYPE_INNER_IPV4_UDP (ETH_RSS_IPV4 | \ - ETH_RSS_NONFRAG_IPV4_UDP) -#define IAVF_RSS_TYPE_INNER_IPV4_TCP (ETH_RSS_IPV4 | \ - ETH_RSS_NONFRAG_IPV4_TCP) +#define IAVF_RSS_TYPE_INNER_IPV4_UDP (ETH_RSS_NONFRAG_IPV4_UDP) +#define IAVF_RSS_TYPE_INNER_IPV4_TCP (ETH_RSS_NONFRAG_IPV4_TCP) #define IAVF_RSS_TYPE_INNER_IPV4_SCTP (ETH_RSS_IPV4 | \ ETH_RSS_NONFRAG_IPV4_SCTP) /* IPv6 inner */ #define IAVF_RSS_TYPE_INNER_IPV6 ETH_RSS_IPV6 -#define IAVF_RSS_TYPE_INNER_IPV6_UDP (ETH_RSS_IPV6 | \ - ETH_RSS_NONFRAG_IPV6_UDP) -#define IAVF_RSS_TYPE_INNER_IPV6_TCP (ETH_RSS_IPV6 | \ - ETH_RSS_NONFRAG_IPV6_TCP) +#define IAVF_RSS_TYPE_INNER_IPV6_UDP (ETH_RSS_NONFRAG_IPV6_UDP) +#define IAVF_RSS_TYPE_INNER_IPV6_TCP (ETH_RSS_NONFRAG_IPV6_TCP) #define IAVF_RSS_TYPE_INNER_IPV6_SCTP (ETH_RSS_IPV6 | \ ETH_RSS_NONFRAG_IPV6_SCTP) /* GTPU IPv4 */ -#define IAVF_RSS_TYPE_GTPU_IPV4 (IAVF_RSS_TYPE_INNER_IPV4 | \ - ETH_RSS_GTPU) -#define IAVF_RSS_TYPE_GTPU_IPV4_UDP (IAVF_RSS_TYPE_INNER_IPV4_UDP | \ - ETH_RSS_GTPU) -#define IAVF_RSS_TYPE_GTPU_IPV4_TCP (IAVF_RSS_TYPE_INNER_IPV4_TCP | \ - ETH_RSS_GTPU) +#define IAVF_RSS_TYPE_GTPU_IPV4 (IAVF_RSS_TYPE_INNER_IPV4) +#define IAVF_RSS_TYPE_GTPU_IPV4_UDP (IAVF_RSS_TYPE_INNER_IPV4_UDP) +#define IAVF_RSS_TYPE_GTPU_IPV4_TCP (IAVF_RSS_TYPE_INNER_IPV4_TCP) /* GTPU IPv6 */ -#define IAVF_RSS_TYPE_GTPU_IPV6 (IAVF_RSS_TYPE_INNER_IPV6 | \ - ETH_RSS_GTPU) -#define IAVF_RSS_TYPE_GTPU_IPV6_UDP (IAVF_RSS_TYPE_INNER_IPV6_UDP | \ - ETH_RSS_GTPU) -#define IAVF_RSS_TYPE_GTPU_IPV6_TCP (IAVF_RSS_TYPE_INNER_IPV6_TCP | \ - ETH_RSS_GTPU) +#define IAVF_RSS_TYPE_GTPU_IPV6 (IAVF_RSS_TYPE_INNER_IPV6) +#define IAVF_RSS_TYPE_GTPU_IPV6_UDP (IAVF_RSS_TYPE_INNER_IPV6_UDP) +#define IAVF_RSS_TYPE_GTPU_IPV6_TCP (IAVF_RSS_TYPE_INNER_IPV6_TCP) /* ESP, AH, L2TPV3 and PFCP */ #define IAVF_RSS_TYPE_IPV4_ESP (ETH_RSS_ESP | ETH_RSS_IPV4) #define IAVF_RSS_TYPE_IPV4_AH (ETH_RSS_AH | ETH_RSS_IPV4) -- 2.17.1
Currently, when use 'flow' command to create a negative GTP-U rule, it will be created successfully. The list shows the impacted outer and inner 'ipv4' GTP-U patterns with 'ipv4' or 'gtpu' type: - iavf_pattern_eth_ipv4_gtpu_ipv4_udp - iavf_pattern_eth_ipv4_gtpu_eh_ipv4_udp - iavf_pattern_eth_ipv4_gtpu_ipv4_tcp - iavf_pattern_eth_ipv4_gtpu_eh_ipv4_tcp - more impacted patterns with 'gtpu' type: > iavf_pattern_eth_ipv4_gtpu_ipv4 > iavf_pattern_eth_ipv4_gtpu_eh_ipv4 Same as the outer and inner 'ipv6' GTP-U patterns. So, this commit adds the invalid RSS combinations in 'invalid_rss_comb' array to make result correct. The list of added invalid RSS combinations: - ETH_RSS_IPV4 | ETH_RSS_NONFRAG_IPV4_TCP - ETH_RSS_IPV6 | ETH_RSS_NONFRAG_IPV6_TCP - ETH_RSS_GTPU | IAVF_RSS_TYPE_INNER_IPV4 - ETH_RSS_GTPU | IAVF_RSS_TYPE_INNER_IPV4_UDP - ETH_RSS_GTPU | IAVF_RSS_TYPE_INNER_IPV4_TCP - ETH_RSS_GTPU | IAVF_RSS_TYPE_INNER_IPV6 - ETH_RSS_GTPU | IAVF_RSS_TYPE_INNER_IPV6_UDP - ETH_RSS_GTPU | IAVF_RSS_TYPE_INNER_IPV6_TCP Fixes: 91f27b2e39ab ("net/iavf: refactor RSS") Signed-off-by: Murphy Yang <murphyx.yang@intel.com> --- v2: - add invalid RSS combinations drivers/net/iavf/iavf_hash.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/net/iavf/iavf_hash.c b/drivers/net/iavf/iavf_hash.c index c4c73e6644..8393d8535b 100644 --- a/drivers/net/iavf/iavf_hash.c +++ b/drivers/net/iavf/iavf_hash.c @@ -806,7 +806,15 @@ static void iavf_refine_proto_hdrs(struct virtchnl_proto_hdrs *proto_hdrs, static uint64_t invalid_rss_comb[] = { ETH_RSS_IPV4 | ETH_RSS_NONFRAG_IPV4_UDP, + ETH_RSS_IPV4 | ETH_RSS_NONFRAG_IPV4_TCP, ETH_RSS_IPV6 | ETH_RSS_NONFRAG_IPV6_UDP, + ETH_RSS_IPV6 | ETH_RSS_NONFRAG_IPV6_TCP, + ETH_RSS_GTPU | IAVF_RSS_TYPE_INNER_IPV4, + ETH_RSS_GTPU | IAVF_RSS_TYPE_INNER_IPV4_UDP, + ETH_RSS_GTPU | IAVF_RSS_TYPE_INNER_IPV4_TCP, + ETH_RSS_GTPU | IAVF_RSS_TYPE_INNER_IPV6, + ETH_RSS_GTPU | IAVF_RSS_TYPE_INNER_IPV6_UDP, + ETH_RSS_GTPU | IAVF_RSS_TYPE_INNER_IPV6_TCP, RTE_ETH_RSS_L3_PRE32 | RTE_ETH_RSS_L3_PRE40 | RTE_ETH_RSS_L3_PRE48 | RTE_ETH_RSS_L3_PRE56 | RTE_ETH_RSS_L3_PRE96 -- 2.17.1
Hi, murphy > -----Original Message----- > From: Murphy Yang <murphyx.yang@intel.com> > Sent: Friday, December 18, 2020 2:19 PM > To: dev@dpdk.org > Cc: Yang, Qiming <qiming.yang@intel.com>; Yang, SteveX > <stevex.yang@intel.com>; Guo, Jia <jia.guo@intel.com>; Wu, Jingjing > <jingjing.wu@intel.com>; Xing, Beilei <beilei.xing@intel.com>; Yang, > MurphyX <murphyx.yang@intel.com> > Subject: [PATCH v2] net/iavf: fix negative GTP-U flow rules create > successfully > > Currently, when use 'flow' command to create a negative GTP-U rule, it will > be created successfully. > > The list shows the impacted outer and inner 'ipv4' GTP-U patterns with 'ipv4' > or 'gtpu' type: > - iavf_pattern_eth_ipv4_gtpu_ipv4_udp > - iavf_pattern_eth_ipv4_gtpu_eh_ipv4_udp > - iavf_pattern_eth_ipv4_gtpu_ipv4_tcp > - iavf_pattern_eth_ipv4_gtpu_eh_ipv4_tcp > - more impacted patterns with 'gtpu' type: > > iavf_pattern_eth_ipv4_gtpu_ipv4 > > iavf_pattern_eth_ipv4_gtpu_eh_ipv4 > > Same as the outer and inner 'ipv6' GTP-U patterns. > > So, this commit adds the invalid RSS combinations in 'invalid_rss_comb' > array to make result correct. > > The list of added invalid RSS combinations: > - ETH_RSS_IPV4 | ETH_RSS_NONFRAG_IPV4_TCP > - ETH_RSS_IPV6 | ETH_RSS_NONFRAG_IPV6_TCP > - ETH_RSS_GTPU | IAVF_RSS_TYPE_INNER_IPV4 > - ETH_RSS_GTPU | IAVF_RSS_TYPE_INNER_IPV4_UDP > - ETH_RSS_GTPU | IAVF_RSS_TYPE_INNER_IPV4_TCP > - ETH_RSS_GTPU | IAVF_RSS_TYPE_INNER_IPV6 > - ETH_RSS_GTPU | IAVF_RSS_TYPE_INNER_IPV6_UDP > - ETH_RSS_GTPU | IAVF_RSS_TYPE_INNER_IPV6_TCP > Seem that you add some specific negative flow case for the "ipv4(outer/inner) + gtpu" and "ipv4(outer/inner) + ipv4-udp(tcp)" in the currently invalid checking mode, so you commit log could be more clear and clean for that, thanks. > Fixes: 91f27b2e39ab ("net/iavf: refactor RSS") > > Signed-off-by: Murphy Yang <murphyx.yang@intel.com> > --- > v2: > - add invalid RSS combinations > > drivers/net/iavf/iavf_hash.c | 8 ++++++++ > 1 file changed, 8 insertions(+) > > diff --git a/drivers/net/iavf/iavf_hash.c b/drivers/net/iavf/iavf_hash.c index > c4c73e6644..8393d8535b 100644 > --- a/drivers/net/iavf/iavf_hash.c > +++ b/drivers/net/iavf/iavf_hash.c > @@ -806,7 +806,15 @@ static void iavf_refine_proto_hdrs(struct > virtchnl_proto_hdrs *proto_hdrs, > > static uint64_t invalid_rss_comb[] = { > ETH_RSS_IPV4 | ETH_RSS_NONFRAG_IPV4_UDP, > + ETH_RSS_IPV4 | ETH_RSS_NONFRAG_IPV4_TCP, > ETH_RSS_IPV6 | ETH_RSS_NONFRAG_IPV6_UDP, > + ETH_RSS_IPV6 | ETH_RSS_NONFRAG_IPV6_TCP, > + ETH_RSS_GTPU | IAVF_RSS_TYPE_INNER_IPV4, > + ETH_RSS_GTPU | IAVF_RSS_TYPE_INNER_IPV4_UDP, > + ETH_RSS_GTPU | IAVF_RSS_TYPE_INNER_IPV4_TCP, > + ETH_RSS_GTPU | IAVF_RSS_TYPE_INNER_IPV6, > + ETH_RSS_GTPU | IAVF_RSS_TYPE_INNER_IPV6_UDP, > + ETH_RSS_GTPU | IAVF_RSS_TYPE_INNER_IPV6_TCP, Shouldn't it be " ETH_RSS_GTPU | ETH_RSS_IPV4" if outer ip case is the same? Whatever you should considerate both if you check one. > RTE_ETH_RSS_L3_PRE32 | RTE_ETH_RSS_L3_PRE40 | > RTE_ETH_RSS_L3_PRE48 | RTE_ETH_RSS_L3_PRE56 | > RTE_ETH_RSS_L3_PRE96 > -- > 2.17.1
Currently, when use 'flow' command to create a rule that combine with several RSS types, even the RSS type combination is invalid, it also be created successfully. Here list some invalid RSS combinations: - ETH_RSS_IPV4 | ETH_RSS_NONFRAG_IPV4_TCP - ETH_RSS_IPV6 | ETH_RSS_NONFRAG_IPV6_TCP - ETH_RSS_GTPU | IAVF_RSS_TYPE_INNER_IPV4 - ETH_RSS_GTPU | IAVF_RSS_TYPE_INNER_IPV4_UDP - ETH_RSS_GTPU | IAVF_RSS_TYPE_INNER_IPV4_TCP - ETH_RSS_GTPU | IAVF_RSS_TYPE_INNER_IPV6 - ETH_RSS_GTPU | IAVF_RSS_TYPE_INNER_IPV6_UDP - ETH_RSS_GTPU | IAVF_RSS_TYPE_INNER_IPV6_TCP So, this patch adds these combinations in 'invalid_rss_comb' array to do valid check, if the combination check failed, the rule will be created unsuccessful. Fixes: 91f27b2e39ab ("net/iavf: refactor RSS") Signed-off-by: Murphy Yang <murphyx.yang@intel.com> --- v3: - update the comments. v2: - add invalid RSS combinations. drivers/net/iavf/iavf_hash.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/net/iavf/iavf_hash.c b/drivers/net/iavf/iavf_hash.c index c4c73e6644..8393d8535b 100644 --- a/drivers/net/iavf/iavf_hash.c +++ b/drivers/net/iavf/iavf_hash.c @@ -806,7 +806,15 @@ static void iavf_refine_proto_hdrs(struct virtchnl_proto_hdrs *proto_hdrs, static uint64_t invalid_rss_comb[] = { ETH_RSS_IPV4 | ETH_RSS_NONFRAG_IPV4_UDP, + ETH_RSS_IPV4 | ETH_RSS_NONFRAG_IPV4_TCP, ETH_RSS_IPV6 | ETH_RSS_NONFRAG_IPV6_UDP, + ETH_RSS_IPV6 | ETH_RSS_NONFRAG_IPV6_TCP, + ETH_RSS_GTPU | IAVF_RSS_TYPE_INNER_IPV4, + ETH_RSS_GTPU | IAVF_RSS_TYPE_INNER_IPV4_UDP, + ETH_RSS_GTPU | IAVF_RSS_TYPE_INNER_IPV4_TCP, + ETH_RSS_GTPU | IAVF_RSS_TYPE_INNER_IPV6, + ETH_RSS_GTPU | IAVF_RSS_TYPE_INNER_IPV6_UDP, + ETH_RSS_GTPU | IAVF_RSS_TYPE_INNER_IPV6_TCP, RTE_ETH_RSS_L3_PRE32 | RTE_ETH_RSS_L3_PRE40 | RTE_ETH_RSS_L3_PRE48 | RTE_ETH_RSS_L3_PRE56 | RTE_ETH_RSS_L3_PRE96 -- 2.17.1
Currently, when use 'flow' command to create a rule that combine with several RSS types, even the RSS type combination is invalid, it also be created successfully. Here list some invalid RSS combinations: - ETH_RSS_IPV4 | ETH_RSS_NONFRAG_IPV4_TCP - ETH_RSS_IPV6 | ETH_RSS_NONFRAG_IPV6_TCP - ETH_RSS_GTPU | ETH_RSS_IPV4 - ETH_RSS_GTPU | ETH_RSS_IPV4 | ETH_RSS_NONFRAG_IPV4_UDP - ETH_RSS_GTPU | ETH_RSS_IPV4 | ETH_RSS_NONFRAG_IPV4_TCP - ETH_RSS_GTPU | ETH_RSS_IPV6 - ETH_RSS_GTPU | ETH_RSS_IPV6 | ETH_RSS_NONFRAG_IPV6_UDP - ETH_RSS_GTPU | ETH_RSS_IPV6 | ETH_RSS_NONFRAG_IPV6_TCP So, this patch adds these combinations in 'invalid_rss_comb' array to do valid check, if the combination check failed, the rule will be created unsuccessful. Fixes: 91f27b2e39ab ("net/iavf: refactor RSS") Signed-off-by: Murphy Yang <murphyx.yang@intel.com> --- v4: - use 'ETH_RSS_XXX' replace 'IAVF_RSS_TYPE_INNER_XXX' v3: - update the comments. v2: - add invalid RSS combinations. drivers/net/iavf/iavf_hash.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/net/iavf/iavf_hash.c b/drivers/net/iavf/iavf_hash.c index c4c73e6644..3ed72f6475 100644 --- a/drivers/net/iavf/iavf_hash.c +++ b/drivers/net/iavf/iavf_hash.c @@ -806,7 +806,15 @@ static void iavf_refine_proto_hdrs(struct virtchnl_proto_hdrs *proto_hdrs, static uint64_t invalid_rss_comb[] = { ETH_RSS_IPV4 | ETH_RSS_NONFRAG_IPV4_UDP, + ETH_RSS_IPV4 | ETH_RSS_NONFRAG_IPV4_TCP, ETH_RSS_IPV6 | ETH_RSS_NONFRAG_IPV6_UDP, + ETH_RSS_IPV6 | ETH_RSS_NONFRAG_IPV6_TCP, + ETH_RSS_GTPU | ETH_RSS_IPV4, + ETH_RSS_GTPU | ETH_RSS_IPV4 | ETH_RSS_NONFRAG_IPV4_UDP, + ETH_RSS_GTPU | ETH_RSS_IPV4 | ETH_RSS_NONFRAG_IPV4_TCP, + ETH_RSS_GTPU | ETH_RSS_IPV6, + ETH_RSS_GTPU | ETH_RSS_IPV6 | ETH_RSS_NONFRAG_IPV6_UDP, + ETH_RSS_GTPU | ETH_RSS_IPV6 | ETH_RSS_NONFRAG_IPV6_TCP, RTE_ETH_RSS_L3_PRE32 | RTE_ETH_RSS_L3_PRE40 | RTE_ETH_RSS_L3_PRE48 | RTE_ETH_RSS_L3_PRE56 | RTE_ETH_RSS_L3_PRE96 -- 2.17.1
Acked-by: Jeff Guo <jia.guo@intel.com>
> -----Original Message-----
> From: Murphy Yang <murphyx.yang@intel.com>
> Sent: Wednesday, December 23, 2020 4:04 PM
> To: dev@dpdk.org
> Cc: Yang, Qiming <qiming.yang@intel.com>; Guo, Jia <jia.guo@intel.com>;
> Zhang, Qi Z <qi.z.zhang@intel.com>; Yang, SteveX <stevex.yang@intel.com>;
> Wu, Jingjing <jingjing.wu@intel.com>; Xing, Beilei <beilei.xing@intel.com>;
> Yang, MurphyX <murphyx.yang@intel.com>
> Subject: [PATCH v4] net/iavf: fix invalid RSS combinations rule can be created
>
> Currently, when use 'flow' command to create a rule that combine with
> several RSS types, even the RSS type combination is invalid, it also be created
> successfully.
>
> Here list some invalid RSS combinations:
> - ETH_RSS_IPV4 | ETH_RSS_NONFRAG_IPV4_TCP
> - ETH_RSS_IPV6 | ETH_RSS_NONFRAG_IPV6_TCP
> - ETH_RSS_GTPU | ETH_RSS_IPV4
> - ETH_RSS_GTPU | ETH_RSS_IPV4 | ETH_RSS_NONFRAG_IPV4_UDP
> - ETH_RSS_GTPU | ETH_RSS_IPV4 | ETH_RSS_NONFRAG_IPV4_TCP
> - ETH_RSS_GTPU | ETH_RSS_IPV6
> - ETH_RSS_GTPU | ETH_RSS_IPV6 | ETH_RSS_NONFRAG_IPV6_UDP
> - ETH_RSS_GTPU | ETH_RSS_IPV6 | ETH_RSS_NONFRAG_IPV6_TCP
>
> So, this patch adds these combinations in 'invalid_rss_comb'
> array to do valid check, if the combination check failed, the rule will be
> created unsuccessful.
>
> Fixes: 91f27b2e39ab ("net/iavf: refactor RSS")
>
> Signed-off-by: Murphy Yang <murphyx.yang@intel.com>
> ---
> v4:
> - use 'ETH_RSS_XXX' replace 'IAVF_RSS_TYPE_INNER_XXX'
> v3:
> - update the comments.
> v2:
> - add invalid RSS combinations.
>
> drivers/net/iavf/iavf_hash.c | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/drivers/net/iavf/iavf_hash.c b/drivers/net/iavf/iavf_hash.c index
> c4c73e6644..3ed72f6475 100644
> --- a/drivers/net/iavf/iavf_hash.c
> +++ b/drivers/net/iavf/iavf_hash.c
> @@ -806,7 +806,15 @@ static void iavf_refine_proto_hdrs(struct
> virtchnl_proto_hdrs *proto_hdrs,
>
> static uint64_t invalid_rss_comb[] = {
> ETH_RSS_IPV4 | ETH_RSS_NONFRAG_IPV4_UDP,
> + ETH_RSS_IPV4 | ETH_RSS_NONFRAG_IPV4_TCP,
> ETH_RSS_IPV6 | ETH_RSS_NONFRAG_IPV6_UDP,
> + ETH_RSS_IPV6 | ETH_RSS_NONFRAG_IPV6_TCP,
> + ETH_RSS_GTPU | ETH_RSS_IPV4,
> + ETH_RSS_GTPU | ETH_RSS_IPV4 | ETH_RSS_NONFRAG_IPV4_UDP,
> + ETH_RSS_GTPU | ETH_RSS_IPV4 | ETH_RSS_NONFRAG_IPV4_TCP,
> + ETH_RSS_GTPU | ETH_RSS_IPV6,
> + ETH_RSS_GTPU | ETH_RSS_IPV6 | ETH_RSS_NONFRAG_IPV6_UDP,
> + ETH_RSS_GTPU | ETH_RSS_IPV6 | ETH_RSS_NONFRAG_IPV6_TCP,
> RTE_ETH_RSS_L3_PRE32 | RTE_ETH_RSS_L3_PRE40 |
> RTE_ETH_RSS_L3_PRE48 | RTE_ETH_RSS_L3_PRE56 |
> RTE_ETH_RSS_L3_PRE96
> --
> 2.17.1
Currently, when use 'flow' command to create a rule that combine with several RSS types, even the RSS type combination is invalid, it also be created successfully. Here list some invalid RSS combinations: - ETH_RSS_IPV4 | ETH_RSS_NONFRAG_IPV4_TCP - ETH_RSS_IPV6 | ETH_RSS_NONFRAG_IPV6_TCP - ETH_RSS_GTPU | ETH_RSS_IPV4 - ETH_RSS_GTPU | ETH_RSS_IPV4 | ETH_RSS_NONFRAG_IPV4_UDP - ETH_RSS_GTPU | ETH_RSS_IPV4 | ETH_RSS_NONFRAG_IPV4_TCP - ETH_RSS_GTPU | ETH_RSS_IPV6 - ETH_RSS_GTPU | ETH_RSS_IPV6 | ETH_RSS_NONFRAG_IPV6_UDP - ETH_RSS_GTPU | ETH_RSS_IPV6 | ETH_RSS_NONFRAG_IPV6_TCP For 'ETH_RSS_IPV4 | ETH_RSS_NONFRAG_IPV4_TCP' (same as IPV6), this pathch adds these combinations in 'invalid_rss_comb' array to do valid check, if the combination check failed, the rule will be created unsuccessful. For other 'ETH_RSS_GTPU' invalid combinations, this patch removes the 'ETH_RSS_GTPU' from the input set mask, if the combination is invalid, the 'rss_type' check will be failed, the rule will be created unsuccessful. Fixes: 91f27b2e39ab ("net/iavf: refactor RSS") Signed-off-by: Murphy Yang <murphyx.yang@intel.com> --- v5: - remove 'ETH_RSS_GTPU' from input set mask. v4: - use 'ETH_RSS_XXX' replace 'IAVF_RSS_TYPE_INNER_XXX' v3: - update the comments. v2: - add invalid RSS combinations. drivers/net/iavf/iavf_hash.c | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/drivers/net/iavf/iavf_hash.c b/drivers/net/iavf/iavf_hash.c index c4c73e6644..916d6c5dfa 100644 --- a/drivers/net/iavf/iavf_hash.c +++ b/drivers/net/iavf/iavf_hash.c @@ -341,19 +341,13 @@ struct virtchnl_proto_hdrs ipv6_udp_gtpc_tmplt = { #define IAVF_RSS_TYPE_INNER_IPV6_SCTP (ETH_RSS_IPV6 | \ ETH_RSS_NONFRAG_IPV6_SCTP) /* GTPU IPv4 */ -#define IAVF_RSS_TYPE_GTPU_IPV4 (IAVF_RSS_TYPE_INNER_IPV4 | \ - ETH_RSS_GTPU) -#define IAVF_RSS_TYPE_GTPU_IPV4_UDP (IAVF_RSS_TYPE_INNER_IPV4_UDP | \ - ETH_RSS_GTPU) -#define IAVF_RSS_TYPE_GTPU_IPV4_TCP (IAVF_RSS_TYPE_INNER_IPV4_TCP | \ - ETH_RSS_GTPU) +#define IAVF_RSS_TYPE_GTPU_IPV4 IAVF_RSS_TYPE_INNER_IPV4 +#define IAVF_RSS_TYPE_GTPU_IPV4_UDP IAVF_RSS_TYPE_INNER_IPV4_UDP +#define IAVF_RSS_TYPE_GTPU_IPV4_TCP IAVF_RSS_TYPE_INNER_IPV4_TCP /* GTPU IPv6 */ -#define IAVF_RSS_TYPE_GTPU_IPV6 (IAVF_RSS_TYPE_INNER_IPV6 | \ - ETH_RSS_GTPU) -#define IAVF_RSS_TYPE_GTPU_IPV6_UDP (IAVF_RSS_TYPE_INNER_IPV6_UDP | \ - ETH_RSS_GTPU) -#define IAVF_RSS_TYPE_GTPU_IPV6_TCP (IAVF_RSS_TYPE_INNER_IPV6_TCP | \ - ETH_RSS_GTPU) +#define IAVF_RSS_TYPE_GTPU_IPV6 IAVF_RSS_TYPE_INNER_IPV6 +#define IAVF_RSS_TYPE_GTPU_IPV6_UDP IAVF_RSS_TYPE_INNER_IPV6_UDP +#define IAVF_RSS_TYPE_GTPU_IPV6_TCP IAVF_RSS_TYPE_INNER_IPV6_TCP /* ESP, AH, L2TPV3 and PFCP */ #define IAVF_RSS_TYPE_IPV4_ESP (ETH_RSS_ESP | ETH_RSS_IPV4) #define IAVF_RSS_TYPE_IPV4_AH (ETH_RSS_AH | ETH_RSS_IPV4) @@ -806,7 +800,9 @@ static void iavf_refine_proto_hdrs(struct virtchnl_proto_hdrs *proto_hdrs, static uint64_t invalid_rss_comb[] = { ETH_RSS_IPV4 | ETH_RSS_NONFRAG_IPV4_UDP, + ETH_RSS_IPV4 | ETH_RSS_NONFRAG_IPV4_TCP, ETH_RSS_IPV6 | ETH_RSS_NONFRAG_IPV6_UDP, + ETH_RSS_IPV6 | ETH_RSS_NONFRAG_IPV6_TCP, RTE_ETH_RSS_L3_PRE32 | RTE_ETH_RSS_L3_PRE40 | RTE_ETH_RSS_L3_PRE48 | RTE_ETH_RSS_L3_PRE56 | RTE_ETH_RSS_L3_PRE96 -- 2.17.1
Currently, when use 'flow' command to create a rule that combine with several RSS types, even the RSS type combination is invalid or unsupported, it also be created successfully. Here list some invalid RSS combinations: - ETH_RSS_IPV4 | ETH_RSS_NONFRAG_IPV4_TCP - ETH_RSS_IPV6 | ETH_RSS_NONFRAG_IPV6_TCP Here list some currently unsupported RSS combinations: - ETH_RSS_GTPU | ETH_RSS_IPV4 - ETH_RSS_GTPU | ETH_RSS_IPV4 | ETH_RSS_NONFRAG_IPV4_UDP - ETH_RSS_GTPU | ETH_RSS_IPV4 | ETH_RSS_NONFRAG_IPV4_TCP - ETH_RSS_GTPU | ETH_RSS_IPV6 - ETH_RSS_GTPU | ETH_RSS_IPV6 | ETH_RSS_NONFRAG_IPV6_UDP - ETH_RSS_GTPU | ETH_RSS_IPV6 | ETH_RSS_NONFRAG_IPV6_TCP For invalid RSS combinations, this patch adds these combinations in 'invalid_rss_comb' array to do valid check, if the combination check failed, the rule will be created unsuccessful. For unsupported RSS combinations, this patch adds these combinations in 'unsupported_rss_comb' array to do valid check, if the combination check failed, the rule will be created unsuccessful. Fixes: 91f27b2e39ab ("net/iavf: refactor RSS") Signed-off-by: Murphy Yang <murphyx.yang@intel.com> --- v6: - add unsupported RSS combinations array. v5: - remove 'ETH_RSS_GTPU' from input set mask. v4: - use 'ETH_RSS_XXX' replace 'IAVF_RSS_TYPE_INNER_XXX' v3: - update the comments. v2: - add invalid RSS combinations. drivers/net/iavf/iavf_hash.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/drivers/net/iavf/iavf_hash.c b/drivers/net/iavf/iavf_hash.c index c4c73e6644..0061eb6652 100644 --- a/drivers/net/iavf/iavf_hash.c +++ b/drivers/net/iavf/iavf_hash.c @@ -806,12 +806,23 @@ static void iavf_refine_proto_hdrs(struct virtchnl_proto_hdrs *proto_hdrs, static uint64_t invalid_rss_comb[] = { ETH_RSS_IPV4 | ETH_RSS_NONFRAG_IPV4_UDP, + ETH_RSS_IPV4 | ETH_RSS_NONFRAG_IPV4_TCP, ETH_RSS_IPV6 | ETH_RSS_NONFRAG_IPV6_UDP, + ETH_RSS_IPV6 | ETH_RSS_NONFRAG_IPV6_TCP, RTE_ETH_RSS_L3_PRE32 | RTE_ETH_RSS_L3_PRE40 | RTE_ETH_RSS_L3_PRE48 | RTE_ETH_RSS_L3_PRE56 | RTE_ETH_RSS_L3_PRE96 }; +static uint64_t unsupported_rss_comb[] = { + ETH_RSS_GTPU | ETH_RSS_IPV4, + ETH_RSS_GTPU | ETH_RSS_IPV4 | ETH_RSS_NONFRAG_IPV4_UDP, + ETH_RSS_GTPU | ETH_RSS_IPV4 | ETH_RSS_NONFRAG_IPV4_TCP, + ETH_RSS_GTPU | ETH_RSS_IPV6, + ETH_RSS_GTPU | ETH_RSS_IPV6 | ETH_RSS_NONFRAG_IPV6_UDP, + ETH_RSS_GTPU | ETH_RSS_IPV6 | ETH_RSS_NONFRAG_IPV6_TCP +}; + struct rss_attr_type { uint64_t attr; uint64_t type; @@ -875,6 +886,13 @@ iavf_any_invalid_rss_type(enum rte_eth_hash_function rss_func, return true; } + /* check unsupported rss combination */ + for (i = 0; i < RTE_DIM(unsupported_rss_comb); i++) { + if (__builtin_popcountll(rss_type & + unsupported_rss_comb[i]) > 1) + return true; + } + /* check invalid RSS attribute */ for (i = 0; i < RTE_DIM(rss_attr_to_valid_type); i++) { struct rss_attr_type *rat = &rss_attr_to_valid_type[i]; -- 2.17.1
Currently, when use 'flow' command to create a rule that combine with several RSS types, even the RSS type combination is invalid, it also be created successfully. Here list some invalid RSS combinations: - ETH_RSS_IPV4 | ETH_RSS_NONFRAG_IPV4_TCP - ETH_RSS_IPV6 | ETH_RSS_NONFRAG_IPV6_TCP For 'ETH_RSS_IPV4 | ETH_RSS_NONFRAG_IPV4_TCP' (same as IPV6), this pathch adds these combinations in 'invalid_rss_comb' array to do valid check, if the combination check failed, the rule will be created unsuccessful. Fixes: 91f27b2e39ab ("net/iavf: refactor RSS") Signed-off-by: Murphy Yang <murphyx.yang@intel.com> --- v7: - Remove unsupported RSS combinations array. - Restored 'ETH_RSS_GTPU' in input set mask. v6: - Add unsupported RSS combinations array. v5: - Remove 'ETH_RSS_GTPU' from input set mask. v4: - Use 'ETH_RSS_XXX' replace 'IAVF_RSS_TYPE_INNER_XXX' v3: - Update the comments. v2: - Add invalid RSS combinations. drivers/net/iavf/iavf_hash.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/iavf/iavf_hash.c b/drivers/net/iavf/iavf_hash.c index 7620876b58..ebaac58254 100644 --- a/drivers/net/iavf/iavf_hash.c +++ b/drivers/net/iavf/iavf_hash.c @@ -863,7 +863,9 @@ static void iavf_refine_proto_hdrs(struct virtchnl_proto_hdrs *proto_hdrs, static uint64_t invalid_rss_comb[] = { ETH_RSS_IPV4 | ETH_RSS_NONFRAG_IPV4_UDP, + ETH_RSS_IPV4 | ETH_RSS_NONFRAG_IPV4_TCP, ETH_RSS_IPV6 | ETH_RSS_NONFRAG_IPV6_UDP, + ETH_RSS_IPV6 | ETH_RSS_NONFRAG_IPV6_TCP, RTE_ETH_RSS_L3_PRE32 | RTE_ETH_RSS_L3_PRE40 | RTE_ETH_RSS_L3_PRE48 | RTE_ETH_RSS_L3_PRE56 | RTE_ETH_RSS_L3_PRE96 -- 2.17.1
Currently, when use 'flow' command to create a rule with following invalid RSS type combination, it can be created successfully. Invalid RSS combinations list: - ETH_RSS_IPV4 | ETH_RSS_NONFRAG_IPV4_TCP - ETH_RSS_IPV6 | ETH_RSS_NONFRAG_IPV6_TCP This patch adds these combinations in 'invalid_rss_comb' array to do valid check, if the combination check failed, the rule will be created unsuccessful. Fixes: 91f27b2e39ab ("net/iavf: refactor RSS") Signed-off-by: Murphy Yang <murphyx.yang@intel.com> --- v8: - Update the comments. v7: - Remove unsupported RSS combinations array. - Restored 'ETH_RSS_GTPU' in input set mask. v6: - Add unsupported RSS combinations array. v5: - Remove 'ETH_RSS_GTPU' from input set mask. v4: - Use 'ETH_RSS_XXX' replace 'IAVF_RSS_TYPE_INNER_XXX' v3: - Update the comments. v2: - Add invalid RSS combinations. drivers/net/iavf/iavf_hash.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/iavf/iavf_hash.c b/drivers/net/iavf/iavf_hash.c index 7620876b58..ebaac58254 100644 --- a/drivers/net/iavf/iavf_hash.c +++ b/drivers/net/iavf/iavf_hash.c @@ -863,7 +863,9 @@ static void iavf_refine_proto_hdrs(struct virtchnl_proto_hdrs *proto_hdrs, static uint64_t invalid_rss_comb[] = { ETH_RSS_IPV4 | ETH_RSS_NONFRAG_IPV4_UDP, + ETH_RSS_IPV4 | ETH_RSS_NONFRAG_IPV4_TCP, ETH_RSS_IPV6 | ETH_RSS_NONFRAG_IPV6_UDP, + ETH_RSS_IPV6 | ETH_RSS_NONFRAG_IPV6_TCP, RTE_ETH_RSS_L3_PRE32 | RTE_ETH_RSS_L3_PRE40 | RTE_ETH_RSS_L3_PRE48 | RTE_ETH_RSS_L3_PRE56 | RTE_ETH_RSS_L3_PRE96 -- 2.17.1
Acked-by: Jeff Guo <jia.guo@intel.com>
> -----Original Message-----
> From: Murphy Yang <murphyx.yang@intel.com>
> Sent: Thursday, January 7, 2021 5:17 PM
> To: dev@dpdk.org
> Cc: Yang, Qiming <qiming.yang@intel.com>; Guo, Jia <jia.guo@intel.com>;
> Zhang, Qi Z <qi.z.zhang@intel.com>; Yang, SteveX <stevex.yang@intel.com>;
> Wu, Jingjing <jingjing.wu@intel.com>; Xing, Beilei <beilei.xing@intel.com>;
> Yang, MurphyX <murphyx.yang@intel.com>
> Subject: [PATCH v8] net/iavf: fix invalid RSS combinations rule can be created
>
> Currently, when use 'flow' command to create a rule with following invalid
> RSS type combination, it can be created successfully.
>
> Invalid RSS combinations list:
> - ETH_RSS_IPV4 | ETH_RSS_NONFRAG_IPV4_TCP
> - ETH_RSS_IPV6 | ETH_RSS_NONFRAG_IPV6_TCP
>
> This patch adds these combinations in 'invalid_rss_comb' array to do valid
> check, if the combination check failed, the rule will be created unsuccessful.
>
> Fixes: 91f27b2e39ab ("net/iavf: refactor RSS")
>
> Signed-off-by: Murphy Yang <murphyx.yang@intel.com>
> ---
> v8:
> - Update the comments.
> v7:
> - Remove unsupported RSS combinations array.
> - Restored 'ETH_RSS_GTPU' in input set mask.
> v6:
> - Add unsupported RSS combinations array.
> v5:
> - Remove 'ETH_RSS_GTPU' from input set mask.
> v4:
> - Use 'ETH_RSS_XXX' replace 'IAVF_RSS_TYPE_INNER_XXX'
> v3:
> - Update the comments.
> v2:
> - Add invalid RSS combinations.
> drivers/net/iavf/iavf_hash.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/net/iavf/iavf_hash.c b/drivers/net/iavf/iavf_hash.c index
> 7620876b58..ebaac58254 100644
> --- a/drivers/net/iavf/iavf_hash.c
> +++ b/drivers/net/iavf/iavf_hash.c
> @@ -863,7 +863,9 @@ static void iavf_refine_proto_hdrs(struct
> virtchnl_proto_hdrs *proto_hdrs,
>
> static uint64_t invalid_rss_comb[] = {
> ETH_RSS_IPV4 | ETH_RSS_NONFRAG_IPV4_UDP,
> + ETH_RSS_IPV4 | ETH_RSS_NONFRAG_IPV4_TCP,
> ETH_RSS_IPV6 | ETH_RSS_NONFRAG_IPV6_UDP,
> + ETH_RSS_IPV6 | ETH_RSS_NONFRAG_IPV6_TCP,
> RTE_ETH_RSS_L3_PRE32 | RTE_ETH_RSS_L3_PRE40 |
> RTE_ETH_RSS_L3_PRE48 | RTE_ETH_RSS_L3_PRE56 |
> RTE_ETH_RSS_L3_PRE96
> --
> 2.17.1
> -----Original Message-----
> From: Guo, Jia <jia.guo@intel.com>
> Sent: Thursday, January 7, 2021 5:33 PM
> To: Yang, MurphyX <murphyx.yang@intel.com>; dev@dpdk.org
> Cc: Yang, Qiming <qiming.yang@intel.com>; Zhang, Qi Z
> <qi.z.zhang@intel.com>; Yang, SteveX <stevex.yang@intel.com>; Wu, Jingjing
> <jingjing.wu@intel.com>; Xing, Beilei <beilei.xing@intel.com>; Yang, MurphyX
> <murphyx.yang@intel.com>
> Subject: RE: [PATCH v8] net/iavf: fix invalid RSS combinations rule can be
> created
>
> Acked-by: Jeff Guo <jia.guo@intel.com>
>
> > -----Original Message-----
> > From: Murphy Yang <murphyx.yang@intel.com>
> > Sent: Thursday, January 7, 2021 5:17 PM
> > To: dev@dpdk.org
> > Cc: Yang, Qiming <qiming.yang@intel.com>; Guo, Jia
> > <jia.guo@intel.com>; Zhang, Qi Z <qi.z.zhang@intel.com>; Yang, SteveX
> > <stevex.yang@intel.com>; Wu, Jingjing <jingjing.wu@intel.com>; Xing,
> > Beilei <beilei.xing@intel.com>; Yang, MurphyX <murphyx.yang@intel.com>
> > Subject: [PATCH v8] net/iavf: fix invalid RSS combinations rule can be
> > created
> >
> > Currently, when use 'flow' command to create a rule with following
> > invalid RSS type combination, it can be created successfully.
> >
> > Invalid RSS combinations list:
> > - ETH_RSS_IPV4 | ETH_RSS_NONFRAG_IPV4_TCP
> > - ETH_RSS_IPV6 | ETH_RSS_NONFRAG_IPV6_TCP
> >
> > This patch adds these combinations in 'invalid_rss_comb' array to do
> > valid check, if the combination check failed, the rule will be created
> unsuccessful.
> >
> > Fixes: 91f27b2e39ab ("net/iavf: refactor RSS")
> >
> > Signed-off-by: Murphy Yang <murphyx.yang@intel.com>
Applied to dpdk-next-net-intel.
Thanks
Qi
Tested-by: Huang, ZhiminX <zhiminx.huang@intel.com>
Regards,
HuangZhiMin
> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Murphy Yang
> Sent: Thursday, January 7, 2021 5:17 PM
> To: dev@dpdk.org
> Cc: Yang, Qiming <qiming.yang@intel.com>; Guo, Jia <jia.guo@intel.com>;
> Zhang, Qi Z <qi.z.zhang@intel.com>; Yang, SteveX <stevex.yang@intel.com>;
> Wu, Jingjing <jingjing.wu@intel.com>; Xing, Beilei <beilei.xing@intel.com>;
> Yang, MurphyX <murphyx.yang@intel.com>
> Subject: [dpdk-dev] [PATCH v8] net/iavf: fix invalid RSS combinations rule can be
> created
>
> Currently, when use 'flow' command to create a rule with following invalid RSS
> type combination, it can be created successfully.
>
> Invalid RSS combinations list:
> - ETH_RSS_IPV4 | ETH_RSS_NONFRAG_IPV4_TCP
> - ETH_RSS_IPV6 | ETH_RSS_NONFRAG_IPV6_TCP
>
> This patch adds these combinations in 'invalid_rss_comb' array to do valid
> check, if the combination check failed, the rule will be created unsuccessful.
>
> Fixes: 91f27b2e39ab ("net/iavf: refactor RSS")
>
> Signed-off-by: Murphy Yang <murphyx.yang@intel.com>
> ---
> v8:
> - Update the comments.
> v7:
> - Remove unsupported RSS combinations array.
> - Restored 'ETH_RSS_GTPU' in input set mask.
> v6:
> - Add unsupported RSS combinations array.
> v5:
> - Remove 'ETH_RSS_GTPU' from input set mask.
> v4:
> - Use 'ETH_RSS_XXX' replace 'IAVF_RSS_TYPE_INNER_XXX'
> v3:
> - Update the comments.
> v2:
> - Add invalid RSS combinations.
> drivers/net/iavf/iavf_hash.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/net/iavf/iavf_hash.c b/drivers/net/iavf/iavf_hash.c index
> 7620876b58..ebaac58254 100644
> --- a/drivers/net/iavf/iavf_hash.c
> +++ b/drivers/net/iavf/iavf_hash.c
> @@ -863,7 +863,9 @@ static void iavf_refine_proto_hdrs(struct
> virtchnl_proto_hdrs *proto_hdrs,
>
> static uint64_t invalid_rss_comb[] = {
> ETH_RSS_IPV4 | ETH_RSS_NONFRAG_IPV4_UDP,
> + ETH_RSS_IPV4 | ETH_RSS_NONFRAG_IPV4_TCP,
> ETH_RSS_IPV6 | ETH_RSS_NONFRAG_IPV6_UDP,
> + ETH_RSS_IPV6 | ETH_RSS_NONFRAG_IPV6_TCP,
> RTE_ETH_RSS_L3_PRE32 | RTE_ETH_RSS_L3_PRE40 |
> RTE_ETH_RSS_L3_PRE48 | RTE_ETH_RSS_L3_PRE56 |
> RTE_ETH_RSS_L3_PRE96
> --
> 2.17.1