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

Message ID 20230323123416.26636-1-valex@nvidia.com (mailing list archive)
State Accepted, archived
Delegated to: Raslan Darawsheh
Headers
Series net/mlx5/hws: fix return value of send queue action |

Checks

Context Check Description
ci/checkpatch warning coding style issues
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/Intel-compilation success Compilation OK
ci/github-robot: build success github build: passed
ci/intel-Testing success Testing PASS
ci/intel-Functional success Functional PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-abi-testing success Testing PASS
ci/iol-aarch64-unit-testing success Testing PASS
ci/iol-unit-testing success Testing PASS

Commit Message

Alex Vesker March 23, 2023, 12:34 p.m. UTC
  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

Raslan Darawsheh March 23, 2023, 7:41 p.m. UTC | #1
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
  

Patch

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;