[PATCH 1/2] net/hns3: fix error code for repeatedly create counter
Jie Hai
haijie1 at huawei.com
Thu Nov 7 12:56:44 CET 2024
From: Dengdui Huang <huangdengdui at huawei.com>
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 at dpdk.org
Signed-off-by: Dengdui Huang <huangdengdui at huawei.com>
Signed-off-by: Jie Hai <haijie1 at huawei.com>
---
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
More information about the dev
mailing list