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

RE: [PATCH 1/2] vdpa: Allow to configure max data virtqueues

From: Parav Pandit via Virtualization <hidden>
Date: 2021-12-01 12:29:05

From: Eli Cohen <redacted>
Sent: Wednesday, December 1, 2021 5:29 PM

On Wed, Dec 01, 2021 at 12:09:17PM +0200, Parav Pandit wrote:
quoted
quoted
From: Eli Cohen <redacted>
Sent: Wednesday, December 1, 2021 3:33 PM

On Tue, Nov 30, 2021 at 05:24:03PM -0800, Si-Wei Liu wrote:
quoted

On 11/30/2021 1:48 AM, Eli Cohen wrote:
quoted
Allow to configure the max virtqueues for a device.

Signed-off-by: Eli Cohen <redacted>
---
  drivers/vdpa/vdpa.c  | 16 +++++++++++++++-
  include/linux/vdpa.h |  1 +
  2 files changed, 16 insertions(+), 1 deletion(-)
diff --git a/drivers/vdpa/vdpa.c b/drivers/vdpa/vdpa.c index
7332a74a4b00..e185ec2ee851 100644
--- a/drivers/vdpa/vdpa.c
+++ b/drivers/vdpa/vdpa.c
@@ -480,7 +480,8 @@ vdpa_nl_cmd_mgmtdev_get_dumpit(struct
sk_buff
*msg, struct netlink_callback *cb)
quoted
quoted
  }
  #define VDPA_DEV_NET_ATTRS_MASK ((1 <<
VDPA_ATTR_DEV_NET_CFG_MACADDR) | \
quoted
quoted
-				 (1 <<
VDPA_ATTR_DEV_NET_CFG_MTU))
quoted
quoted
quoted
quoted
+				 (1 <<
VDPA_ATTR_DEV_NET_CFG_MTU) | \
quoted
quoted
quoted
quoted
+				 (1 <<
VDPA_ATTR_DEV_NET_CFG_MAX_VQP))
quoted
quoted
quoted
It seems VDPA_ATTR_DEV_MAX_VQS (u32) is what you want (# of data
virtqueues instead of # of data virtqueue pairs)? Not sure what's
possible use of VDPA_ATTR_DEV_NET_CFG_MAX_VQP, was it to
dump/display
quoted
the config space max_virtqueue_pairs value (u16, 1-32768) for
virtio-net? Why there's such quasi-duplicate attribute introduced
in the first
place?
quoted
VDPA_ATTR_DEV_MAX_VQS currently returns vdev->nvqs which equals
whatever passed to _vdpa_register_device(). The latter depends on
the value provided by (struct vdpa_dev_set_config).max_virtqueues.
But currently VDPA_ATTR_DEV_MAX_VQS returns the number of used queues,
No. it doesn't.
It reports nvqs passed in _vdpa_register_device().
And this API has clear definition of nvqs = number of virtqueues supported by this device
nvqs != number of used vqs.
So current MAX_VQS is doing its job right.
For example nvqs can be be 8 and guest VM driver may just use two VQs (1 tx, 1 rx, and used vqs = 2).
_______________________________________________
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