]> xenbits.xensource.com Git - libvirt.git/commit
kvm/virtio: Set IFF_VNET_HDR when setting up tap fds
authorMark McLoughlin <markmc@redhat.com>
Tue, 27 Jan 2009 11:12:05 +0000 (11:12 +0000)
committerMark McLoughlin <markmc@redhat.com>
Tue, 27 Jan 2009 11:12:05 +0000 (11:12 +0000)
commitb4f62abbf1191c8fbab3306b4bf2f2567e18067f
tree12d82ac2b8677d6e29b2e53a165ba118dff55f8b
parente15147c14117333e780ef1b3d793fcb0dffa4607
kvm/virtio: Set IFF_VNET_HDR when setting up tap fds

IFF_VNET_HDR is a tun/tap flag that allows you to send and receive
large (i.e. GSO) packets and packets with partial checksums. Setting
the flag means that every packet is proceeded by the same header which
virtio uses to communicate GSO/csum metadata.

By enabling this flag on the tap fds we create, we greatly increase
the achievable throughput with virtio_net.

However, we need to be careful to only set the flag when a) QEMU has
support for this ABI and b) the value of the flag is queryable using
the TUNGETIFF ioctl.

It's nearly five months since kvm-74 - the first KVM release with this
feature - was released. Up until now, we've not added libvirt support
because there is no clean way to detect support for this in QEMU at
runtime. A brief attempt to add a "info capabilities" monitor command
to QEMU floundered. Perfect is the enemy of good enough. Probing the
KVM version will suffice for now.

Signed-off-by: Mark McLoughlin <markmc@redhat.com>
ChangeLog
src/bridge.c
src/bridge.h
src/qemu_conf.c
src/qemu_conf.h