diff mbox series

[v4] net/iavf: fix invalid RSS combinations rule can be created

Message ID 20201223080346.79009-1-murphyx.yang@intel.com (mailing list archive)
State Superseded, archived
Delegated to: Qi Zhang
Headers show
Series [v4] net/iavf: fix invalid RSS combinations rule can be created | expand

Checks

Context Check Description
ci/iol-testing success Testing PASS
ci/iol-abi-testing success Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/Intel-compilation success Compilation OK
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/checkpatch success coding style OK

Commit Message

Murphy Yang Dec. 23, 2020, 8:03 a.m. UTC
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(+)

Comments

Guo, Jia Dec. 23, 2020, 8:14 a.m. UTC | #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
diff mbox series

Patch

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