virtio-net: add vnet_hdr support
authorMark McLoughlin <markmc@redhat.com>
Thu, 22 Oct 2009 16:43:45 +0000 (17:43 +0100)
committerAnthony Liguori <aliguori@us.ibm.com>
Tue, 27 Oct 2009 17:29:01 +0000 (12:29 -0500)
commit6dc99f0bd113dd1d6a2794716a79b8e3b2fa3fdb
tree028e208ec6392cf19a801e25c464e6178f95d05a
parent216189d763a4d578c72af87acbdc2ca844d4fe7d
virtio-net: add vnet_hdr support

With '-netdev tap,id=foo -nic model=virtio,netdev=foo' virtio-net can
detect that its peer (i.e. the tap backend) supports vnet headers
and advertise to the guest that it can send packets with partial
checksums and/or TSO packets.

One complication is that if we're migrating and the source host
supports IFF_VNET_HDR but the destination host doesn't, we can't then
stop the guest from using those features. In this scenario, we just
fail the migration.

[v2:
 - add has_vnet_hdr uint32_t field for ease of vmstate conversion
 - use qemu_error()
]

Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
hw/virtio-net.c