[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CACGkMEvyh9CBHjQs6bYv8v-DVYGizjOrVMuFVsnnrJeN6kTrfQ@mail.gmail.com>
Date: Thu, 9 Oct 2025 13:45:36 +0800
From: Jason Wang <jasowang@...hat.com>
To: Alok Tiwari <alok.a.tiwari@...cle.com>
Cc: dtatulea@...dia.com, mst@...hat.com, xuanzhuo@...ux.alibaba.com,
eperezma@...hat.com, tariqt@...dia.com, moshe@...dia.com, kshk@...ux.ibm.com,
virtualization@...ts.linux.dev, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] vdpa/mlx5: Fix incorrect error code reporting in query_virtqueues
On Mon, Sep 29, 2025 at 9:43 PM Alok Tiwari <alok.a.tiwari@...cle.com> wrote:
>
> 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: 1fcdf43ea69e ("vdpa/mlx5: Use async API for vq query command")
> Signed-off-by: Alok Tiwari <alok.a.tiwari@...cle.com>
> ---
> drivers/vdpa/mlx5/net/mlx5_vnet.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/vdpa/mlx5/net/mlx5_vnet.c b/drivers/vdpa/mlx5/net/mlx5_vnet.c
> index 0ed2fc28e1ce..b2ebf56b2ea2 100644
> --- a/drivers/vdpa/mlx5/net/mlx5_vnet.c
> +++ b/drivers/vdpa/mlx5/net/mlx5_vnet.c
> @@ -1258,7 +1258,7 @@ static int query_virtqueues(struct mlx5_vdpa_net *ndev,
> int vq_idx = start_vq + i;
>
> if (cmd->err) {
> - mlx5_vdpa_err(mvdev, "query vq %d failed, err: %d\n", vq_idx, err);
> + mlx5_vdpa_err(mvdev, "query vq %d failed, err: %d\n", vq_idx, cmd->err);
> if (!err)
> err = cmd->err;
> continue;
> --
> 2.50.1
>
Acked-by: Jason Wang <jasowang@...hat.com>
Thanks
Powered by blists - more mailing lists