M Michael S. Tsirkin #
Message details and related content
On Wed, Sep 15, 2021 at 11:24:53AM +0800, Wu Zongyong wrote:
On Tue, Sep 14, 2021 at 08:58:28AM -0400, Michael S. Tsirkin wrote:quoted
On Tue, Sep 14, 2021 at 08:24:51PM +0800, Wu Zongyong wrote:quoted
This new attribute advertises whether the vdpa device is legacy or not. Users can pick right virtqueue size if the vdpa device is legacy which doesn't support to change virtqueue size. Signed-off-by: Wu Zongyong <redacted>So if we are bothering with legacy, I think there are several things to do when building the interface - support transitional devices, that is allow userspace to tell device it's in legacy mode - support reporting/setting supporting endian-nessIt's true if we try to implement a general drvier for legacy. But this series is dedicated to implement a driver only for ENI. Is it necessary to implement what you said here in this series?
To a certain degree, yes. I am thinking about the UAPI here. The new attribute is part of that. E.g. userspace consuming this needs to be more or less hardware agnostic and not depend on specifics of ENI. Otherwise if userspace assumes legacy==eni then it will break with other hardware. One way to test how generic it all is would be adding legacy support in the simulator.
quoted
quoted
--- drivers/vdpa/vdpa.c | 6 ++++++ drivers/virtio/virtio_vdpa.c | 7 ++++++- include/uapi/linux/vdpa.h | 1 + 3 files changed, 13 insertions(+), 1 deletion(-)diff --git a/drivers/vdpa/vdpa.c b/drivers/vdpa/vdpa.c index 1dc121a07a93..533d7f589eee 100644 --- a/drivers/vdpa/vdpa.c +++ b/drivers/vdpa/vdpa.c@@ -12,6 +12,7 @@ #include <linux/slab.h> #include <linux/vdpa.h> #include <uapi/linux/vdpa.h> +#include <uapi/linux/virtio_config.h> #include <net/genetlink.h> #include <linux/mod_devicetable.h>@@ -494,6 +495,7 @@ vdpa_dev_fill(struct vdpa_device *vdev, struct sk_buff *msg, u32 portid, u32 seq u16 max_vq_size; u32 device_id; u32 vendor_id; + u64 features; void *hdr; int err;@@ -508,6 +510,7 @@ vdpa_dev_fill(struct vdpa_device *vdev, struct sk_buff *msg, u32 portid, u32 seq device_id = vdev->config->get_device_id(vdev); vendor_id = vdev->config->get_vendor_id(vdev); max_vq_size = vdev->config->get_vq_num_max(vdev); + features = vdev->config->get_features(vdev); err = -EMSGSIZE; if (nla_put_string(msg, VDPA_ATTR_DEV_NAME, dev_name(&vdev->dev)))@@ -520,6 +523,9 @@ vdpa_dev_fill(struct vdpa_device *vdev, struct sk_buff *msg, u32 portid, u32 seq goto msg_err; if (nla_put_u16(msg, VDPA_ATTR_DEV_MAX_VQ_SIZE, max_vq_size)) goto msg_err; + if (features & BIT_ULL(VIRTIO_F_VERSION_1) &&
_______________________________________________ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization