[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 45/49] net: set endianness on all backend devices
From: |
Michael S. Tsirkin |
Subject: |
[Qemu-devel] [PULL 45/49] net: set endianness on all backend devices |
Date: |
Thu, 4 Feb 2016 23:54:01 +0200 |
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>
---
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 0bd5131..3940a04 100644
--- a/hw/net/vhost_net.c
+++ b/hw/net/vhost_net.c
@@ -298,21 +298,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);
@@ -341,8 +339,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;
}
--
MST
- [Qemu-devel] [PULL 37/49] pc: Eliminate PcGuestInfo struct, (continued)
- [Qemu-devel] [PULL 37/49] pc: Eliminate PcGuestInfo struct, Michael S. Tsirkin, 2016/02/04
- [Qemu-devel] [PULL 36/49] pc: Move APIC and NUMA data from PcGuestInfo to PCMachineState, Michael S. Tsirkin, 2016/02/04
- [Qemu-devel] [PULL 38/49] acpi: take oem_id in build_header(), optionally, Michael S. Tsirkin, 2016/02/04
- [Qemu-devel] [PULL 39/49] acpi: expose oem_id and oem_table_id in build_rsdt(), Michael S. Tsirkin, 2016/02/04
- [Qemu-devel] [PULL 40/49] acpi: add function to extract oem_id and oem_table_id from the user's SLIC, Michael S. Tsirkin, 2016/02/04
- [Qemu-devel] [PULL 41/49] pc: set the OEM fields in the RSDT and the FADT from the SLIC, Michael S. Tsirkin, 2016/02/04
- [Qemu-devel] [PULL 42/49] dimm: Correct type of MemoryHotplugState->base, Michael S. Tsirkin, 2016/02/04
- [Qemu-devel] [PULL 43/49] intel_iommu: large page support, Michael S. Tsirkin, 2016/02/04
- [Qemu-devel] [PULL 44/49] fix MSI injection on Xen, Michael S. Tsirkin, 2016/02/04
- [Qemu-devel] [PULL 45/49] net: set endianness on all backend devices,
Michael S. Tsirkin <=
- [Qemu-devel] [PULL 46/49] i386/acpi: make floppy controller object dynamic, Michael S. Tsirkin, 2016/02/04
- [Qemu-devel] [PULL 48/49] i386: populate floppy drive information in DSDT, Michael S. Tsirkin, 2016/02/04
- Re: [Qemu-devel] [PULL 48/49] i386: populate floppy drive information in DSDT, Igor Mammedov, 2016/02/05
- Re: [Qemu-devel] [PULL 48/49] i386: populate floppy drive information in DSDT, Roman Kagan, 2016/02/08
- Re: [Qemu-devel] [PULL 48/49] i386: populate floppy drive information in DSDT, John Snow, 2016/02/08
- Re: [Qemu-devel] [PULL 48/49] i386: populate floppy drive information in DSDT, Roman Kagan, 2016/02/09
- Re: [Qemu-devel] [PULL 48/49] i386: populate floppy drive information in DSDT, John Snow, 2016/02/09
- Re: [Qemu-devel] [PULL 48/49] i386: populate floppy drive information in DSDT, Laszlo Ersek, 2016/02/09
- Re: [Qemu-devel] [PULL 48/49] i386: populate floppy drive information in DSDT, Michael S. Tsirkin, 2016/02/09