The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Daniel Zahka <daniel.zahka@gmail.com>
To: Willem de Bruijn <willemdebruijn.kernel@gmail.com>,
	Jakub Kicinski <kuba@kernel.org>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Paolo Abeni <pabeni@redhat.com>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next 2/6] netdevsim: psp: remove unnecessary UDP checksum computation
Date: Mon, 11 May 2026 15:43:17 -0400	[thread overview]
Message-ID: <e961b20a-8bfb-4142-b7c1-14c640c47df0@gmail.com> (raw)
In-Reply-To: <willemdebruijn.kernel.20208e72aa400@gmail.com>


On 5/11/26 3:01 PM, Willem de Bruijn wrote:
> Daniel Zahka wrote:
>    
> @@ -81,36 +79,6 @@ nsim_do_psp(struct sk_buff *skb, struct netdevsim *ns,
>    			      skb->len - skb_inner_transport_offset(skb));
>    		u64_stats_update_end(&ns->psp.syncp);
>    	} else {
> -		struct ipv6hdr *ip6h __maybe_unused;
> -		struct iphdr *iph;
> -		struct udphdr *uh;
> -		__wsum csum;
> -
> -		/* Do not decapsulate. Receive the skb with the udp and psp
> -		 * headers still there as if this is a normal udp packet.
> -		 * psp_dev_encapsulate() sets udp checksum to 0, so we need to
> -		 * provide a valid checksum here, so the skb isn't dropped.
> -		 */
>>> Perhaps this was here as IPv6 does not allow zero checksums except for
>>> tunneling in specific cases (RFC 6936)?
>>
>> Yes it was originally here for IPv6. It was needed to make a test case
>> pass that ultimately never got upstreamed (yet). The test basically used
>> the psp_dev_ops::set_config() function to turn psp rx off midflow, and
>> then tried to catch packets with a udp socket listening on port 1000. At
>> the time I didn't realize that I could probably make the test work by
>> opting the socket into a setting for RFC 6936 with setsockopt().
> Just curious: which setsockopt is this?

I was thinking of UDP_NO_CHECK6_RX, though I probably shouldn't have 
characterized it as relating to RFC 6936. I haven't dug through the code 
or history to figure out if that was added for tunnels or to implement 
that rfc. I can see that tunnel driver callers of udp_sock_create() can 
configure the 0 checksum behavior, which seems to actually implement 
what's described in the rfc.

>> though as I mentioned, none of the current tests cover that the
>> psp-udp csum is correct.
> .. actually based on this, preferable even


I agree. My plan would be to add the psp-udp checksum calculation back 
when we have a test that actually depends on it to pass.


  reply	other threads:[~2026-05-11 19:43 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-08 14:53 [PATCH net-next 0/6] netdevsim: psp: implement real crypto operations from the PSP spec Daniel Zahka
2026-05-08 14:53 ` [PATCH net-next 1/6] netdevsim: psp: reset spi on key rotation and check for exhaustion on alloc Daniel Zahka
2026-05-11 16:53   ` Willem de Bruijn
2026-05-08 14:53 ` [PATCH net-next 2/6] netdevsim: psp: remove unnecessary UDP checksum computation Daniel Zahka
2026-05-11 17:01   ` Willem de Bruijn
2026-05-11 17:46     ` Daniel Zahka
2026-05-11 19:01       ` Willem de Bruijn
2026-05-11 19:43         ` Daniel Zahka [this message]
2026-05-08 14:53 ` [PATCH net-next 3/6] netdevsim: psp: move rx processing into nsim_poll() Daniel Zahka
2026-05-11 20:03   ` Willem de Bruijn
2026-05-08 14:53 ` [PATCH net-next 4/6] netdevsim: psp: implement kdf from psp spec Daniel Zahka
2026-05-11 19:49   ` Willem de Bruijn
2026-05-08 14:53 ` [PATCH net-next 5/6] netdevsim: psp: add real aes-gcm encryption and decryption Daniel Zahka
2026-05-11 20:10   ` Willem de Bruijn
2026-05-08 14:53 ` [PATCH net-next 6/6] netdevsim: psp: count rx authentication and length errors Daniel Zahka
2026-05-11 20:19   ` 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=e961b20a-8bfb-4142-b7c1-14c640c47df0@gmail.com \
    --to=daniel.zahka@gmail.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=willemdebruijn.kernel@gmail.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