[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 17/35] net: set endianness on all backend devices
From: |
Michael Roth |
Subject: |
[Qemu-devel] [PATCH 17/35] net: set endianness on all backend devices |
Date: |
Mon, 21 Mar 2016 12:28:15 -0500 |
From: Laurent Vivier <address@hidden>
commit 5be7d9f1b1452613b95c6ba70b8d7ad3d0797991
vhost-net: tell tap backend about the vnet endianness
makes vhost net to set the endianness of the device, but only for
the first device.
In case of multiqueue, we have multiple devices... This patch sets the
endianness for all the devices of the interface.
Signed-off-by: Laurent Vivier <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>
Reviewed-by: Greg Kurz <address@hidden>
Reviewed-by: Cornelia Huck <address@hidden>
Reviewed-by: Jason Wang <address@hidden>
(cherry picked from commit a407644079c8639002e7ea635d851953b10a38c3)
Signed-off-by: Michael Roth <address@hidden>
---
hw/net/vhost_net.c | 23 +++++++++++------------
1 file changed, 11 insertions(+), 12 deletions(-)
diff --git a/hw/net/vhost_net.c b/hw/net/vhost_net.c
index 318c3e6..10e233a 100644
--- a/hw/net/vhost_net.c
+++ b/hw/net/vhost_net.c
@@ -300,21 +300,19 @@ int vhost_net_start(VirtIODevice *dev, NetClientState
*ncs,
BusState *qbus = BUS(qdev_get_parent_bus(DEVICE(dev)));
VirtioBusState *vbus = VIRTIO_BUS(qbus);
VirtioBusClass *k = VIRTIO_BUS_GET_CLASS(vbus);
- int r, e, i;
+ int r, e, i, j;
if (!k->set_guest_notifiers) {
error_report("binding does not support guest notifiers");
- r = -ENOSYS;
- goto err;
+ return -ENOSYS;
}
- r = vhost_net_set_vnet_endian(dev, ncs[0].peer, true);
- if (r < 0) {
- goto err;
- }
-
- for (i = 0; i < total_queues; i++) {
- vhost_net_set_vq_index(get_vhost_net(ncs[i].peer), i * 2);
+ for (j = 0; j < total_queues; j++) {
+ r = vhost_net_set_vnet_endian(dev, ncs[j].peer, true);
+ if (r < 0) {
+ goto err_endian;
+ }
+ vhost_net_set_vq_index(get_vhost_net(ncs[j].peer), j * 2);
}
r = k->set_guest_notifiers(qbus->parent, total_queues * 2, true);
@@ -343,8 +341,9 @@ err_start:
fflush(stderr);
}
err_endian:
- vhost_net_set_vnet_endian(dev, ncs[0].peer, false);
-err:
+ while (--j >= 0) {
+ vhost_net_set_vnet_endian(dev, ncs[j].peer, false);
+ }
return r;
}
--
1.9.1
- [Qemu-devel] [PATCH 00/35] Patch Round-up for stable 2.5.1, freeze on 2016-03-25, Michael Roth, 2016/03/21
- [Qemu-devel] [PATCH 10/35] ivshmem: remove redundant assignment, fix crash with msi=off, Michael Roth, 2016/03/21
- [Qemu-devel] [PATCH 12/35] block: Add blk_dev_has_tray(), Michael Roth, 2016/03/21
- [Qemu-devel] [PATCH 09/35] ivshmem: no need for opaque argument, Michael Roth, 2016/03/21
- [Qemu-devel] [PATCH 11/35] net: rocker: fix an incorrect array bounds check, Michael Roth, 2016/03/21
- [Qemu-devel] [PATCH 17/35] net: set endianness on all backend devices,
Michael Roth <=
- [Qemu-devel] [PATCH 13/35] blockdev: Fix 'change' for slot devices, Michael Roth, 2016/03/21
- [Qemu-devel] [PATCH 14/35] net/dump: fix nfds->filename leak, Michael Roth, 2016/03/21
- [Qemu-devel] [PATCH 18/35] ehci: update irq on reset, Michael Roth, 2016/03/21
- [Qemu-devel] [PATCH 19/35] block/raw-posix: avoid bogus fixup for cylinders on DASD disks, Michael Roth, 2016/03/21
- [Qemu-devel] [PATCH 01/35] ehci: make idt processing more robust, Michael Roth, 2016/03/21
- [Qemu-devel] [PATCH 21/35] s390x/css: fix control flags during csch, Michael Roth, 2016/03/21
- [Qemu-devel] [PATCH 15/35] net/filter: fix nf->netdev_id leak, Michael Roth, 2016/03/21
- [Qemu-devel] [PATCH 16/35] net: ne2000: check ring buffer control registers, Michael Roth, 2016/03/21
- [Qemu-devel] [PATCH 24/35] qmp: Fix reference-counting of qnull on empty output visit, Michael Roth, 2016/03/21
- [Qemu-devel] [PATCH 23/35] cpus: use broadcast on qemu_pause_cond, Michael Roth, 2016/03/21