On Thu, Dec 2, 2021 at 3:58 AM Eli Cohen <e...@nvidia.com> wrote:
>
> Report back in get_vq_num_max() the correct number of virtqueues queried
> from the device instead of using a constant value.
>
> Signed-off-by: Eli Cohen <e...@nvidia.com>
> ---
>  drivers/vdpa/mlx5/net/mlx5_vnet.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/vdpa/mlx5/net/mlx5_vnet.c 
> b/drivers/vdpa/mlx5/net/mlx5_vnet.c
> index 62aba5dbd8fa..336eda3dcf41 100644
> --- a/drivers/vdpa/mlx5/net/mlx5_vnet.c
> +++ b/drivers/vdpa/mlx5/net/mlx5_vnet.c
> @@ -1992,10 +1992,10 @@ static void mlx5_vdpa_set_config_cb(struct 
> vdpa_device *vdev, struct vdpa_callba
>         ndev->config_cb = *cb;
>  }
>
> -#define MLX5_VDPA_MAX_VQ_ENTRIES 256
>  static u16 mlx5_vdpa_get_vq_num_max(struct vdpa_device *vdev)
>  {
> -       return MLX5_VDPA_MAX_VQ_ENTRIES;
> +       struct mlx5_vdpa_dev *mvdev = to_mvdev(vdev);
> +       return MLX5_CAP_DEV_VDPA_EMULATION(mvdev->mdev, 
> max_num_virtio_queues);
>  }

I may miss something but I guess it should not be the hardware
limitation but the one that is set from netlink.

Thanks

>
>  static u32 mlx5_vdpa_get_device_id(struct vdpa_device *vdev)
> --
> 2.33.1
>

_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

Reply via email to