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 12A6EA0524 for ; Fri, 7 May 2021 11:49:25 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 053ED410FB; Fri, 7 May 2021 11:49:25 +0200 (CEST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mails.dpdk.org (Postfix) with ESMTP id 5EB0240040; Fri, 7 May 2021 11:49:20 +0200 (CEST) IronPort-SDR: 6K1d2Pr2uVmkF1BTjI4tX18FM0AvCTFoGmvZ3JOQnmOi13lNpnRDgHt9Gu/w3mpCRAruViz7fF wHATvx/GcOLA== X-IronPort-AV: E=McAfee;i="6200,9189,9976"; a="198745158" X-IronPort-AV: E=Sophos;i="5.82,280,1613462400"; d="scan'208";a="198745158" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 May 2021 02:49:19 -0700 IronPort-SDR: 86NoTa8wrUU6RfeuMyurHAu8eSYOQyr/cA8wPafuDxg+/MJskLkICSpNHzj8SV/yKCxBQwCGc5 6Lw+l44CN9qw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.82,280,1613462400"; d="scan'208";a="540288330" Received: from dpdk-xuting-second.sh.intel.com ([10.67.116.154]) by orsmga004.jf.intel.com with ESMTP; 07 May 2021 02:49:18 -0700 From: Ting Xu To: dev@dpdk.org Cc: qiming.yang@intel.com, qi.z.zhang@intel.com, Ting Xu , stable@dpdk.org Date: Fri, 7 May 2021 17:52:27 +0800 Message-Id: <20210507095227.17411-1-ting.xu@intel.com> X-Mailer: git-send-email 2.17.1 Subject: [dpdk-stable] [PATCH v1] net/ice: fix wrong IP RSS configuration template 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" To enable IP fragment RSS hash, ICE_FLOW_SEG_HDR_IPV_FRAG is added to the IP RSS configuration template, together with ICE_FLOW_SEG_HDR_IPV_OTHER. It will cause error when associating flow profile. To fix this issue, this patch only selects one of the above two segment header types based on rss types. Fixes: 672f321d09ed ("net/ice: support RSS hash for IP fragment") Cc: stable@dpdk.org Signed-off-by: Ting Xu --- drivers/net/ice/ice_hash.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/drivers/net/ice/ice_hash.c b/drivers/net/ice/ice_hash.c index 2bf8983f5a..9e52f1c4a7 100644 --- a/drivers/net/ice/ice_hash.c +++ b/drivers/net/ice/ice_hash.c @@ -111,7 +111,6 @@ ice_hash_parse_pattern_action(struct ice_adapter *ad, /* Rss configuration template */ struct ice_rss_hash_cfg ipv4_tmplt = { ICE_FLOW_SEG_HDR_ETH | ICE_FLOW_SEG_HDR_IPV4 | - ICE_FLOW_SEG_HDR_IPV_FRAG | ICE_FLOW_SEG_HDR_IPV_OTHER, ICE_FLOW_HASH_ETH | ICE_FLOW_HASH_IPV4, ICE_RSS_OUTER_HEADERS, @@ -152,8 +151,7 @@ struct ice_rss_hash_cfg ipv6_tmplt = { struct ice_rss_hash_cfg ipv6_frag_tmplt = { ICE_FLOW_SEG_HDR_ETH | ICE_FLOW_SEG_HDR_IPV6 | - ICE_FLOW_SEG_HDR_IPV_FRAG | - ICE_FLOW_SEG_HDR_IPV_OTHER, + ICE_FLOW_SEG_HDR_IPV_FRAG, ICE_FLOW_HASH_ETH | ICE_FLOW_HASH_IPV6, ICE_RSS_ANY_HEADERS, 0 @@ -657,17 +655,20 @@ ice_refine_hash_cfg_l234(struct ice_rss_hash_cfg *hash_cfg, ETH_RSS_NONFRAG_IPV4_UDP | ETH_RSS_NONFRAG_IPV4_TCP | ETH_RSS_NONFRAG_IPV4_SCTP)) { - if (rss_type & ETH_RSS_FRAG_IPV4) - *hash_flds &= - ~(BIT_ULL(ICE_FLOW_FIELD_IDX_IPV4_ID)); - else if (rss_type & ETH_RSS_L3_SRC_ONLY) + if (rss_type & ETH_RSS_FRAG_IPV4) { + *addl_hdrs |= ICE_FLOW_SEG_HDR_IPV_FRAG; + *addl_hdrs &= ~(ICE_FLOW_SEG_HDR_IPV_FRAG); + *hash_flds |= + BIT_ULL(ICE_FLOW_FIELD_IDX_IPV4_ID); + } else if (rss_type & ETH_RSS_L3_SRC_ONLY) { *hash_flds &= ~(BIT_ULL(ICE_FLOW_FIELD_IDX_IPV4_DA)); - else if (rss_type & ETH_RSS_L3_DST_ONLY) + } else if (rss_type & ETH_RSS_L3_DST_ONLY) { *hash_flds &= ~(BIT_ULL(ICE_FLOW_FIELD_IDX_IPV4_SA)); - else if (rss_type & + } else if (rss_type & (ETH_RSS_L4_SRC_ONLY | - ETH_RSS_L4_DST_ONLY)) + ETH_RSS_L4_DST_ONLY)) { *hash_flds &= ~ICE_FLOW_HASH_IPV4; + } } else { *hash_flds &= ~ICE_FLOW_HASH_IPV4; } -- 2.17.1