Thread (1 message) 1 message, 1 author, 2021-12-03

Re: [PATCH 4/7] vdpa/mlx5: Report queried max supported virtqueues

From: Jason Wang <hidden>
Date: 2021-12-03 02:32:02

On Thu, Dec 2, 2021 at 3:58 AM Eli Cohen [off-list ref] wrote:
quoted hunk
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 <redacted>
---
 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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help