From: netdev-bot+sashiko@kernel.org
To: toddfreed@meta.com
Cc: netdev@vger.kernel.org, daniel.zahka@gmail.com, kuba@kernel.org,
willemdebruijn.kernel@gmail.com, davem@davemloft.net,
edumazet@kernel.org, pabeni@redhat.com, horms@kernel.org,
andrew+netdev@lunn.ch, shuah@kernel.org, raeds@nvidia.com,
rrameshbabu@nvidia.com, cratiu@nvidia.com,
linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org,
bjorn@kernel.org
Subject: Re: [PATCH net v2 1/2] psp: fix transport mode encap with ipv6 extension headers
Date: Mon, 26 Oct 2026 23:22:28 +0000 [thread overview]
Message-ID: <179305694824.3134.18415422493301271111@kernel.org> (raw)
In-Reply-To: <20261022223014.556388-2-toddfreed@meta.com>
Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.
Low priority / nit picks for your consideration:
- [Low] The updated kernel-doc comment on the exported
psp_dev_encapsulate() says "With IPv6, they go after any extension…
--
psp: fix transport mode encap with ipv6 extension headers
This patch changes psp_dev_encapsulate() to walk the IPv6 extension
header chain. It now rewrites the nexthdr of the last header in the chain
to UDP, instead of always rewriting the fixed header. Fragment, routing,
NEXTHDR_NONE and unknown header types are rejected, and psp_dev_rcv()
does the reverse on receive using ipv6_skip_exthdr().
> diff --git a/net/psp/psp_main.c b/net/psp/psp_main.c
> index c9c1a8826b7f9..0c009d7b08c00 100644
> --- a/net/psp/psp_main.c
> +++ b/net/psp/psp_main.c
[ ... ]
> +static int psp_ipv6_nexthdr_off(const u8 *hdr, unsigned int len)
> +{
[ ... ]
> + if (!ipv6_ext_hdr(type) || type == NEXTHDR_NONE ||
> + type == NEXTHDR_FRAGMENT || type == NEXTHDR_ROUTING)
> + return -1;
[ ... ]
> @@ -243,7 +280,7 @@ static void psp_write_headers(struct net *net, struct sk_buff *skb, __be32 spi,
> }
>
> /* Encapsulate a TCP packet with PSP by adding the UDP+PSP headers and filling
> - * them in.
> + * them in. With IPv6, they go after any extension headers.
> */
> bool psp_dev_encapsulate(struct net *net, struct sk_buff *skb, __be32 spi,
> u8 ver, __be16 sport)
> @@ -251,10 +288,17 @@ bool psp_dev_encapsulate(struct net *net, struct sk_buff *skb, __be32 spi,
> u32 network_len = skb_network_header_len(skb);
> u32 ethr_len = skb_mac_header_len(skb);
> u32 bufflen = ethr_len + network_len;
> -
> - if (skb->protocol != htons(ETH_P_IP) &&
> - skb->protocol != htons(ETH_P_IPV6))
> + int nh_off = 0;
> +
> + if (skb->protocol == htons(ETH_P_IPV6)) {
> + /* UDP + PSP after the extension headers, if any */
> + nh_off = psp_ipv6_nexthdr_off(skb_network_header(skb),
> + network_len);
> + if (nh_off < 0)
> + return false;
[Severity: Low]
This isn't a bug, but do the comments on psp_dev_encapsulate() describe
more than the code accepts?
The kernel-doc says "With IPv6, they go after any extension headers", and
the inline comment says "UDP + PSP after the extension headers, if any".
However, psp_ipv6_nexthdr_off() rejects routing, fragment, NEXTHDR_NONE
and unknown header types. For those, psp_dev_encapsulate() returns false.
Callers such as mlx5e_psp_handle_tx_skb() and nsim_do_psp() drop the skb
in that case. In the selftest, a socket with IPV6_RTHDR set ends up with
its data stuck in the send queue.
On the RX side, psp_dev_rcv() already says that fragment and routing
headers are not supported in transport mode. Could the TX helper's
comment state the same restriction, so driver authors know that some
extension header layouts make encapsulation fail?
> + } else if (skb->protocol != htons(ETH_P_IP)) {
> return false;
> + }
[ ... ]
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261022223014.556388-1-toddfreed%40meta.com
next prev parent reply other threads:[~2026-10-26 23:22 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-22 22:30 [PATCH net v2 0/2] psp: fix transport mode with ipv6 extension headers Todd Freed
2026-10-22 22:30 ` [PATCH net v2 1/2] psp: fix transport mode encap " Todd Freed
2026-10-23 11:23 ` Daniel Zahka
2026-10-23 17:20 ` Todd Bert Freed
2026-10-26 23:22 ` netdev-bot+sashiko [this message]
2026-10-22 22:30 ` [PATCH net v2 2/2] selftests: drv-net: psp: test ipv6 tcp socket with " Todd Freed
2026-10-23 11:44 ` Daniel Zahka
2026-10-26 23:22 ` netdev-bot+sashiko
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=179305694824.3134.18415422493301271111@kernel.org \
--to=netdev-bot+sashiko@kernel.org \
--cc=andrew+netdev@lunn.ch \
--cc=bjorn@kernel.org \
--cc=cratiu@nvidia.com \
--cc=daniel.zahka@gmail.com \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=raeds@nvidia.com \
--cc=rrameshbabu@nvidia.com \
--cc=shuah@kernel.org \
--cc=toddfreed@meta.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