From: Paolo Abeni <pabeni@redhat.com>
To: Willem de Bruijn <willemb@google.com>
Cc: virtio-comment@lists.linux.dev, maxime.coquelin@redhat.com,
Eelco Chaudron <echaudro@redhat.com>,
Jason Wang <jasowang@redhat.com>,
Stefano Garzarella <sgarzare@redhat.com>
Subject: Re: [PATCH v7 2/2] virtio-net: define UDP tunnel checksum offload feature
Date: Thu, 22 Aug 2024 17:18:56 +0200 [thread overview]
Message-ID: <48eaa7e7-3cd7-41ca-8109-892702ee9350@redhat.com> (raw)
In-Reply-To: <CA+FuTSe1Wz8T5NDUA-h1izZ1mhz3z0jsK8XH6tgtREz00B9nhw@mail.gmail.com>
On 8/21/24 21:42, Willem de Bruijn wrote:
> On Wed, Aug 21, 2024 at 6:03 AM Paolo Abeni <pabeni@redhat.com> wrote:
>> @@ -425,6 +446,7 @@ \subsection{Device Operation}\label{sec:Device Types / Network Device / Device O
>> #define VIRTIO_NET_HDR_F_NEEDS_CSUM 1
>> #define VIRTIO_NET_HDR_F_DATA_VALID 2
>> #define VIRTIO_NET_HDR_F_RSC_INFO 4
>> +#define VIRTIO_NET_HDR_F_UDP_TUNNEL_CSUM 8
>
> Only now notice: since this is only valid with GSO, should this be a
> gso_type bit, like VIRTIO_NET_HDR_GSO_ECN?
I originally placed the flag here for consistency with NEEDS_CSUM,
before making the TUNNEL_CSUM offload depending on TUNNEL_GSO offload.
I think it's still a valid choice: the bit space in 'gso_type' is quite
low; will be significantly lower then what will have in 'flags' with
such change, I *think* it's more future proof this way. Do you have
strong opinion otherwise?
>> +If the VIRTIO_NET_F_HOST_UDP_TUNNEL_GSO_CSUM feature has been negotiated,
>> +and the VIRTIO_NET_HDR_GSO_UDP_TUNNEL_IPV4 bit or
>> +VIRTIO_NET_HDR_GSO_UDP_TUNNEL_IPV6 bit in \field{gso_type} are set,
>> +the driver MAY set the VIRTIO_NET_HDR_F_UDP_TUNNEL_CSUM bit in
>> +\field{flags}, if so:
>> +\begin{enumerate}
>> +\item the driver MUST validate the packet checksum at
>> + offset 6 from \field{outer_th_offset} as well as all
>> + preceding offsets;
>
> I don't follow this comment: when programming checksum offload, why
> does the driver have to validate any checksums?
I must admit this is plain cargo cult programming, from the original
csum fields specification. I naively (and forcefully) interpreted the
original statement as 'the driver must validate the csums related
offset' (yup, it requires quite a bit of good interpretation will ;).
I now think we are better off dropping this sentence (and similar ones)
completely.
Thanks,
Paolo
>
> Same in two other locations.
>
next prev parent reply other threads:[~2024-08-22 15:19 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-21 10:02 [PATCH v7 0/2] virtio-net: define UDP tunnel offload Paolo Abeni
2024-08-21 10:02 ` [PATCH v7 1/2] virtio-net: define UDP tunnel segmentation offload feature Paolo Abeni
2024-08-21 19:28 ` Willem de Bruijn
2024-08-21 19:48 ` Willem de Bruijn
2024-08-22 14:25 ` Paolo Abeni
2024-08-22 14:30 ` Willem de Bruijn
2024-08-22 14:11 ` Paolo Abeni
2024-08-26 12:23 ` [EXTERNAL] " Shiva Shankar Kommula
2024-08-29 15:49 ` Paolo Abeni
2024-09-02 12:31 ` Shiva Shankar Kommula
2024-09-04 14:53 ` Paolo Abeni
2024-08-21 10:02 ` [PATCH v7 2/2] virtio-net: define UDP tunnel checksum " Paolo Abeni
2024-08-21 19:42 ` Willem de Bruijn
2024-08-22 15:18 ` Paolo Abeni [this message]
2024-08-22 15:20 ` Willem de Bruijn
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=48eaa7e7-3cd7-41ca-8109-892702ee9350@redhat.com \
--to=pabeni@redhat.com \
--cc=echaudro@redhat.com \
--cc=jasowang@redhat.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