mirror of
https://gitlab.com/qemu-project/qemu
synced 2024-11-05 20:35:44 +00:00
1bfa316ce7
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> |
||
---|---|---|
.. | ||
fsl_etsec | ||
rocker | ||
allwinner_emac.c | ||
cadence_gem.c | ||
dp8393x.c | ||
e1000.c | ||
e1000_regs.h | ||
eepro100.c | ||
etraxfs_eth.c | ||
imx_fec.c | ||
lan9118.c | ||
lance.c | ||
Makefile.objs | ||
mcf_fec.c | ||
milkymist-minimac2.c | ||
mipsnet.c | ||
ne2000-isa.c | ||
ne2000.c | ||
ne2000.h | ||
opencores_eth.c | ||
pcnet-pci.c | ||
pcnet.c | ||
pcnet.h | ||
rtl8139.c | ||
smc91c111.c | ||
spapr_llan.c | ||
stellaris_enet.c | ||
vhost_net.c | ||
virtio-net.c | ||
vmware_utils.h | ||
vmxnet3.c | ||
vmxnet3.h | ||
vmxnet_debug.h | ||
vmxnet_rx_pkt.c | ||
vmxnet_rx_pkt.h | ||
vmxnet_tx_pkt.c | ||
vmxnet_tx_pkt.h | ||
xen_nic.c | ||
xgmac.c | ||
xilinx_axienet.c | ||
xilinx_ethlite.c |