From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id E36E4A0C4D; Thu, 10 Jun 2021 04:47:46 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 65A5D4067C; Thu, 10 Jun 2021 04:47:46 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mails.dpdk.org (Postfix) with ESMTP id 14FAA4003C for ; Thu, 10 Jun 2021 04:47:44 +0200 (CEST) IronPort-SDR: wR1bj8aMfigEWoC/yXEdOANnFYr0uhCOrn141NULjgP7QVZMlf/cuYCuRRkSLWs7DX3iCHsHW1 xV9GM4c4s6bQ== X-IronPort-AV: E=McAfee;i="6200,9189,10010"; a="185589972" X-IronPort-AV: E=Sophos;i="5.83,262,1616482800"; d="scan'208";a="185589972" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Jun 2021 19:47:43 -0700 IronPort-SDR: hLK/szOPe+b2yMGxNzSa3mEDVd5R0XlQLVOn+34Eq/l0SDkbSqcqdieNXTpZdpK3iO2JzrHyYj VxKdl99GS41w== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.83,262,1616482800"; d="scan'208";a="482632048" Received: from wuwenjun.sh.intel.com ([10.67.110.207]) by orsmga001.jf.intel.com with ESMTP; 09 Jun 2021 19:47:42 -0700 From: Wenjun Wu To: dev@dpdk.org, qiming.yang@intel.com, qi.z.zhang@intel.com Cc: Wenjun Wu Date: Thu, 10 Jun 2021 10:30:19 +0800 Message-Id: <20210610023019.760879-1-wenjun1.wu@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v1] net/ice: fix RSS for L2 packet X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 --- 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, ð_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, ð_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