Add support for partial csums and GSO
commit078a77268de81f8d0fd52f9129c9d777b29b8399
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)
tree55a7fda0143de33ea15bad2a7c525cc43f1b623a
parentc92b307954c860a43f407187212580a4cd6b7a60
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>
hw/virtio-net.c
net.h
vl.c