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 83F82A0A0F; Sat, 8 May 2021 09:08:36 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id EF1E440140; Sat, 8 May 2021 09:08:35 +0200 (CEST) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by mails.dpdk.org (Postfix) with ESMTP id 48C394013F; Sat, 8 May 2021 09:08:32 +0200 (CEST) IronPort-SDR: rK7rIms1RfmFrCgPOqUuBpqlV6jXhSaZ0GTYk8jraxaoKwXxKNZkGxnR/WmoKNPBDBtBofOg8C VWiNaPcpvhAw== X-IronPort-AV: E=McAfee;i="6200,9189,9977"; a="196870693" X-IronPort-AV: E=Sophos;i="5.82,282,1613462400"; d="scan'208";a="196870693" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 May 2021 00:08:31 -0700 IronPort-SDR: mo8iye6TvFQ0qUY40+9TqXBes58TcAuyO10gpLznCFE9ds8wcyOiLl3PN8mnUYG6WdJbscqffW nUHV4T1jAWMA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.82,282,1613462400"; d="scan'208";a="435265445" Received: from dpdk-xuting-second.sh.intel.com ([10.67.116.154]) by orsmga008.jf.intel.com with ESMTP; 08 May 2021 00:08:29 -0700 From: Ting Xu To: dev@dpdk.org Cc: qiming.yang@intel.com, qi.z.zhang@intel.com, Ting Xu , stable@dpdk.org Date: Sat, 8 May 2021 15:11:47 +0800 Message-Id: <20210508071147.4827-1-ting.xu@intel.com> X-Mailer: git-send-email 2.17.1 Subject: [dpdk-dev] [PATCH v1] net/ice: fix wrong IP RSS configuration template 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" 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. And packet id field for RSS is not correctly added when IP fragment is enabled. 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..3bc16139d1 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,10 +655,13 @@ 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_OTHER); + *hash_flds |= + BIT_ULL(ICE_FLOW_FIELD_IDX_IPV4_ID); + } + 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) *hash_flds &= ~(BIT_ULL(ICE_FLOW_FIELD_IDX_IPV4_SA)); @@ -680,9 +681,9 @@ ice_refine_hash_cfg_l234(struct ice_rss_hash_cfg *hash_cfg, ETH_RSS_NONFRAG_IPV6_TCP | ETH_RSS_NONFRAG_IPV6_SCTP)) { if (rss_type & ETH_RSS_FRAG_IPV6) - *hash_flds &= - ~(BIT_ULL(ICE_FLOW_FIELD_IDX_IPV6_ID)); - else if (rss_type & ETH_RSS_L3_SRC_ONLY) + *hash_flds |= + BIT_ULL(ICE_FLOW_FIELD_IDX_IPV6_ID); + if (rss_type & ETH_RSS_L3_SRC_ONLY) *hash_flds &= ~(BIT_ULL(ICE_FLOW_FIELD_IDX_IPV6_DA)); else if (rss_type & ETH_RSS_L3_DST_ONLY) *hash_flds &= ~(BIT_ULL(ICE_FLOW_FIELD_IDX_IPV6_SA)); -- 2.17.1