Skip to content

Commit f0ea2e9

Browse files
aloktiwamstsirkin
authored andcommitted
vdpa/mlx5: Fix incorrect error code reporting in query_virtqueues
When query_virtqueues() fails, the error log prints the variable err instead of cmd->err. Since err may still be zero at this point, the log message can misleadingly report a success value 0 even though the command actually failed. Even worse, once err is set to the first failure, subsequent logs print that same stale value. This makes the error reporting appear one step behind the actual failing queue index, which is confusing and misleading. Fix the log to report cmd->err, which reflects the real failure code returned by the firmware. Fixes: 1fcdf43 ("vdpa/mlx5: Use async API for vq query command") Signed-off-by: Alok Tiwari <alok.a.tiwari@oracle.com> Acked-by: Jason Wang <jasowang@redhat.com> Reviewed-by: Dragos Tatulea <dtatulea@nvidia.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Message-Id: <20250929134258.80956-1-alok.a.tiwari@oracle.com>
1 parent deb55fc commit f0ea2e9

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/vdpa/mlx5/net/mlx5_vnet.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1256,7 +1256,7 @@ static int query_virtqueues(struct mlx5_vdpa_net *ndev,
12561256
int vq_idx = start_vq + i;
12571257

12581258
if (cmd->err) {
1259-
mlx5_vdpa_err(mvdev, "query vq %d failed, err: %d\n", vq_idx, err);
1259+
mlx5_vdpa_err(mvdev, "query vq %d failed, err: %d\n", vq_idx, cmd->err);
12601260
if (!err)
12611261
err = cmd->err;
12621262
continue;

0 commit comments

Comments
 (0)