Skip to content

virtio: introduce GSO over UDP tunnel

Paolo Abeni llvm netdev oe-kbuild-all 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest8 patches 47 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/8virtio: introduce virtio_features_tdrivers/virtio/virtio.c drivers/virtio/virtio_mmio.c drivers/virtio/virtio_pci_legacy.c +7 more+65 -3611 replies
2/8virtio_pci_modern: allow setting configuring extended featuresdrivers/virtio/virtio_pci_modern_dev.c+25 -149 replies
3/8vhost-net: allow configuring extended featuresdrivers/vhost/net.c drivers/vhost/vhost.h include/uapi/linux/vhost.h+34 -25 replies
4/8virtio_net: add supports for extended offloadsdrivers/net/virtio_net.c+29 -21 reply
5/8net: implement virtio helpers to handle UDP GSO tunneling.include/linux/virtio_net.h include/uapi/linux/virtio_net.h+202 -811 replies
6/8virtio_net: enable gso over UDP tunnel support.drivers/net/virtio_net.c+62 -161 reply
7/8tun: enable gso over UDP tunnel support.drivers/net/tun.c drivers/net/tun_vnet.h include/uapi/linux/if_tun.h+137 -235 replies
8/8vhost/net: enable gso over UDP tunnel support.drivers/vhost/net.c+7 -12 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH net-next 0/8] virtio: introduce GSO over UDP tunnel

Some virtualized deployments use UDP tunnel pervasively and are impacted negatively by the lack of GSO support for such kind of traffic in the virtual NIC driver.

The virtio_net specification recently introduced support for GSO over UDP tunnel, this series updates the virtio implementation to support such a feature.

Currently the kernel virtio support limits the feature space to 64, while the virtio specification allows for a larger number of features. Specifically the GSO-over-UDP-tunnel-related virtio features use bits 65-69.

The first four patches in this series rework the virtio and vhost feature support to cope with up to 128 bits. The limit is arch-dependent:
only arches with native 128 integer support allow for the wider feature space.

This implementation choice is aimed at keeping the code churn as limited as possible. For the same reason, only the virtio_net driver is reworked to leverage the extended feature space; all other virtio/vhost drivers are unaffected, but could be upgraded to support the extended features space in a later time.

The last four patches bring in the actual GSO over UDP tunnel support. As per specification, some additional fields are introduced into the virtio net header to support the new offload. The presence of such fields depends on the negotiated features.

A new pair of helpers is introduced to convert the UDP-tunneled skb metadata to an extended virtio net header and vice versa. Such helpers are used by the tun and virtio_net driver to cope with the newly supported offloads.

Tested with basic stream transfer with all the possible permutations of host kernel/qemu/guest kernel with/without GSO over UDP tunnel support. Sharing somewhat early to collect feedback, especially on the userland code.

Paolo Abeni (8):
virtio: introduce virtio_features_t
virtio_pci_modern: allow setting configuring extended features
vhost-net: allow configuring extended features
virtio_net: add supports for extended offloads
net: implement virtio helpers to handle UDP GSO tunneling.
virtio_net: enable gso over UDP tunnel support.
tun: enable gso over UDP tunnel support.
vhost/net: enable gso over UDP tunnel support.

 drivers/net/tun.c                      |  77 +++++++++--
 drivers/net/tun_vnet.h                 |  74 +++++++++--
 drivers/net/virtio_net.c               |  99 ++++++++++++--
 drivers/vhost/net.c                    |  32 ++++-
 drivers/vhost/vhost.h                  |   2 +-
 drivers/virtio/virtio.c                |  12 +-
 drivers/virtio/virtio_mmio.c           |   4 +-
 drivers/virtio/virtio_pci_legacy.c     |   2 +-
 drivers/virtio/virtio_pci_modern.c     |   7 +-
 drivers/virtio/virtio_pci_modern_dev.c |  44 +++---
 drivers/virtio/virtio_vdpa.c           |   2 +-
 include/linux/virtio.h                 |   5 +-
 include/linux/virtio_config.h          |  22 +--
 include/linux/virtio_features.h        |  23 ++++
 include/linux/virtio_net.h             | 177 +++++++++++++++++++++++--
 include/linux/virtio_pci_modern.h      |  11 +-
 include/uapi/linux/if_tun.h            |   9 ++
 include/uapi/linux/vhost.h             |   8 ++
 include/uapi/linux/virtio_net.h        |  33 +++++
 19 files changed, 551 insertions(+), 92 deletions(-)
 create mode 100644 include/linux/virtio_features.h
Signature · 1 line
2.49.0