[PATCH RFC 00/16] virtio: introduce support for GSO over UDP tunnel

Paolo Abeni posted 16 patches 5 months, 4 weeks ago
Failed in applying to current master (apply log)
There is a newer version of this series
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
[PATCH RFC 00/16] virtio: introduce support for GSO over UDP tunnel
Posted by Paolo Abeni 5 months, 4 weeks ago
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
Re: [PATCH RFC 00/16] virtio: introduce support for GSO over UDP tunnel
Posted by Akihiko Odaki 5 months, 3 weeks ago
On 2025/05/21 20:33, Paolo Abeni wrote:
> 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.

What about adding another 64-bit integer to hold the high bits? It makes 
adding the 128-bit integer type to VMState and properties and 
CONFIG_INT128 checks unnecessary.

> 
> 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!

My proposal to add a feature to tap devices[1] simply omitted tests and 
I wrote simple testing scripts for my personal usage. As you can see, 
there is no testing code that covers tap devices, unfortunately, and I 
think adding one takes significant effort.

[1] https://patchew.org/QEMU/20250313-hash-v4-0-c75c494b495e@daynix.com/

> 
> 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
>
Re: [PATCH RFC 00/16] virtio: introduce support for GSO over UDP tunnel
Posted by Paolo Abeni 5 months, 3 weeks ago
On 5/23/25 9:19 AM, Akihiko Odaki wrote:
> On 2025/05/21 20:33, Paolo Abeni wrote:
>> 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.
> 
> What about adding another 64-bit integer to hold the high bits? It makes 
> adding the 128-bit integer type to VMState and properties and 
> CONFIG_INT128 checks unnecessary.

I did a few others implementation attempts before the current one. The
closes to the above proposal I tried was to implement virtio_features_t
as fixed size array of u64.

A problem a found with that approach is that it requires a very large
code churn, as ~ every line touching a feature related variable should
be modified.

Let me think a little bit on this other option (I hope to avoid
discarding a lot of work here).

>> 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!
> 
> My proposal to add a feature to tap devices[1] simply omitted tests and 
> I wrote simple testing scripts for my personal usage. As you can see, 
> there is no testing code that covers tap devices, unfortunately, and I 
> think adding one takes significant effort.
> 
> [1] https://patchew.org/QEMU/20250313-hash-v4-0-c75c494b495e@daynix.com/

Thanks for the pointer

Paolo
Re: [PATCH RFC 00/16] virtio: introduce support for GSO over UDP tunnel
Posted by Akihiko Odaki 4 months, 3 weeks ago
On 2025/05/23 18:43, Paolo Abeni wrote:
> On 5/23/25 9:19 AM, Akihiko Odaki wrote:
>> On 2025/05/21 20:33, Paolo Abeni wrote:
>>> 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.
>>
>> What about adding another 64-bit integer to hold the high bits? It makes
>> adding the 128-bit integer type to VMState and properties and
>> CONFIG_INT128 checks unnecessary.
> 
> I did a few others implementation attempts before the current one. The
> closes to the above proposal I tried was to implement virtio_features_t
> as fixed size array of u64.
> 
> A problem a found with that approach is that it requires a very large
> code churn, as ~ every line touching a feature related variable should
> be modified.
> 
> Let me think a little bit on this other option (I hope to avoid
> discarding a lot of work here).
> 
>>> 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!
>>
>> My proposal to add a feature to tap devices[1] simply omitted tests and
>> I wrote simple testing scripts for my personal usage. As you can see,
>> there is no testing code that covers tap devices, unfortunately, and I
>> think adding one takes significant effort.
>>
>> [1] https://patchew.org/QEMU/20250313-hash-v4-0-c75c494b495e@daynix.com/
> 
> Thanks for the pointer

By the way, I did write selftests for the kernel-side change, which you 
can find at:
https://lore.kernel.org/r/20250530-rss-v12-0-95d8b348de91@daynix.com/

Perhaps you may be able to steal and tweak it for the UDP tunnel feature.

Regards,
Akihiko Odaki
Re: [PATCH RFC 00/16] virtio: introduce support for GSO over UDP tunnel
Posted by Akihiko Odaki 5 months, 3 weeks ago
On 2025/05/23 18:43, Paolo Abeni wrote:
> On 5/23/25 9:19 AM, Akihiko Odaki wrote:
>> On 2025/05/21 20:33, Paolo Abeni wrote:
>>> 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.
>>
>> What about adding another 64-bit integer to hold the high bits? It makes
>> adding the 128-bit integer type to VMState and properties and
>> CONFIG_INT128 checks unnecessary.
> 
> I did a few others implementation attempts before the current one. The
> closes to the above proposal I tried was to implement virtio_features_t
> as fixed size array of u64.
> 
> A problem a found with that approach is that it requires a very large
> code churn, as ~ every line touching a feature related variable should
> be modified.

Using an array may be ideal in the end, but for now you may instead add 
a separate field for the upper-half. For example, you may change 
DECLARE_FEATURES() as follows:

#define DECLARE_FEATURES(name) \
     uint64_t name;             \
     uint64_t name##_hi;

Regards,
Akihiko Odaki
Re: [PATCH RFC 00/16] virtio: introduce support for GSO over UDP tunnel
Posted by Paolo Abeni 5 months ago
On 5/21/25 1:33 PM, Paolo Abeni wrote:
> 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!

Some times has passed, and I haven't followed-up yet with a v2. The root
cause (beyond the usual ENOTIME ;) is that I'm focusing on the
kernel-side patches, which I almost co-posted with this RFC, and are
still under discussion.

Since the outcome of such discussion will influence also the userland,
I'll wait it to settle before sharing a new revision here.

It could take still some time, and the new revision will likely present
significant different from v1, especially WRT virtio feature space
expansion - as working on the kernel code showed a possibly better approach.

Thanks,

Paolo