From patchwork Wed Apr 3 10:16:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jie Hai X-Patchwork-Id: 139078 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 1BA0643DE7; Wed, 3 Apr 2024 12:22:16 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 18D47406A2; Wed, 3 Apr 2024 12:21:52 +0200 (CEST) Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by mails.dpdk.org (Postfix) with ESMTP id 60770402DD for ; Wed, 3 Apr 2024 12:21:46 +0200 (CEST) Received: from mail.maildlp.com (unknown [172.19.163.48]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4V8ghK36gqzwR8K for ; Wed, 3 Apr 2024 18:18:57 +0800 (CST) Received: from kwepemd100004.china.huawei.com (unknown [7.221.188.31]) by mail.maildlp.com (Postfix) with ESMTPS id 483F418005D for ; Wed, 3 Apr 2024 18:21:45 +0800 (CST) Received: from localhost.localdomain (10.67.165.2) by kwepemd100004.china.huawei.com (7.221.188.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1258.28; Wed, 3 Apr 2024 18:21:44 +0800 From: Jie Hai To: , Yisen Zhuang CC: , , , , Subject: [PATCH 5/5] net/hns3: disable SCTP verification Tag for RSS hash input Date: Wed, 3 Apr 2024 18:16:23 +0800 Message-ID: <20240403101624.2771140-6-haijie1@huawei.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20240403101624.2771140-1-haijie1@huawei.com> References: <20240403101624.2771140-1-haijie1@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.67.165.2] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To kwepemd100004.china.huawei.com (7.221.188.31) 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 When the symmetric RSS algorithm is used, the same packet is expected to be hashed to the same queue in the upstream and downstream directions. The problem is that it could map the packets in the same SCTP connection to different NIC RX queues depending on the direction of packets. This is because the verification Tag is used as the RSS hash input for the SCTP packets, and the value depends on the peer end of the SCTP connection and could not be symmetrically used in the hardware-implemented RSS algorithm. In addition, the ethdev framework doesn't support setting SCTP V-tag as the RSS hash input. So disable it for all RSS hash algorithms. Cc: stable@dpdk.org Signed-off-by: Jie Hai --- drivers/net/hns3/hns3_rss.c | 6 ++---- drivers/net/hns3/hns3_rss.h | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/net/hns3/hns3_rss.c b/drivers/net/hns3/hns3_rss.c index 15feb26043af..3eae4caf52a2 100644 --- a/drivers/net/hns3/hns3_rss.c +++ b/drivers/net/hns3/hns3_rss.c @@ -153,8 +153,7 @@ static const struct { BIT_ULL(HNS3_RSS_FIELD_IPV4_SCTP_EN_IP_S) | BIT_ULL(HNS3_RSS_FIELD_IPV4_SCTP_EN_IP_D) | BIT_ULL(HNS3_RSS_FIELD_IPV4_SCTP_EN_SCTP_S) | - BIT_ULL(HNS3_RSS_FIELD_IPV4_SCTP_EN_SCTP_D) | - BIT_ULL(HNS3_RSS_FIELD_IPV4_SCTP_EN_SCTP_VER), + BIT_ULL(HNS3_RSS_FIELD_IPV4_SCTP_EN_SCTP_D), HNS3_RSS_TUPLE_IPV4_SCTP_M }, /* IPV6-FRAG */ @@ -274,8 +273,7 @@ static const struct { BIT_ULL(HNS3_RSS_FIELD_IPV6_SCTP_EN_IP_S) | BIT_ULL(HNS3_RSS_FIELD_IPV6_SCTP_EN_IP_D) | BIT_ULL(HNS3_RSS_FIELD_IPV6_SCTP_EN_SCTP_D) | - BIT_ULL(HNS3_RSS_FIELD_IPV6_SCTP_EN_SCTP_S) | - BIT_ULL(HNS3_RSS_FIELD_IPV6_SCTP_EN_SCTP_VER), + BIT_ULL(HNS3_RSS_FIELD_IPV6_SCTP_EN_SCTP_S), HNS3_RSS_TUPLE_IPV6_SCTP_M }, }; diff --git a/drivers/net/hns3/hns3_rss.h b/drivers/net/hns3/hns3_rss.h index 9d182a8025c5..0755760b4513 100644 --- a/drivers/net/hns3/hns3_rss.h +++ b/drivers/net/hns3/hns3_rss.h @@ -49,7 +49,6 @@ enum hns3_tuple_field { HNS3_RSS_FIELD_IPV4_SCTP_EN_SCTP_S, HNS3_RSS_FIELD_IPV4_SCTP_EN_IP_D, HNS3_RSS_FIELD_IPV4_SCTP_EN_IP_S, - HNS3_RSS_FIELD_IPV4_SCTP_EN_SCTP_VER, /* IPV4 ENABLE FIELD */ HNS3_RSS_FIELD_IPV4_EN_NONFRAG_IP_D = 24, @@ -74,7 +73,6 @@ enum hns3_tuple_field { HNS3_RSS_FIELD_IPV6_SCTP_EN_SCTP_S, HNS3_RSS_FIELD_IPV6_SCTP_EN_IP_D, HNS3_RSS_FIELD_IPV6_SCTP_EN_IP_S, - HNS3_RSS_FIELD_IPV6_SCTP_EN_SCTP_VER, /* IPV6 ENABLE FIELD */ HNS3_RSS_FIELD_IPV6_NONFRAG_IP_D = 56, @@ -96,12 +94,12 @@ enum hns3_tuple_field { #define HNS3_RSS_TUPLE_IPV4_TCP_M GENMASK(3, 0) #define HNS3_RSS_TUPLE_IPV4_UDP_M GENMASK(11, 8) -#define HNS3_RSS_TUPLE_IPV4_SCTP_M GENMASK(20, 16) +#define HNS3_RSS_TUPLE_IPV4_SCTP_M GENMASK(19, 16) #define HNS3_RSS_TUPLE_IPV4_NONF_M GENMASK(25, 24) #define HNS3_RSS_TUPLE_IPV4_FLAG_M GENMASK(27, 26) #define HNS3_RSS_TUPLE_IPV6_TCP_M GENMASK(35, 32) #define HNS3_RSS_TUPLE_IPV6_UDP_M GENMASK(43, 40) -#define HNS3_RSS_TUPLE_IPV6_SCTP_M GENMASK(52, 48) +#define HNS3_RSS_TUPLE_IPV6_SCTP_M GENMASK(51, 48) #define HNS3_RSS_TUPLE_IPV6_NONF_M GENMASK(57, 56) #define HNS3_RSS_TUPLE_IPV6_FLAG_M GENMASK(59, 58)