Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mlx4: correct error reporting in mlx4_master_process_vhcr()

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>

authored by

Alok Tiwari and committed by
Jakub Kicinski
bc174d05 b0254613

+2 -2
+2 -2
drivers/net/ethernet/mellanox/mlx4/cmd.c
··· 1782 1782 } 1783 1783 1784 1784 if (err) { 1785 + vhcr_cmd->status = mlx4_errno_to_status(err); 1785 1786 if (!(dev->persist->state & MLX4_DEVICE_STATE_INTERNAL_ERROR)) { 1786 1787 if (vhcr->op == MLX4_CMD_ALLOC_RES && 1787 1788 (vhcr->in_modifier & 0xff) == RES_COUNTER && ··· 1792 1791 slave, err); 1793 1792 else 1794 1793 mlx4_warn(dev, "vhcr command:0x%x slave:%d failed with error:%d, status %d\n", 1795 - vhcr->op, slave, vhcr->errno, err); 1794 + vhcr->op, slave, err, vhcr_cmd->status); 1796 1795 } 1797 - vhcr_cmd->status = mlx4_errno_to_status(err); 1798 1796 goto out_status; 1799 1797 } 1800 1798