79c4324644
Change-Id: I2d302dda68298877c65c99147f5bf22186a59aac
52 lines
1.9 KiB
Diff
52 lines
1.9 KiB
Diff
From f6fa1b81efa3ac728a2c528b3c694d8cb5f932f1 Mon Sep 17 00:00:00 2001
|
|
From: =?UTF-8?q?Eugenio=20P=C3=A9rez?= <eperezma@redhat.com>
|
|
Date: Wed, 21 Dec 2022 12:50:14 +0100
|
|
Subject: [PATCH] vdpa: handle VIRTIO_NET_CTRL_ANNOUNCE in
|
|
vhost_vdpa_net_handle_ctrl_avail
|
|
MIME-Version: 1.0
|
|
Content-Type: text/plain; charset=UTF-8
|
|
Content-Transfer-Encoding: 8bit
|
|
|
|
Since this capability is emulated by qemu shadowed CVQ cannot forward it
|
|
to the device. Process all that command within qemu.
|
|
|
|
Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
|
|
Message-Id: <20221221115015.1400889-4-eperezma@redhat.com>
|
|
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
|
|
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
|
|
Acked-by: Jason Wang <jasowang@redhat.com>
|
|
Signed-off-by: fangyi <eric.fangyi@huawei.com>
|
|
---
|
|
net/vhost-vdpa.c | 15 ++++++++++++---
|
|
1 file changed, 12 insertions(+), 3 deletions(-)
|
|
|
|
diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c
|
|
index 24c4c2ef51..48dd9d15f6 100644
|
|
--- a/net/vhost-vdpa.c
|
|
+++ b/net/vhost-vdpa.c
|
|
@@ -623,9 +623,18 @@ static int vhost_vdpa_net_handle_ctrl_avail(VhostShadowVirtqueue *svq,
|
|
out.iov_len = iov_to_buf(elem->out_sg, elem->out_num, 0,
|
|
s->cvq_cmd_out_buffer,
|
|
vhost_vdpa_net_cvq_cmd_len());
|
|
- dev_written = vhost_vdpa_net_cvq_add(s, out.iov_len, sizeof(status));
|
|
- if (unlikely(dev_written < 0)) {
|
|
- goto out;
|
|
+ if (*(uint8_t *)s->cvq_cmd_out_buffer == VIRTIO_NET_CTRL_ANNOUNCE) {
|
|
+ /*
|
|
+ * Guest announce capability is emulated by qemu, so don't forward to
|
|
+ * the device.
|
|
+ */
|
|
+ dev_written = sizeof(status);
|
|
+ *s->status = VIRTIO_NET_OK;
|
|
+ } else {
|
|
+ dev_written = vhost_vdpa_net_cvq_add(s, out.iov_len, sizeof(status));
|
|
+ if (unlikely(dev_written < 0)) {
|
|
+ goto out;
|
|
+ }
|
|
}
|
|
|
|
if (unlikely(dev_written < sizeof(status))) {
|
|
--
|
|
2.27.0
|
|
|