Merge branch 'tun-vnet-uso'
authorDavid S. Miller <davem@davemloft.net>
Mon, 12 Dec 2022 09:29:57 +0000 (09:29 +0000)
committerDavid S. Miller <davem@davemloft.net>
Mon, 12 Dec 2022 09:29:57 +0000 (09:29 +0000)
commit93c60b597493d8875584385c90aa7933e92bf375
treefa683f80e96b2971c4ecc989ed6f524cc90f3085
parentdd8b3a802b64adf059a49a68f1bdca7846e492fc
parent418044e1de3063a6c50df964bdfca7eecd7ec6e5
Merge branch 'tun-vnet-uso'

Andrew Melnychenko says:

====================
TUN/VirtioNet USO features support.

Added new offloads for TUN devices TUN_F_USO4 and TUN_F_USO6.
Technically they enable NETIF_F_GSO_UDP_L4
(and only if USO4 & USO6 are set simultaneously).
It allows the transmission of large UDP packets.

UDP Segmentation Offload (USO/GSO_UDP_L4) - ability to split UDP packets
into several segments. It's similar to UFO, except it doesn't use IP
fragmentation. The drivers may push big packets and the NIC will split
them(or assemble them in case of receive), but in the case of VirtioNet
we just pass big UDP to the host. So we are freeing the driver from doing
the unnecessary job of splitting. The same thing for several guests
on one host, we can pass big packets between guests.

Different features USO4 and USO6 are required for qemu where Windows
guests can enable disable USO receives for IPv4 and IPv6 separately.
On the other side, Linux can't really differentiate USO4 and USO6, for now.
For now, to enable USO for TUN it requires enabling USO4 and USO6 together.
In the future, there would be a mechanism to control UDP_L4 GSO separately.

New types for virtio-net already in virtio-net specification:
https://github.com/oasis-tcs/virtio-spec/issues/120

Test it WIP Qemu https://github.com/daynix/qemu/tree/USOv3

Changes since v4 & RFC:
 * Fixed typo and refactored.
 * Tun USO offload refactored.
 * Add support for guest-to-guest segmentation offload (thx Jason).
====================

Signed-off-by: David S. Miller <davem@davemloft.net>