patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [PATCH 20.11] net/ice: fix RSS for L2 packet
@ 2021-06-17  2:56 Wenjun Wu
  2021-06-20 14:15 ` Xueming(Steven) Li
  0 siblings, 1 reply; 2+ messages in thread
From: Wenjun Wu @ 2021-06-17  2:56 UTC (permalink / raw)
  To: stable, qiming.yang, qi.z.zhang; +Cc: Wenjun Wu

RSS support for L2 non-ip packets is missing in previous versions.

However, due to code refactor, the fix [1] in main branch cannot
be applied directly. This patch fixes this issue in stable versions.

[1] https://patchwork.dpdk.org/patch/94066/

Fixes: 5ad3db8d4bdd ("net/ice: enable advanced RSS")

Signed-off-by: Wenjun Wu <wenjun1.wu@intel.com>
---
 drivers/net/ice/base/ice_flow.c |  2 +-
 drivers/net/ice/ice_hash.c      | 14 ++++++++++++++
 2 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ice/base/ice_flow.c b/drivers/net/ice/base/ice_flow.c
index 548d998546..c75f58659c 100644
--- a/drivers/net/ice/base/ice_flow.c
+++ b/drivers/net/ice/base/ice_flow.c
@@ -3233,7 +3233,7 @@ ice_flow_add_fld_raw(struct ice_flow_seg_info *seg, u16 off, u8 len,
 }
 
 #define ICE_FLOW_RSS_SEG_HDR_L2_MASKS \
-(ICE_FLOW_SEG_HDR_ETH | ICE_FLOW_SEG_HDR_VLAN)
+(ICE_FLOW_SEG_HDR_ETH | ICE_FLOW_SEG_HDR_ETH_NON_IP | ICE_FLOW_SEG_HDR_VLAN)
 
 #define ICE_FLOW_RSS_SEG_HDR_L3_MASKS \
 	(ICE_FLOW_SEG_HDR_IPV4 | ICE_FLOW_SEG_HDR_IPV6)
diff --git a/drivers/net/ice/ice_hash.c b/drivers/net/ice/ice_hash.c
index fe3e06c579..1bb7d2c7c6 100644
--- a/drivers/net/ice/ice_hash.c
+++ b/drivers/net/ice/ice_hash.c
@@ -312,6 +312,9 @@ struct rss_type_match_hdr hint_eth_pppoes_ipv6_tcp = {
 struct rss_type_match_hdr hint_eth_pppoes = {
 	ICE_FLOW_SEG_HDR_PPPOE,
 	ETH_RSS_ETH | ETH_RSS_PPPOE};
+struct rss_type_match_hdr hint_ethertype = {
+	ICE_FLOW_SEG_HDR_ETH | ICE_FLOW_SEG_HDR_ETH_NON_IP,
+	ETH_RSS_ETH};
 
 /* Supported pattern for os default package. */
 static struct ice_pattern_match_item ice_hash_pattern_list_os[] = {
@@ -444,6 +447,8 @@ static struct ice_pattern_match_item ice_hash_pattern_list_comms[] = {
 		&hint_eth_pppoes_ipv6_tcp},
 	{pattern_eth_pppoes,		    ICE_INSET_NONE,
 		&hint_eth_pppoes},
+	{pattern_ethertype,		    ICE_INSET_NONE,
+		&hint_ethertype},
 };
 
 /**
@@ -1140,6 +1145,15 @@ ice_hash_parse_action(struct ice_pattern_match_item *pattern_match_item,
 					"Not supported flow");
 			}
 
+			/* update hash field for eth-non-ip. */
+			if (rss_type & ETH_RSS_ETH) {
+				if (hash_meta->pkt_hdr &
+				    ICE_FLOW_SEG_HDR_ETH_NON_IP) {
+					hash_meta->hash_flds |=
+					BIT_ULL(ICE_FLOW_FIELD_IDX_ETH_TYPE);
+				}
+			}
+
 			/* update hash field for nat-t esp. */
 			if (rss_type & ETH_RSS_ESP &&
 			    (m->eth_rss_hint & ETH_RSS_NONFRAG_IPV4_UDP ||
-- 
2.25.1


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

* Re: [dpdk-stable] [PATCH 20.11] net/ice: fix RSS for L2 packet
  2021-06-17  2:56 [dpdk-stable] [PATCH 20.11] net/ice: fix RSS for L2 packet Wenjun Wu
@ 2021-06-20 14:15 ` Xueming(Steven) Li
  0 siblings, 0 replies; 2+ messages in thread
From: Xueming(Steven) Li @ 2021-06-20 14:15 UTC (permalink / raw)
  To: Wenjun Wu, stable, qiming.yang, qi.z.zhang

