]> rtime.felk.cvut.cz Git - lisovros/qemu_apohw.git/commit
virtio-net: byteswap virtio-net header
authorCédric Le Goater <clg@fr.ibm.com>
Tue, 24 Jun 2014 17:11:32 +0000 (19:11 +0200)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Wed, 16 Jul 2014 00:28:01 +0000 (19:28 -0500)
commit0fd14a556436386311c3c5aeeac501ce468c8df0
tree158d11132a63e52e3dc3ebf70fe5a8167ee48449
parent7a3cd5ab408d06fac4e1ae6aa88b823a48db085c
virtio-net: byteswap virtio-net header

TCP connectivity fails when the guest has a different endianness.
The packets are silently dropped on the host by the tap backend
when they are read from user space because the endianness of the
virtio-net header is in the wrong order. These lines may appear
in the guest console:

[  454.709327] skbuff: bad partial csum: csum=8704/4096 len=74
[  455.702554] skbuff: bad partial csum: csum=8704/4096 len=74

The issue that got first spotted with a ppc64le PowerKVM guest,
but it also exists for the less common case of a x86_64 guest run
by a big-endian ppc64 TCG hypervisor.

Signed-off-by: Cédric Le Goater <clg@fr.ibm.com>
[ Ported from PowerKVM,
  Greg Kurz <gkurz@linux.vnet.ibm.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>
(cherry picked from commit 032a74a1c0fcdd5fd1c69e56126b4c857ee36611)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
hw/net/virtio-net.c