[1/2] net/hns3: fix error code for repeatedly create counter
Checks
Commit Message
From: Dengdui Huang <huangdengdui@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@dpdk.org
Signed-off-by: Dengdui Huang <huangdengdui@huawei.com>
Signed-off-by: Jie Hai <haijie1@huawei.com>
---
drivers/net/hns3/hns3_flow.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On Thu, 7 Nov 2024 19:56:44 +0800
Jie Hai <haijie1@huawei.com> wrote:
> From: Dengdui Huang <huangdengdui@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@dpdk.org
>
> Signed-off-by: Dengdui Huang <huangdengdui@huawei.com>
> Signed-off-by: Jie Hai <haijie1@huawei.com>
Not sure that actual error number matters that much, but
looks good to me.
Another alternative might be EEXIST which is the error code
used when creat() is called on an existing file.
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
@@ -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");