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 3E75FA0C4B for ; Thu, 17 Jun 2021 05:13:55 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0960F40150; Thu, 17 Jun 2021 05:13:55 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mails.dpdk.org (Postfix) with ESMTP id C8FE640150 for ; Thu, 17 Jun 2021 05:13:52 +0200 (CEST) IronPort-SDR: sIpkv/vgiAcXc1JHwIkUo+6y7H1Zd35lvyYuuAKc3bhEexR1Iz1VVvclttDwH3YkWGc43yfube F1P8RYDTWELA== X-IronPort-AV: E=McAfee;i="6200,9189,10017"; a="193415916" X-IronPort-AV: E=Sophos;i="5.83,278,1616482800"; d="scan'208";a="193415916" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Jun 2021 20:13:51 -0700 IronPort-SDR: bjNelYKym0CPtonPBNvL64eBg9yNwJB6fB89rGF0hZabbRSdUUlT/hb5xeW1T4Rs1Tt9g/a7ZE D8rW62T1USqA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.83,278,1616482800"; d="scan'208";a="488497087" Received: from wuwenjun.sh.intel.com ([10.67.110.207]) by fmsmga002.fm.intel.com with ESMTP; 16 Jun 2021 20:13:48 -0700 From: Wenjun Wu To: stable@dpdk.org, qiming.yang@intel.com, qi.z.zhang@intel.com Cc: Wenjun Wu Date: Thu, 17 Jun 2021 10:56:23 +0800 Message-Id: <20210617025623.1026715-1-wenjun1.wu@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] [PATCH 20.11] net/ice: fix RSS for L2 packet X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" 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 --- 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