[RFC PATCH v5 05/26] vhost: Add x-vhost-set-shadow-vq qmp

Eugenio Pérez posted 26 patches 4 years, 3 months ago
There is a newer version of this series
[RFC PATCH v5 05/26] vhost: Add x-vhost-set-shadow-vq qmp
Posted by Eugenio Pérez 4 years, 3 months ago
Command to set shadow virtqueue mode.

Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
---
 qapi/net.json    | 22 ++++++++++++++++++++++
 net/vhost-vdpa.c |  6 ++++++
 2 files changed, 28 insertions(+)

diff --git a/qapi/net.json b/qapi/net.json
index 7fab2e7cd8..b191b6787b 100644
--- a/qapi/net.json
+++ b/qapi/net.json
@@ -79,6 +79,28 @@
 { 'command': 'netdev_del', 'data': {'id': 'str'},
   'allow-preconfig': true }
 
+##
+# @x-vhost-set-shadow-vq:
+#
+# Use vhost shadow virtqueue.
+#
+# @name: the device name of the VirtIO device
+#
+# @set: true to use the alternate shadow VQ notifications
+#
+# Returns: Always error, since SVQ is not implemented at the moment.
+#
+# Since: 6.2
+#
+# Example:
+#
+# -> { "execute": "x-vhost-set-shadow-vq",
+#     "arguments": { "name": "virtio-net", "set": false } }
+#
+##
+{ 'command': 'x-vhost-set-shadow-vq', 'data': {'name': 'str', 'set': 'bool'},
+  'if': 'CONFIG_VHOST_VDPA' }
+
 ##
 # @NetLegacyNicOptions:
 #
diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c
index 49ab322511..3b360da27d 100644
--- a/net/vhost-vdpa.c
+++ b/net/vhost-vdpa.c
@@ -18,6 +18,7 @@
 #include "qemu/error-report.h"
 #include "qemu/option.h"
 #include "qapi/error.h"
+#include "qapi/qapi-commands-net.h"
 #include <linux/vhost.h>
 #include <sys/ioctl.h>
 #include <err.h>
@@ -301,3 +302,8 @@ err:
 
     return -1;
 }
+
+void qmp_x_vhost_set_shadow_vq(const char *name, bool set, Error **errp)
+{
+    error_setg(errp, "Shadow virtqueue still not implemented");
+}
-- 
2.27.0


Re: [RFC PATCH v5 05/26] vhost: Add x-vhost-set-shadow-vq qmp
Posted by Juan Quintela 4 years, 3 months ago
Eugenio Pérez <eperezma@redhat.com> wrote:
> Command to set shadow virtqueue mode.
>
> Signed-off-by: Eugenio Pérez <eperezma@redhat.com>

Reviewed-by: Juan Quintela <quintela@redhat.com>

You need to keep care of:

 Markus Armbruster      ] [PATCH v2 0/9] Configurable policy for handling unstable interfaces

When this hit the tree, you need to drop the x- and mark it as unstable.

Later, Juan.


Re: [RFC PATCH v5 05/26] vhost: Add x-vhost-set-shadow-vq qmp
Posted by Eugenio Perez Martin 4 years, 3 months ago
On Tue, Nov 2, 2021 at 8:36 AM Juan Quintela <quintela@redhat.com> wrote:
>
> Eugenio Pérez <eperezma@redhat.com> wrote:
> > Command to set shadow virtqueue mode.
> >
> > Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
>
> Reviewed-by: Juan Quintela <quintela@redhat.com>
>
> You need to keep care of:
>
>  Markus Armbruster      ] [PATCH v2 0/9] Configurable policy for handling unstable interfaces
>
> When this hit the tree, you need to drop the x- and mark it as unstable.
>

Oh, very good point, I will take it into account for the next revision.

Thanks!

> Later, Juan.
>