net/mlx5/hws: fix return value of send queue action
Checks
Commit Message
The rte_errno should be set to a positive error value
while the ret of the function should return a negative
value this aligns code to other mlx5dr API functions.
Fixes: 3eb748869d2d ("net/mlx5/hws: add send layer")
Cc: stable@dpdk.org
Signed-off-by: Alex Vesker <valex@nvidia.com>
Reviewed-by: Erez Shitrit <erezsh@nvidia.com>
Acked-by: Matan Azrad matan@nvidia.com
---
drivers/net/mlx5/hws/mlx5dr_send.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
Comments
Hi,
> -----Original Message-----
> From: Alex Vesker <valex@nvidia.com>
> Sent: Thursday, March 23, 2023 2:34 PM
> To: Alex Vesker <valex@nvidia.com>; Slava Ovsiienko
> <viacheslavo@nvidia.com>; NBU-Contact-Thomas Monjalon (EXTERNAL)
> <thomas@monjalon.net>; Suanming Mou <suanmingm@nvidia.com>; Matan
> Azrad <matan@nvidia.com>
> Cc: dev@dpdk.org; Ori Kam <orika@nvidia.com>; stable@dpdk.org
> Subject: [PATCH] net/mlx5/hws: fix return value of send queue action
>
> The rte_errno should be set to a positive error value while the ret of the
> function should return a negative value this aligns code to other mlx5dr API
> functions.
>
> Fixes: 3eb748869d2d ("net/mlx5/hws: add send layer")
> Cc: stable@dpdk.org
> Signed-off-by: Alex Vesker <valex@nvidia.com>
> Reviewed-by: Erez Shitrit <erezsh@nvidia.com>
> Acked-by: Matan Azrad matan@nvidia.com
Fixed Acked-by tag,
Patch applied to next-net-mlx,
Kindest regards,
Raslan Darawsheh
@@ -1007,8 +1007,8 @@ int mlx5dr_send_queue_action(struct mlx5dr_context *ctx,
break;
default:
- rte_errno = -EINVAL;
- return rte_errno;
+ rte_errno = EINVAL;
+ return -rte_errno;
}
return 0;