public inbox for virtio-comment@lists.linux.dev
 help / color / mirror / Atom feed
From: Paolo Abeni <pabeni@redhat.com>
To: Jason Wang <jasowang@redhat.com>
Cc: virtio-comment@lists.linux.dev, maxime.coquelin@redhat.com,
	Eelco Chaudron <echaudro@redhat.com>,
	Stefano Garzarella <sgarzare@redhat.com>,
	Willem de Bruijn <willemb@google.com>,
	kshankar@marvell.com
Subject: Re: [PATCH v9 1/2] virtio-net: define UDP tunnel segmentation offload feature
Date: Fri, 25 Oct 2024 13:50:41 +0200	[thread overview]
Message-ID: <a6ad7c40-d65d-4b95-a7ae-86d77eda4bdf@redhat.com> (raw)
In-Reply-To: <CACGkMEu-AQea98e5xqj4Vfo4zog_nzeJQ_pLADAOY9ZogsS8AQ@mail.gmail.com>

On 10/25/24 10:28, Jason Wang wrote:
> On Wed, Oct 23, 2024 at 12:56 AM Paolo Abeni <pabeni@redhat.com> wrote:
>> I proposed the following:
>>
>> For GSO over UDP tunnel VIRTIO_NET_HDR_F_DATA_VALID is allowed if and
>> only even  VIRTIO_NET_HDR_F_UDP_TUNNEL_CSUM is set in flags.
>>
>> That means that the device supports csum offload for both the inner and
>> the outer and both csums are valid. The corresponding skb will have
>> CHECKSUM_UNNECESSARY and csum_level == 1.
> 
> Nit: csum_level seems to be Linux specific.

Note: the above was an informal description of the proposal, not the
actual wording to be used in the spec.

>> There is actually another point which I'm quite scared to mention
>> because it caused v9 and implicitly all this discussion.
>>
>> I want to prevent the driver receiving from the device GSO over UDP
>> tunnel packets without csum_start/csum_offset, because the header
>> probing code looks fragile and bug-prone and will be even more complex
>> in case of tunnels.
> 
> This needs more thought. For example, it seems not specific to GSO.
> Should we have a new feature for this? (And build a GSO UDP tunnel on
> top?)

Double checking I read the above correctly.

Do you mean something alike the following to negotiated another feature
controlling a new bit in flag telling 'the csum_start field is set even
if NEEDS_CSUM is not set'?

What about using the flag already defined in patch 2 instead (currently
named VIRTIO_NET_HDR_F_UDP_TUNNEL_CSUM, possibly a different better name
can be used [suggestion more than welcome])?

The overall schema will be:

- DATA_VALID retains its current semantic when GSO over UDP features are
not negotiated and when VIRTIO_NET_HDR_F_UDP_TUNNEL_CSUM is not set

- when VIRTIO_NET_HDR_F_UDP_TUNNEL_CSUM is set that means the following:
  - 2 checksums are offloaded - the 2 outer-most one in case the packet
carries more nested headers.
  and
  - 'csum_start' points to the innermost offloaded header

- DATA_VALID can be set together with VIRTIO_NET_HDR_F_UDP_TUNNEL_CSUM,
  meaning:
  - CHECKSUM_UNNECESSARY with csum_level == 1,
  and
  - csum_start -> inner transport offset. If the packet carries many
nested headers csum_start points to the 2nd outermost one.

- VIRTIO_NET_HDR_GSO_UDP_TUNNEL_IPV{4,6} can be set/used if and only if:
  - NEEDS_CSUM is set (csum_start/csum_offset avail)
    or
  - DATA_VALID and VIRTIO_NET_HDR_F_UDP_TUNNEL_CSUM are both set
    (meaning 2 csums are offloaded and csum_start is avail)

Note that even the following will be also allowed:

VIRTIO_NET_HDR_GSO_UDP_TUNNEL_IPV{4,6} is set, NEEDS_CSUM is set,
VIRTIO_NET_HDR_F_UDP_TUNNEL_CSUM is set.

meaning it's GSO over UDP tunnel packets, with both checksum offloaded
and CSUM_PARTIAL.

WDYT?

Thanks,

Paolo


  reply	other threads:[~2024-10-25 11:50 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-04  8:13 [PATCH v9 0/2] virtio-net: define UDP tunnel offload Paolo Abeni
2024-10-04  8:13 ` [PATCH v9 1/2] virtio-net: define UDP tunnel segmentation offload feature Paolo Abeni
2024-10-09  7:18   ` Jason Wang
2024-10-09  8:37     ` Paolo Abeni
2024-10-10  3:17       ` Jason Wang
2024-10-10  7:40         ` Paolo Abeni
2024-10-11  2:08           ` Jason Wang
2024-10-11  7:50             ` Paolo Abeni
2024-10-14  7:20             ` Paolo Abeni
2024-10-17  6:47               ` Jason Wang
2024-10-17 15:34                 ` Paolo Abeni
2024-10-18  4:26                   ` Jason Wang
2024-10-18 10:10                     ` Paolo Abeni
2024-10-20 22:28                       ` Willem de Bruijn
2024-10-21 15:47                         ` Paolo Abeni
2024-10-22  7:54                           ` Jason Wang
2024-10-23 20:57                             ` Willem de Bruijn
2024-10-25  8:41                               ` Jason Wang
2024-10-21  6:54                       ` Jason Wang
2024-10-21 16:27                         ` Paolo Abeni
2024-10-22  7:42                           ` Jason Wang
2024-10-22 16:56                             ` Paolo Abeni
2024-10-25  8:28                               ` Jason Wang
2024-10-25 11:50                                 ` Paolo Abeni [this message]
2024-10-25 13:28                                   ` Willem de Bruijn
2024-10-25 14:35                                     ` Paolo Abeni
2024-10-25 15:47                                       ` Willem de Bruijn
2024-10-28  3:27                                   ` Jason Wang
2024-10-28 12:08                                     ` Paolo Abeni
2024-10-28 12:26                                       ` Willem de Bruijn
2024-10-28 14:23                                         ` Paolo Abeni
2024-10-29  7:32                                         ` Jason Wang
2024-10-04  8:13 ` [PATCH v9 2/2] virtio-net: define UDP tunnel checksum " Paolo Abeni
2024-10-09  7:18   ` Jason Wang
2024-10-09  9:39     ` Paolo Abeni
2024-10-10  4:22       ` Jason Wang
2024-10-04 16:53 ` [PATCH v9 0/2] virtio-net: define UDP tunnel offload Paolo Abeni
2024-10-09  7:24   ` Jason Wang
2024-10-09  8:08     ` Paolo Abeni
2024-10-10  2:29       ` Jason Wang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a6ad7c40-d65d-4b95-a7ae-86d77eda4bdf@redhat.com \
    --to=pabeni@redhat.com \
    --cc=echaudro@redhat.com \
    --cc=jasowang@redhat.com \
    --cc=kshankar@marvell.com \
    --cc=maxime.coquelin@redhat.com \
    --cc=sgarzare@redhat.com \
    --cc=virtio-comment@lists.linux.dev \
    --cc=willemb@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox