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, 18 Oct 2024 12:10:28 +0200 [thread overview]
Message-ID: <3e3d6984-65d3-46b0-aaa3-e6591123f95a@redhat.com> (raw)
In-Reply-To: <CACGkMEsgJT1c93RZur20fUyjtxSX6dMPePEJvzbmNWpAHd92Mg@mail.gmail.com>
On 10/18/24 06:26, Jason Wang wrote:
> On Thu, Oct 17, 2024 at 11:34 PM Paolo Abeni <pabeni@redhat.com> wrote:
>> i.e. all the checks in
>>
>> https://elixir.bootlin.com/linux/v6.12-rc2/source/include/linux/virtio_net.h#L97
>> ..L112
>>
>> will be meaningless in such scenario and the GSO over UDP tunnel helper
>> code must replicate them with the correct offsets.
>
> I don't understand here. It works like a charm for non GSO UDP tunnel,
> anything that makes it can't work for GSO?
I we chose to use csum_start for the outer header, for GSO over UDP
tunnel packets:
1) the 'all headers in linear part' check:
https://elixir.bootlin.com/linux/v6.12-rc3/source/include/linux/virtio_net.h#L111
and all the need preeceeding algebra will be useless, as we will have
later to do the same for inner header.
2) the 'thlen' as computed by the previous switch statement:
https://elixir.bootlin.com/linux/v6.12-rc3/source/include/linux/virtio_net.h#L62
will be incorrect if we use csum_start to point the outer header, as
VIRTIO_NET_HDR_GSO_{TCPV{4,6},UDP} refers to the inner header.
3) the csum_start/csum_offset assignment performed by:
https://elixir.bootlin.com/linux/v6.12-rc3/source/include/linux/virtio_net.h#L104
will yeld the wrong values - as they should point to the inner header
for GSO over UDP tunnel packets.
4) the gso_size validation checks done under the if statement:
https://elixir.bootlin.com/linux/v6.12-rc3/source/include/linux/virtio_net.h#L156
will be incorrect - we need to account for the inner
Basically all actions and checks performed by virtio_net_hdr_to_skb()
will be wrong or irrelevant.
Instead, by using the virtio_net_hdr csum_start for the inner header,
all the above mentioned checks are be correct and meaningful.
I wrote a longer reply, addressing every later point, but I fear it
would distract from the main point using csum_offset for the outer is a
poor and inconsistent choice.
Cheers,
Paolo
p.s. I think you got scared by the many checks that the tnl helpers
implementation carry: such helpers are much more strict than the non tnl
ones to avoid injecting into the stack packets with bad layout. A
functional PoC could be implemented without most of them, but I think we
actually want those additional checks no matter what layout we use for
the virtio_net_hdr.
next prev parent reply other threads:[~2024-10-18 10:10 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 [this message]
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
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=3e3d6984-65d3-46b0-aaa3-e6591123f95a@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