[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 03/51] vdpa: handle VIRTIO_NET_CTRL_ANNOUNCE in vhost_vdpa_net_han
From: |
Michael S. Tsirkin |
Subject: |
[PULL 03/51] vdpa: handle VIRTIO_NET_CTRL_ANNOUNCE in vhost_vdpa_net_handle_ctrl_avail |
Date: |
Thu, 5 Jan 2023 04:14:26 -0500 |
From: Eugenio Pérez <eperezma@redhat.com>
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>
---
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 d36664f33a..41de76376f 100644
--- a/net/vhost-vdpa.c
+++ b/net/vhost-vdpa.c
@@ -616,9 +616,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))) {
--
MST
- [PULL 00/51] virtio,pc,pci: features, cleanups, fixes, Michael S. Tsirkin, 2023/01/05
- [PULL 01/51] virtio_net: Modify virtio_net_get_config to early return, Michael S. Tsirkin, 2023/01/05
- [PULL 02/51] virtio_net: copy VIRTIO_NET_S_ANNOUNCE if device model has it, Michael S. Tsirkin, 2023/01/05
- [PULL 03/51] vdpa: handle VIRTIO_NET_CTRL_ANNOUNCE in vhost_vdpa_net_handle_ctrl_avail,
Michael S. Tsirkin <=
- [PULL 04/51] vdpa: do not handle VIRTIO_NET_F_GUEST_ANNOUNCE in vhost-vdpa, Michael S. Tsirkin, 2023/01/05
- [PULL 05/51] hw/acpi/Kconfig: Rename ACPI_X86_ICH to ACPI_ICH9, Michael S. Tsirkin, 2023/01/05
- [PULL 06/51] hw/acpi/Kconfig: Add missing dependencies to ACPI_ICH9, Michael S. Tsirkin, 2023/01/05
- [PULL 07/51] hw/acpi/Kconfig: Do not needlessly build TYPE_PIIX4_PM in non-PC/Malta machines, Michael S. Tsirkin, 2023/01/05
- [PULL 08/51] hw/acpi/Kconfig: Add missing dependencies to ACPI_PIIX4, Michael S. Tsirkin, 2023/01/05
- [PULL 09/51] hw/isa/Kconfig: Add missing dependency to VT82C686, Michael S. Tsirkin, 2023/01/05
- [PULL 10/51] i386, mips: Resolve redundant ACPI and APM dependencies, Michael S. Tsirkin, 2023/01/05
- [PULL 11/51] hw/ppc/Kconfig: Remove unused dependencies from PEGASOS2, Michael S. Tsirkin, 2023/01/05
- [PULL 12/51] vhost-user: Refactor vhost acked features saving, Michael S. Tsirkin, 2023/01/05
- [PULL 13/51] vhost-user: Refactor the chr_closed_bh, Michael S. Tsirkin, 2023/01/05