qemu/hw
Greg Kurz 1bfa316ce7 virtio-net: use the backend cross-endian capabilities
When running a fully emulated device in cross-endian conditions, including
a virtio 1.0 device offered to a big endian guest, we need to fix the vnet
headers. This is currently handled by the virtio_net_hdr_swap() function
in the core virtio-net code but it should actually be handled by the net
backend.

With this patch, virtio-net now tries to configure the backend to do the
endian fixing when the device starts (i.e. drivers sets the CONFIG_OK bit).
If the backend cannot support the requested endiannes, we have to fallback
onto virtio_net_hdr_swap(): this is recorded in the needs_vnet_hdr_swap flag,
to be used in the TX and RX paths.

Note that we reset the backend to the default behaviour (guest native
endianness) when the device stops (i.e. device status had CONFIG_OK bit and
driver unsets it). This is needed, with the linux tap backend at least,
otherwise the guest may lose network connectivity if rebooted into a
different endianness.

The current vhost-net code also tries to configure net backends. This will
be no more needed and will be reverted in a subsequent patch.

Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Reviewed-by: Laurent Vivier <lvivier@redhat.com>
Signed-off-by: Greg Kurz <gkurz@linux.vnet.ibm.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Laurent Vivier <lvivier@redhat.com>
2016-02-16 12:05:17 +02:00
..
9pfs virtio: move allocation to virtqueue_pop/vring_pop 2016-02-06 20:39:07 +02:00
acpi qom: Swap 'name' next to visitor in ObjectPropertyAccessor 2016-02-08 17:29:56 +01:00
alpha alpha: Clean up includes 2016-01-29 15:07:23 +00:00
arm bcm2835_property: implement "get board revision" query 2016-02-11 11:17:32 +00:00
audio ES1370: QOMify 2016-02-11 15:15:46 +03:00
block fdc: always compile-check debug prints 2016-02-10 13:29:40 -05:00
bt hw: Clean up includes 2016-01-29 15:07:25 +00:00
char virtio: introduce qemu_get/put_virtqueue_element 2016-02-06 20:44:08 +02:00
core qapi: Drop unused 'kind' for struct/enum visit 2016-02-08 17:29:57 +01:00
cpu hw: Clean up includes 2016-01-29 15:07:25 +00:00
cris cris: Clean up includes 2016-01-29 15:07:24 +00:00
display xen: Drop __XEN_LATEST_INTERFACE_VERSION__ checks from prior to Xen 4.2 2016-02-10 12:01:32 +00:00
dma dma: remove now useless DMA_* functions 2016-02-03 11:28:58 -05:00
gpio hw: Clean up includes 2016-01-29 15:07:25 +00:00
i2c hw: Clean up includes 2016-01-29 15:07:25 +00:00
i386 xen: drop support for Xen 4.1 and older. 2016-02-10 12:01:16 +00:00
ide ahci: prohibit "restarting" the FIS or CLB engines 2016-02-10 13:29:40 -05:00
input Adds keycode 86 to the hid_usage_keys translation table. 2016-02-11 15:15:47 +03:00
intc qom: Swap 'name' next to visitor in ObjectPropertyAccessor 2016-02-08 17:29:56 +01:00
ipack hw: Clean up includes 2016-01-29 15:07:25 +00:00
ipmi ipmi_bmc_sim: Add break to correct watchdog NMI check 2016-02-09 15:46:54 +01:00
isa qom: Swap 'name' next to visitor in ObjectPropertyAccessor 2016-02-08 17:29:56 +01:00
lm32 lm32: Clean up includes 2016-01-29 15:07:22 +00:00
m68k m68k: Clean up includes 2016-01-29 15:07:24 +00:00
mem qom: Swap 'name' next to visitor in ObjectPropertyAccessor 2016-02-08 17:29:56 +01:00
microblaze microblaze: Clean up includes 2016-01-28 11:13:13 +00:00
mips magnum: disable floppy DMA for now 2016-02-03 11:28:57 -05:00
misc bcm2835_property: implement "get board revision" query 2016-02-11 11:17:32 +00:00
moxie moxie: Clean up includes 2016-01-29 15:07:25 +00:00
net virtio-net: use the backend cross-endian capabilities 2016-02-16 12:05:17 +02:00
nvram hw: Clean up includes 2016-01-29 15:07:25 +00:00
openrisc openrisc: Clean up includes 2016-01-29 15:07:24 +00:00
pci fix MSI injection on Xen 2016-02-06 20:44:10 +02:00
pci-bridge hw/pxb: add pxb devices to the bridge category 2016-02-06 20:44:08 +02:00
pci-host qom: Swap 'name' next to visitor in ObjectPropertyAccessor 2016-02-08 17:29:56 +01:00
pcmcia hw: Clean up includes 2016-01-29 15:07:25 +00:00
ppc qapi: Drop unused error argument for list and implicit struct 2016-02-08 17:29:57 +01:00
s390x s390x: remove s390-zipl.rom 2016-02-11 15:15:47 +03:00
scsi hw: Add support for LSI SAS1068 (mptsas) device 2016-02-09 15:45:26 +01:00
sd sd: limit 'req.cmd' while using as an array index 2016-02-11 11:17:32 +00:00
sh4 sh4: Clean up includes 2016-01-29 15:07:24 +00:00
smbios hw: Clean up includes 2016-01-29 15:07:25 +00:00
sparc dma: remove now useless DMA_* functions 2016-02-03 11:28:58 -05:00
sparc64 dma: remove now useless DMA_* functions 2016-02-03 11:28:58 -05:00
ssi hw: Clean up includes 2016-01-29 15:07:25 +00:00
timer log: do not unnecessarily include qom/cpu.h 2016-02-03 09:19:10 +00:00
tpm hw: Clean up includes 2016-01-29 15:07:25 +00:00
tricore tricore: Clean up includes 2016-01-29 15:07:25 +00:00
unicore32 unicore: Clean up includes 2016-01-29 15:07:22 +00:00
usb Passthru CCID card: QOMify 2016-02-11 15:15:47 +03:00
vfio hw/vfio: Clean up includes 2016-01-29 15:07:24 +00:00
virtio qapi: Drop unused 'kind' for struct/enum visit 2016-02-08 17:29:57 +01:00
watchdog hw: Clean up includes 2016-01-29 15:07:25 +00:00
xen xen: drop XenXC and associated interface wrappers 2016-02-10 12:01:24 +00:00
xenpv xen: Clean up includes 2016-01-29 15:07:23 +00:00
xtensa xtensa: Clean up includes 2016-01-29 15:07:24 +00:00
Makefile.objs Add a base IPMI interface 2015-12-22 18:39:19 +02:00