[v2] net/iavf: fix negative GTP-U flow rules create successfully

Message ID 20201218061843.72422-1-murphyx.yang@intel.com (mailing list archive)
State Superseded, archived
Delegated to: Qi Zhang
Headers
Series [v2] net/iavf: fix negative GTP-U flow rules create successfully |

Checks

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

Commit Message

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

Comments

Guo, Jia Dec. 23, 2020, 2:32 a.m. UTC | #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
  

Patch

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