Re: [PATCH v11 4/4] virtio-net: define UDP tunnel checksum offload feature

Jason Wang
2024-11-28T03:02:06Z

On Wed, Nov 27, 2024 at 5:37 PM Paolo Abeni <pabeni@redhat.com> wrote:
>
> This complements the previous change, additionally
> introducing the UDP tunnel checksum offload feature.
>
> Differently from the plain checksum offload feature, this
> depends on UDP tunnel segmentation being available, as outer checksum
> computation for non GSO packets is cheap and H/W implementation of
> such a feature is complex.
>
> UDP tunnel checksum offload does not introduce additional fields,
> instead it leverages the outer transport offset introduced by the
> UDP tunnel segmentation feature to locate the outer checksum
> inside the packet.
>
> When UDP tunnel checksum offload is negotiated:
> - the driver requests the outer UDP checksum offload setting the
> VIRTIO_NET_HDR_F_UDP_TUNNEL_CSUM bit in the flag field. Such bit
> is not allocated inside the gso_type field to prevent space
> exhaustion there.
> - in the device -> driver direction, the VIRTIO_NET_HDR_F_DATA_VALID
> bit semantic is extended, covering both the inner and the outer
> checksum validation.
>
> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
> ---
> v10 -> v11:
> - 'to the outer UDP pseudo header' -> 'to the outer UDP pseudo header
> checksum'
> - rebased on top of patch 2/4
> - dropped trailing spaces
>
> v9 -> v10:
> - DATA_VALID is not allowed for GSO over UDP tunnel packets
> - fixed more typos:
> VIRTIO_NET_HDR_GSO_UDP_TUNNEL -> either
> VIRTIO_NET_HDR_GSO_UDP_TUNNEL_IPV4 or VIRTIO_NET_HDR_GSO_UDP_TUNNEL_IPV6
>
> v8 -> v9:
> - rebased on top of virtio-1.4, changed udp-tunnel features number
> to avoid conflicts/duplications
> - fixed typos:
> VIRTIO_NET_HDR_F_UDP_TUNNEL -> VIRTIO_NET_HDR_F_UDP_TUNNEL_CSUM
> VIRTIO_NET_HDR_GSO_UDP_TUNNEL -> either
> VIRTIO_NET_HDR_GSO_UDP_TUNNEL_IPV4 or VIRTIO_NET_HDR_GSO_UDP_TUNNEL_IPV6
> - specified strict validation for the VIRTIO_NET_HDR_F_UDP_TUNNEL_CSUM
> bit, only allowed with UDP tunnel GSO packets.
> - specified that VIRTIO_NET_HDR_F_UDP_TUNNEL_CSUM describe the outer
> header csum offload for both in presence and absence of
> VIRTIO_NET_HDR_F_DATA_VALID
>
> v7 -> v8:
> - dropped confusing wording around csum validation
> - clarified VIRTIO_NET_HDR_F_UDP_TUNNEL_CSUM allocation
>
> v6 -> v7:
> - rebased
> - VIRTIO_NET_F_{HOST,GUEST}_UDP_TUNNEL_CSUM -> ...UDP_TUNNEL_GSO_CSUM
> - dropped unintended change to existing TCP gso spec
> ---
> device-types/net/description.tex | 143 ++++++++++++++++++++++++++++---
> 1 file changed, 131 insertions(+), 12 deletions(-)
>

Reviewed-by: Jason Wang <jasowang@redhat.com>

Thanks