]> git.baikalelectronics.ru Git - kernel.git/commit
net/mlx5: Add meaningful return codes to status_to_err function
authorValentine Fatiev <valentinef@mellanox.com>
Wed, 1 May 2019 08:46:05 +0000 (11:46 +0300)
committerSaeed Mahameed <saeedm@mellanox.com>
Fri, 17 May 2019 20:16:47 +0000 (13:16 -0700)
commitb11e84a995027dfbe3d1c8f3d4573c8e1a42992c
tree3b8dde331b35bec5cb1bdb43f8165def329ea0cb
parent82b3add87007f45b52a0a8d028e8fb259f9f927e
net/mlx5: Add meaningful return codes to status_to_err function

Current version of function status_to_err return -1 for any
status returned by mlx5_cmd_invoke function. In case status is
MLX5_DRIVER_STATUS_ABORTED we should return 0 to the caller as we
assume command completed successfully on FW. If error returned we are
getting confusing messages in dmesg. In addition, currently returned
value -1 is confusing with -EPERM.

New implementation actually fix original commit and return meaningful
codes for commands delivery status and print message in case of failure.

Fixes: 7c120481afcc ("mlx5: Add driver for Mellanox Connect-IB adapters")
Signed-off-by: Valentine Fatiev <valentinef@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
drivers/net/ethernet/mellanox/mlx5/core/cmd.c