From patchwork Thu Nov 7 11:56:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jie Hai X-Patchwork-Id: 148032 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 7D4DE45CA2; Thu, 7 Nov 2024 13:08:03 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0F15342EFF; Thu, 7 Nov 2024 13:07:54 +0100 (CET) Received: from szxga06-in.huawei.com (szxga06-in.huawei.com [45.249.212.32]) by mails.dpdk.org (Postfix) with ESMTP id BC7ED42EFF for ; Thu, 7 Nov 2024 13:07:50 +0100 (CET) Received: from mail.maildlp.com (unknown [172.19.88.214]) by szxga06-in.huawei.com (SkyGuard) with ESMTP id 4XkgnT1TjDz2gL1X; Thu, 7 Nov 2024 20:07:57 +0800 (CST) Received: from kwepemf500004.china.huawei.com (unknown [7.202.181.242]) by mail.maildlp.com (Postfix) with ESMTPS id D8BC41A016C; Thu, 7 Nov 2024 20:07:46 +0800 (CST) Received: from localhost.localdomain (10.28.79.22) by kwepemf500004.china.huawei.com (7.202.181.242) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Thu, 7 Nov 2024 20:07:46 +0800 From: Jie Hai To: , , , Chunsong Feng , Ferruh Yigit , "Min Hu (Connor)" , Chengwen Feng , Hao Chen CC: , , Subject: [PATCH 1/2] net/hns3: fix error code for repeatedly create counter Date: Thu, 7 Nov 2024 19:56:44 +0800 Message-ID: <20241107115645.22617-2-haijie1@huawei.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20241107115645.22617-1-haijie1@huawei.com> References: <20241107115645.22617-1-haijie1@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.28.79.22] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To kwepemf500004.china.huawei.com (7.202.181.242) 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 From: Dengdui Huang Return EINVAL instead of ENOSPC when the same counter ID is used for multiple times to create a counter. Fixes: fcba820d9b9e ("net/hns3: support flow director") Cc: stable@dpdk.org Signed-off-by: Dengdui Huang Signed-off-by: Jie Hai Acked-by: Stephen Hemminger --- drivers/net/hns3/hns3_flow.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/hns3/hns3_flow.c b/drivers/net/hns3/hns3_flow.c index 192ffc015e14..266934b45bce 100644 --- a/drivers/net/hns3/hns3_flow.c +++ b/drivers/net/hns3/hns3_flow.c @@ -286,7 +286,7 @@ hns3_counter_new(struct rte_eth_dev *dev, uint32_t indirect, uint32_t id, cnt = hns3_counter_lookup(dev, id); if (cnt) { if (!cnt->indirect || cnt->indirect != indirect) - return rte_flow_error_set(error, ENOTSUP, + return rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_ACTION_CONF, cnt, "Counter id is used, indirect flag not match"); From patchwork Thu Nov 7 11:56:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jie Hai X-Patchwork-Id: 148031 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 434D445CA2; Thu, 7 Nov 2024 13:07:55 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4535A42F01; Thu, 7 Nov 2024 13:07:52 +0100 (CET) Received: from szxga04-in.huawei.com (szxga04-in.huawei.com [45.249.212.190]) by mails.dpdk.org (Postfix) with ESMTP id 4DE9642EFD for ; Thu, 7 Nov 2024 13:07:50 +0100 (CET) Received: from mail.maildlp.com (unknown [172.19.163.17]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4Xkglz2Hkkz20p1T; Thu, 7 Nov 2024 20:06:39 +0800 (CST) Received: from kwepemf500004.china.huawei.com (unknown [7.202.181.242]) by mail.maildlp.com (Postfix) with ESMTPS id 634DE1A0188; Thu, 7 Nov 2024 20:07:47 +0800 (CST) Received: from localhost.localdomain (10.28.79.22) by kwepemf500004.china.huawei.com (7.202.181.242) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Thu, 7 Nov 2024 20:07:46 +0800 From: Jie Hai To: , , , Chengwen Feng , "Wei Hu (Xavier)" , Chunsong Feng , Huisong Li , "Min Hu (Connor)" CC: , Subject: [PATCH 2/2] net/hns3: fix cannot fully use hardware flow director table Date: Thu, 7 Nov 2024 19:56:45 +0800 Message-ID: <20241107115645.22617-3-haijie1@huawei.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20241107115645.22617-1-haijie1@huawei.com> References: <20241107115645.22617-1-haijie1@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.28.79.22] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To kwepemf500004.china.huawei.com (7.202.181.242) 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 From: Dengdui Huang The hns3 driver checks whether the flow rule is repeatedly inserted based on rte_hash. Currently, the rte_hash extendable bucket table feature is not enabled. When there are many hash conflicts, the hash table space cannot be fully used. So the flow rule maybe cannot be inserted even if the hardware flow director table there are still free. This patch fix it by enabling the rte_hash extensible bucket table feature. Fixes: fcba820d9b9e ("net/hns3: support flow director") Cc: stable@dpdk.org Signed-off-by: Dengdui Huang Signed-off-by: Jie Hai Acked-by: Stephen Hemminger --- drivers/net/hns3/hns3_fdir.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/hns3/hns3_fdir.c b/drivers/net/hns3/hns3_fdir.c index d18d08353565..aacad40e6174 100644 --- a/drivers/net/hns3/hns3_fdir.c +++ b/drivers/net/hns3/hns3_fdir.c @@ -900,6 +900,7 @@ int hns3_fdir_filter_init(struct hns3_adapter *hns) .key_len = sizeof(struct hns3_fdir_key_conf), .hash_func = rte_hash_crc, .hash_func_init_val = 0, + .extra_flag = RTE_HASH_EXTRA_FLAGS_EXT_TABLE, }; int ret;