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

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

From: Si-Wei Liu <hidden>
Date: 2021-12-03 07:32:23


On 12/1/2021 11:57 AM, Eli Cohen 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);
This denotes the size i.e. # of descriptor entries in a virtqueue, 
rather the total number of virtqueues. You need to add another op 
(vdpa_net specific) to get this info.

-Siwei
  }
  
  static u32 mlx5_vdpa_get_device_id(struct vdpa_device *vdev)
_______________________________________________
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