Add virtio-net/tap support for partial csums and GSO
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v2 Latest19 patches 16 repliesIn review
- v119 patches 0 repliesSuperseded
Changes in v2 from the cover letter
- add has_vnet_hdr and has_ufo fields for ease of vmstate conversion
- use qemu_error() in virtio_net_load()
Patches in v2 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/19 | net: remove unused includes of if_tun.h and if_tap.hqemu-char.c savevm.c vl.c | +0 | 0 replies | |
| 2/19 | net: import linux tap ioctl definitionsnet.c qemu-options.hx tap-linux.h | +31 | 0 replies | |
| 3/19 | net: make tap_receive() re-use tap_receive_iov() codenet.c | +15 | 0 replies | |
| 4/19 | net: enable IFF_VNET_HDR on tap fds if availablenet.c tap-linux.h | +84 | 0 replies | |
| 5/19 | net: refactor tap initializationnet.c | +52 | 0 replies | |
| 6/19 | net: add a vnet_hdr=on|off parameternet.c qemu-options.hx | +35 | 0 replies | |
| 7/19 | net: add a client type codehw/ hw/ hw/ +7 more | +44 | 0 replies | |
| 8/19 | net: add tap_has_vnet_hdr() and tap_using_vnet_hdr() APIsnet.c net.h | +38 | 0 replies | |
| 9/19 | net: add flags parameter to packet queue interfacenet-queue.c net-queue.h net.c | +36 | 0 replies | |
| 10/19 | net: add an API for 'raw' packetsnet-queue.h net.c net.h | +32 | 0 replies | |
| 11/19 | net: add receive_raw parameter to qemu_new_vlan_client()hw/ hw/ hw/ +7 more | +18 | 0 replies | |
| 12/19 | net: use qemu_send_packet_raw() in qemu_announce_self()savevm.c | +1 | 0 replies | |
| 13/19 | net: implement tap support for receive_raw()net.c | +19 | 0 replies | |
| 14/19 | virtio-net: add vnet_hdr supporthw/ | +44 | 0 replies | |
| 15/19 | net: add tap_set_offload()net.c net.h tap-linux.h | +32 | 0 replies | |
| 16/19 | virtio-net: enable tap offload if guest supports ithw/ | +18 | 0 replies | |
| 17/19 | Work around dhclient brokennesshw/ | +29 | 0 replies | |
| 18/19 | Enable UFO on virtio-net and tap deviceshw/ net.c net.h +1 more | +44 | 0 replies | |
| 19/19 | virtio-net: add tap_has_ufo flag to saved statehw/ | +21 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.
Cover letter [Qemu-devel] [PATCH 00/19 v2] Add virtio-net/tap support for partial csums and GSO
Hey,
Over a year ago we added some code to qemu-kvm.git which takes
advantage of the recent tun/tap IFF_VNET_HDR feature in order to allow virtio-net to send and receive packets with partial checksums and segmentation offloaded:
http://article.gmane.org/gmane.comp.emulators.kvm.devel/20440
"This allows us to pass larger packets and packets with partial checkums between the guest and the host, greatly increasing the achievable bandwidth."
Unfortunately, that implementation was quite hacky as it
made some assumptions that would break if e.g. you added another network client to a vlan where the feature had enabled.
Now that we have the -netdev parameter, we can more safely
pair the NIC and backend, allowing us to negatiate features like this.
What follows is a somewhat cleaned up version of the code
from qemu-kvm.git. Further cleanups are probably possible, but I think this much is mergeable. Some points of discussion:
- If you start a guest on a host which supports IFF_VNET_HDR and migrate to a host which doesn't support it, we can't just tell the guest to stop using GSO.
We need prevent this by rejecting the migration on the destination if IFF_VNET_HDR is required but not available. However, in my testing if a load() function returns an error, the migration is seen to have completed on the source but failed on the destination. Clearly that's wrong, but I haven't investigated further yet.
Also, we provide a vnet_hdr= arg so that people can prevent the feature being used on the source or require that is available on the destination.
- I've slightly abused QemuOpts in 05/19. Comments welcome.
- The whole mess around adding a 'raw' packet flag for the gratuitous ARP packet is gratuitously messy.
- I'm always enabling IFF_VNET_HDR if it's available. I don't think that's a problem, especially compared to what would be required to only selectively enable it.
Changes since v1:
- add has_vnet_hdr and has_ufo fields for ease of vmstate conversion
- use qemu_error() in virtio_net_load()
Cheers,
Mark.