]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
mlx4: correct error reporting in mlx4_master_process_vhcr()
authorAlok Tiwari <alok.a.tiwari@oracle.com>
Thu, 9 Apr 2026 09:27:47 +0000 (02:27 -0700)
committerJakub Kicinski <kuba@kernel.org>
Mon, 13 Apr 2026 20:52:04 +0000 (13:52 -0700)
mlx4_master_process_vhcr() logs vhcr->errno on failures, but this field
is never populated by the PF path. As a result, all failures are reported
with errno 0 and err print in status case which is misleading.

Use the actual return value (err) instead, translate it to FW status
before logging, and report both values.

Signed-off-by: Alok Tiwari <alok.a.tiwari@oracle.com>
Reviewed-by: Tariq Toukan <tariqt@nvidia.com>
Link: https://patch.msgid.link/20260409092754.508880-1-alok.a.tiwari@oracle.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/mellanox/mlx4/cmd.c

index de0193d82ec180b04ef8a53166e734eb361ece13..bdaf152e67121e0fa880ea518d1ee2497f9d00f6 100644 (file)
@@ -1782,6 +1782,7 @@ static int mlx4_master_process_vhcr(struct mlx4_dev *dev, int slave,
        }
 
        if (err) {
+               vhcr_cmd->status = mlx4_errno_to_status(err);
                if (!(dev->persist->state & MLX4_DEVICE_STATE_INTERNAL_ERROR)) {
                        if (vhcr->op == MLX4_CMD_ALLOC_RES &&
                            (vhcr->in_modifier & 0xff) == RES_COUNTER &&
@@ -1791,9 +1792,8 @@ static int mlx4_master_process_vhcr(struct mlx4_dev *dev, int slave,
                                         slave, err);
                        else
                                mlx4_warn(dev, "vhcr command:0x%x slave:%d failed with error:%d, status %d\n",
-                                         vhcr->op, slave, vhcr->errno, err);
+                                         vhcr->op, slave, err, vhcr_cmd->status);
                }
-               vhcr_cmd->status = mlx4_errno_to_status(err);
                goto out_status;
        }