DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH v1] net/ice: fix RSS for L2 packet
@ 2021-06-10  2:30 Wenjun Wu
  2021-06-16  6:34 ` Zhang, Qi Z
  0 siblings, 1 reply; 2+ messages in thread
From: Wenjun Wu @ 2021-06-10  2:30 UTC (permalink / raw)
  To: dev, qiming.yang, qi.z.zhang; +Cc: Wenjun Wu

L2 RSS support was deleted by mistake during code
refactoring. This patch adds it again.

Fixes: 38d632cbdc88 ("net/ice: refactor PF RSS")

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

diff --git a/drivers/net/ice/base/ice_flow.c b/drivers/net/ice/base/ice_flow.c
index d6242744cd..1989abfa7b 100644
--- a/drivers/net/ice/base/ice_flow.c
+++ b/drivers/net/ice/base/ice_flow.c
@@ -3430,7 +3430,7 @@ enum ice_status ice_flow_rem_vsi_prof(struct ice_hw *hw, enum ice_block blk, u16
 }
 
 #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 3bc16139d1..bc809e9d23 100644
--- a/drivers/net/ice/ice_hash.c
+++ b/drivers/net/ice/ice_hash.c
@@ -365,6 +365,13 @@ struct ice_rss_hash_cfg empty_tmplt = {
 	0
 };
 
+struct ice_rss_hash_cfg eth_tmplt = {
+	ICE_FLOW_SEG_HDR_ETH | ICE_FLOW_SEG_HDR_ETH_NON_IP,
+	ICE_FLOW_HASH_ETH,
+	ICE_RSS_OUTER_HEADERS,
+	0
+};
+
 /* IPv4 */
 #define ICE_RSS_TYPE_ETH_IPV4		(ETH_RSS_ETH | ETH_RSS_IPV4 | \
 					 ETH_RSS_FRAG_IPV4)
@@ -467,6 +474,9 @@ struct ice_rss_hash_cfg empty_tmplt = {
 #define ICE_RSS_TYPE_IPV4_PFCP		(ETH_RSS_PFCP | ETH_RSS_IPV4)
 #define ICE_RSS_TYPE_IPV6_PFCP		(ETH_RSS_PFCP | ETH_RSS_IPV6)
 
+/* MAC */
+#define ICE_RSS_TYPE_ETH		ETH_RSS_ETH
+
 /**
  * Supported pattern for hash.
  * The first member is pattern item type,
@@ -536,6 +546,8 @@ static struct ice_pattern_match_item ice_hash_pattern_list[] = {
 	{pattern_eth_ipv6_pfcp,			ICE_RSS_TYPE_IPV6_PFCP,		ICE_INSET_NONE,	&eth_ipv6_pfcp_tmplt},
 	/* PPPOE */
 	{pattern_eth_pppoes,			ICE_RSS_TYPE_PPPOE,		ICE_INSET_NONE,	&pppoe_tmplt},
+	/* MAC */
+	{pattern_ethertype,			ICE_RSS_TYPE_ETH,		ICE_INSET_NONE, &eth_tmplt},
 	/* EMPTY */
 	{pattern_empty,				ICE_INSET_NONE,			ICE_INSET_NONE,	&empty_tmplt},
 };
@@ -637,6 +649,11 @@ ice_refine_hash_cfg_l234(struct ice_rss_hash_cfg *hash_cfg,
 		*addl_hdrs &= ~ICE_FLOW_SEG_HDR_ETH;
 	}
 
+	if (*addl_hdrs & ICE_FLOW_SEG_HDR_ETH_NON_IP) {
+		if (rss_type & ETH_RSS_ETH)
+			*hash_flds |= BIT_ULL(ICE_FLOW_FIELD_IDX_ETH_TYPE);
+	}
+
 	if (*addl_hdrs & ICE_FLOW_SEG_HDR_VLAN) {
 		if (rss_type & ETH_RSS_C_VLAN)
 			*hash_flds |= BIT_ULL(ICE_FLOW_FIELD_IDX_C_VLAN);
-- 
2.25.1


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

* Re: [dpdk-dev] [PATCH v1] net/ice: fix RSS for L2 packet
  2021-06-10  2:30 [dpdk-dev] [PATCH v1] net/ice: fix RSS for L2 packet Wenjun Wu
@ 2021-06-16  6:34 ` Zhang, Qi Z
  0 siblings, 0 replies; 2+ messages in thread
From: Zhang, Qi Z @ 2021-06-16  6:34 UTC (permalink / raw)
  To: Wu, Wenjun1, dev, Yang, Qiming



> -----Original Message-----
> From: Wu, Wenjun1 <wenjun1.wu@intel.com>
> Sent: Thursday, June 10, 2021 10:30 AM
> To: dev@dpdk.org; Yang, Qiming <qiming.yang@intel.com>; Zhang, Qi Z
> <qi.z.zhang@intel.com>
> Cc: Wu, Wenjun1 <wenjun1.wu@intel.com>
> Subject: [PATCH v1] net/ice: fix RSS for L2 packet
> 
> L2 RSS support was deleted by mistake during code refactoring. This patch adds
> it again.
> 
> Fixes: 38d632cbdc88 ("net/ice: refactor PF RSS")
> 
> Signed-off-by: Wenjun Wu <wenjun1.wu@intel.com>

Acked-by: Qi Zhang <qi.z.zhang@intel.com>

Applied to dpdk-next-net-intel.

Thanks
Qi

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

end of thread, other threads:[~2021-06-16  6:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-10  2:30 [dpdk-dev] [PATCH v1] net/ice: fix RSS for L2 packet Wenjun Wu
2021-06-16  6:34 ` Zhang, Qi Z

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