kvm: qemu: Add support for partial csums and GSO
commit3c84414601726445f8413f2339147d2cee6374a2
authorMark McLoughlin <markmc@redhat.com>
Mon, 11 Aug 2008 20:12:08 +0000 (11 21:12 +0100)
committerAvi Kivity <avi@qumranet.com>
Wed, 13 Aug 2008 09:12:07 +0000 (13 12:12 +0300)
treea61bb8aa7aecbfcd3b30ee5b01a13fd3cbaf8539
parent836cb79d78492a2074e38bbec94831354ebedbdb
kvm: qemu: Add support for partial csums and GSO

The tun/tap driver in 2.6.27 contains a new IFF_VNET_HDR
flag which makes every packet read from or written to the
tap fd be preceded by a virtio_net_hdr header.

This allows us to pass larger packets and packets with
partial checkums between the guest and the host, greatly
increasing the achievable bandwidth.

If the tap device has IFF_VNET_HDR enabled, the virtio-net
driver the merely needs to shuffle the headers supplied
by the guest or host to the other side.

We also inform the guest that we can now receive GSO packets
and have it confirm whether it can do likewise. If the guest
can receive GSO packets, we enable GSO on the tun device
using TUNSETOFFLOAD.

Note also that we increase the size of the tap packet buffer
to accomodate the largest possible GSO packet.

Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
qemu/hw/virtio-net.c
qemu/net.h
qemu/vl.c