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.

One of the reasons for the RFC tag is that the kernel-side
implementation has just been shared upstream and is not merged yet, but
there are also other relevant reasons, see below.

Currently, the kernel virtio support limits the feature space to 64 bits,
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 larger part of this series (patches 2-11) actually deals with
the extended feature space.

I tried to minimize the otherwise very large code churn by limiting the
extended features support to arches with native 128 integer support and
introducing the extended features space support only in virtio/vhost
core and in the relevant device driver.

The actual offload implementation is in patches 12-16 and boils down to
propagating the new offload to the tun devices and the vhost backend.

Tested with basic stream transfer with all the possible permutations of
host kernel/qemu/guest kernel with/without GSO over UDP tunnel support
and vs snapshots creation and restore.

Notably this does not include (yet) any additional tests. Some guidance
on such matter would be really appreciated, and any feedback about the
features extension strategy would be more than welcome!

Paolo Abeni (16):
  linux-headers: Update to Linux v6.15-rc net-next
  migration: introduce support for 128 bit int state.
  virtio: introduce extended features type
  virtio: serialize extended features state
  qmp: update virtio features map to support extended features
  virtio: add support for negotiating extended features.
  virtio-pci: implement support for extended features.
  vhost: add support for negotiating extended features.
  vhost-backend: implement extended features support.
  vhost-net: implement extended features support.
  qdev-properties: add property for extended virtio features
  virtio-net: implement extended features support.
  net: implement tunnel probing
  net: bundle all offloads in a single struct
  net: implement tnl feature offloading
  net: make vhost-net aware of GSO over UDP tunnel hdr layout

 hw/core/qdev-properties.c                     |  46 +++++
 hw/net/e1000e_core.c                          |   5 +-
 hw/net/igb_core.c                             |   5 +-
 hw/net/vhost_net-stub.c                       |   7 +-
 hw/net/vhost_net.c                            |  35 ++--
 hw/net/virtio-net.c                           | 195 +++++++++++++-----
 hw/net/vmxnet3.c                              |  13 +-
 hw/virtio/vhost-backend.c                     |  59 +++++-
 hw/virtio/vhost.c                             |  58 ++++--
 hw/virtio/virtio-bus.c                        |  15 +-
 hw/virtio/virtio-hmp-cmds.c                   |   3 +-
 hw/virtio/virtio-pci.c                        |  19 +-
 hw/virtio/virtio-qmp.c                        |  28 ++-
 hw/virtio/virtio-qmp.h                        |   3 +-
 hw/virtio/virtio.c                            | 103 ++++++++-
 include/hw/qdev-properties.h                  |  13 ++
 include/hw/virtio/vhost-backend.h             |  10 +
 include/hw/virtio/vhost.h                     |  13 +-
 include/hw/virtio/virtio-features.h           |  90 ++++++++
 include/hw/virtio/virtio-net.h                |   2 +-
 include/hw/virtio/virtio-pci.h                |   2 +-
 include/hw/virtio/virtio.h                    |  17 +-
 include/migration/qemu-file-types.h           |  15 ++
 include/migration/vmstate.h                   |  11 +
 include/net/net.h                             |  20 +-
 include/net/vhost_net.h                       |   8 +-
 include/standard-headers/asm-x86/setup_data.h |   4 +-
 include/standard-headers/drm/drm_fourcc.h     |  41 ++++
 include/standard-headers/linux/const.h        |   2 +-
 include/standard-headers/linux/ethtool.h      | 156 ++++++++------
 include/standard-headers/linux/fuse.h         |  12 +-
 include/standard-headers/linux/pci_regs.h     |  13 +-
 include/standard-headers/linux/virtio_net.h   |  46 +++++
 include/standard-headers/linux/virtio_pci.h   |   1 +
 include/standard-headers/linux/virtio_snd.h   |   2 +-
 linux-headers/asm-arm64/kvm.h                 |  11 +
 linux-headers/asm-arm64/unistd_64.h           |   1 +
 linux-headers/asm-generic/mman-common.h       |   1 +
 linux-headers/asm-generic/unistd.h            |   4 +-
 linux-headers/asm-loongarch/unistd_64.h       |   1 +
 linux-headers/asm-mips/unistd_n32.h           |   1 +
 linux-headers/asm-mips/unistd_n64.h           |   1 +
 linux-headers/asm-mips/unistd_o32.h           |   1 +
 linux-headers/asm-powerpc/unistd_32.h         |   1 +
 linux-headers/asm-powerpc/unistd_64.h         |   1 +
 linux-headers/asm-riscv/kvm.h                 |   2 +
 linux-headers/asm-riscv/unistd_32.h           |   1 +
 linux-headers/asm-riscv/unistd_64.h           |   1 +
 linux-headers/asm-s390/unistd_32.h            |   1 +
 linux-headers/asm-s390/unistd_64.h            |   1 +
 linux-headers/asm-x86/kvm.h                   |   3 +
 linux-headers/asm-x86/unistd_32.h             |   1 +
 linux-headers/asm-x86/unistd_64.h             |   1 +
 linux-headers/asm-x86/unistd_x32.h            |   1 +
 linux-headers/linux/bits.h                    |   8 +-
 linux-headers/linux/const.h                   |   2 +-
 linux-headers/linux/iommufd.h                 | 129 +++++++++++-
 linux-headers/linux/kvm.h                     |   1 +
 linux-headers/linux/psp-sev.h                 |  21 +-
 linux-headers/linux/stddef.h                  |   2 +
 linux-headers/linux/vfio.h                    |  30 ++-
 linux-headers/linux/vhost.h                   |  12 +-
 migration/qemu-file.c                         |  16 ++
 migration/vmstate-types.c                     |  25 +++
 net/net.c                                     |  21 +-
 net/netmap.c                                  |   3 +-
 net/tap-bsd.c                                 |   8 +-
 net/tap-linux.c                               |  46 ++++-
 net/tap-solaris.c                             |   9 +-
 net/tap-stub.c                                |   8 +-
 net/tap.c                                     |  19 +-
 net/tap_int.h                                 |   5 +-
 qapi/virtio.json                              |   8 +-
 73 files changed, 1209 insertions(+), 271 deletions(-)
 create mode 100644 include/hw/virtio/virtio-features.h

-- 
2.49.0


Reply via email to