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 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 Content-Transfer-Encoding: 8bit Content-Type: text/plain 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 --- 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"); -- 2.22.0