Applied, thanks for the backport


> -----Original Message-----
> From: stable <stable-bounces@dpdk.org> On Behalf Of Wenjun Wu
> Sent: Thursday, June 17, 2021 10:56 AM
> To: stable@dpdk.org; qiming.yang@intel.com; qi.z.zhang@intel.com
> Cc: Wenjun Wu <wenjun1.wu@intel.com>
> Subject: [dpdk-stable] [PATCH 20.11] net/ice: fix RSS for L2 packet
> 
> RSS support for L2 non-ip packets is missing in previous versions.
> 
> However, due to code refactor, the fix [1] in main branch cannot be applied directly. This patch fixes this issue in stable versions.
> 
> [1] https://patchwork.dpdk.org/patch/94066/
> 
> Fixes: 5ad3db8d4bdd ("net/ice: enable advanced RSS")
> 
> Signed-off-by: Wenjun Wu <wenjun1.wu@intel.com>
> ---
>  drivers/net/ice/base/ice_flow.c |  2 +-
>  drivers/net/ice/ice_hash.c      | 14 ++++++++++++++
>  2 files changed, 15 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ice/base/ice_flow.c b/drivers/net/ice/base/ice_flow.c index 548d998546..c75f58659c 100644
> --- a/drivers/net/ice/base/ice_flow.c
> +++ b/drivers/net/ice/base/ice_flow.c
> @@ -3233,7 +3233,7 @@ ice_flow_add_fld_raw(struct ice_flow_seg_info *seg, u16 off, u8 len,  }
> 
>  #define ICE_FLOW_RSS_SEG_HDR_L2_MASKS \ -(ICE_FLOW_SEG_HDR_ETH | ICE_FLOW_SEG_HDR_VLAN)
> +(ICE_FLOW_SEG_HDR_ETH | ICE_FLOW_SEG_HDR_ETH_NON_IP |
> +ICE_FLOW_SEG_HDR_VLAN)
> 
>  #define ICE_FLOW_RSS_SEG_HDR_L3_MASKS \
>  	(ICE_FLOW_SEG_HDR_IPV4 | ICE_FLOW_SEG_HDR_IPV6) diff --git a/drivers/net/ice/ice_hash.c b/drivers/net/ice/ice_hash.c
> index fe3e06c579..1bb7d2c7c6 100644
> --- a/drivers/net/ice/ice_hash.c
> +++ b/drivers/net/ice/ice_hash.c
> @@ -312,6 +312,9 @@ struct rss_type_match_hdr hint_eth_pppoes_ipv6_tcp = {  struct rss_type_match_hdr hint_eth_pppoes = {
>  	ICE_FLOW_SEG_HDR_PPPOE,
>  	ETH_RSS_ETH | ETH_RSS_PPPOE};
> +struct rss_type_match_hdr hint_ethertype = {
> +	ICE_FLOW_SEG_HDR_ETH | ICE_FLOW_SEG_HDR_ETH_NON_IP,
> +	ETH_RSS_ETH};
> 
>  /* Supported pattern for os default package. */  static struct ice_pattern_match_item ice_hash_pattern_list_os[] = { @@ -444,6
> +447,8 @@ static struct ice_pattern_match_item ice_hash_pattern_list_comms[] = {
>  		&hint_eth_pppoes_ipv6_tcp},
>  	{pattern_eth_pppoes,		    ICE_INSET_NONE,
>  		&hint_eth_pppoes},
> +	{pattern_ethertype,		    ICE_INSET_NONE,
> +		&hint_ethertype},
>  };
> 
>  /**
> @@ -1140,6 +1145,15 @@ ice_hash_parse_action(struct ice_pattern_match_item *pattern_match_item,
>  					"Not supported flow");
>  			}
> 
> +			/* update hash field for eth-non-ip. */
> +			if (rss_type & ETH_RSS_ETH) {
> +				if (hash_meta->pkt_hdr &
> +				    ICE_FLOW_SEG_HDR_ETH_NON_IP) {
> +					hash_meta->hash_flds |=
> +					BIT_ULL(ICE_FLOW_FIELD_IDX_ETH_TYPE);
> +				}
> +			}
> +
>  			/* update hash field for nat-t esp. */
>  			if (rss_type & ETH_RSS_ESP &&
>  			    (m->eth_rss_hint & ETH_RSS_NONFRAG_IPV4_UDP ||
> --
> 2.25.1


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

end of thread, other threads:[~2021-06-20 14:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-17  2:56 [dpdk-stable] [PATCH 20.11] net/ice: fix RSS for L2 packet Wenjun Wu
2021-06-20 14:15 ` Xueming(Steven) Li

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).