[PATCH] net/mlx5/hws: fix return value of send queue action

Alex Vesker valex at nvidia.com
Thu Mar 23 13:34:14 CET 2023


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 at dpdk.org
Signed-off-by: Alex Vesker <valex at nvidia.com>
Reviewed-by: Erez Shitrit <erezsh at nvidia.com>
Acked-by: Matan Azrad matan at nvidia.com
---
 drivers/net/mlx5/hws/mlx5dr_send.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/mlx5/hws/mlx5dr_send.c b/drivers/net/mlx5/hws/mlx5dr_send.c
index 51aaf5c8e2..d650c55124 100644
--- a/drivers/net/mlx5/hws/mlx5dr_send.c
+++ b/drivers/net/mlx5/hws/mlx5dr_send.c
@@ -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;
-- 
2.18.1



More information about the stable mailing list