From: netdev-bot+sashiko@kernel.org
To: bryon@fryer.io
Cc: netdev@vger.kernel.org, davem@davemloft.net, edumazet@kernel.org,
horms@kernel.org, jasowangio@gmail.com, kuba@kernel.org,
linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org,
pabeni@redhat.com, shuah@kernel.org
Subject: Re: [PATCH net 1/2] udp: restore outer transport header after tunnel GRO
Date: Mon, 16 Nov 2026 13:50:36 +0000 [thread overview]
Message-ID: <179483703667.3136.1173201547098616400@kernel.org> (raw)
In-Reply-To: <20261112030708.1915665-2-bryon@fryer.io>
Thank you for your contribution! Sashiko AI review found 1 potential
issue(s) to consider.
Critical: 0 · High: 1 · Medium: 0 · Low: 0
If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).
- [High] The patch fixes only one producer: udp_gro_complete().
--
udp: restore outer transport header after tunnel GRO
This patch changes udp_gro_complete() so that skb->transport_header points
back at the outer UDP header (nhoff) after the inner gro_complete()
callback succeeds. Without that, the virtio tunnel exporter reports the
inner transport offset as outer_th_offset, and the receiving TAP rejects
the aggregate.
> diff --git a/net/ipv4/udp_offload.c b/net/ipv4/udp_offload.c
> index b77ae2f00c626..1a1d1a125d23e 100644
> --- a/net/ipv4/udp_offload.c
> +++ b/net/ipv4/udp_offload.c
> @@ -948,6 +948,8 @@ int udp_gro_complete(struct sk_buff *skb, int nhoff,
> skb->encapsulation = 1;
> err = udp_sk(sk)->gro_complete(sk, skb,
> nhoff + sizeof(struct udphdr));
> + if (!err)
> + skb_set_transport_header(skb, nhoff);
[Severity: High]
The commit message describes the problem in general terms:
"UDP tunnel GRO can produce invalid virtio tunnel headers, causing
virtio-net to drop whole aggregates."
The fix only covers aggregates that reach udp_gro_complete(). Can
UDP-tunnel GSO skbs that never pass through gro_complete() still reach
virtio_net_hdr_tnl_from_skb() with the same bad offsets?
The HW-GRO paths in bnxt (bnxt_gro_func_5731x() with bnxt_gro_tunnel())
and bnge (bnge_gro_func() with bnge_gro_tunnel()) build aggregates with
gso_type set to SKB_GSO_TCPV4/6 plus SKB_GSO_UDP_TUNNEL[_CSUM]. These
aggregates also have:
- transport_header on the inner TCP header
- skb->encapsulation never set
- inner_network_header never set
For example, in bnxt_gro_tunnel():
if (uh) {
if (uh->check)
skb_shinfo(skb)->gso_type |= SKB_GSO_UDP_TUNNEL_CSUM;
else
skb_shinfo(skb)->gso_type |= SKB_GSO_UDP_TUNNEL;
}
dev_gro_receive() accepts these TCP-GSO skbs into software GRO. However,
tcp_gro_receive() sets NAPI_GRO_CB(skb)->flush when len !=
count * gso_size, or when the header has PSH/URG/RST/SYN/FIN set. Both
cases are common at the end of a bulk TCP burst.
A flush is also forced when udp_gro_receive() finds no matching tunnel
socket, or when the outer tot_len check in inet_gro_receive() fails. In
each of these cases, dev_gro_receive() takes this path:
if (NAPI_GRO_CB(skb)->flush)
goto normal;
and neither gro_complete() nor udp_gro_complete() runs.
If the skb is then bridged to a TAP that negotiated TUN_F_UDP_TUNNEL_GSO,
virtio_net_hdr_tnl_from_skb() does:
inner_nh = skb->inner_network_header - skb_headroom(skb);
outer_th = skb->transport_header - skb_headroom(skb);
That gives outer_th_offset equal to the inner TCP offset and
inner_nh_offset equal to (u16)(0 - headroom). On the peer side,
virtio_net_hdr_tnl_to_skb() then fails its inner_th < inner_nh +
inner_l3min check and returns -EINVAL. That is the same dropped-aggregate
symptom described in the commit message.
These aggregates also cannot be re-segmented in software.
udp4_ufo_fragment() returns -EINVAL when encapsulation is 0 and neither
SKB_GSO_UDP nor SKB_GSO_UDP_L4 is set. That suggests the root cause for
this path is in the drivers.
The change itself looks correct. Should it be extended to cover this
path? One option would be to have the bnxt/bnge HW-GRO paths set
encapsulation and the inner mac/network/transport headers, and leave
transport_header on the outer UDP header. Otherwise, could the commit
message be narrowed to the software GRO completion path?
Separately, would it make sense for virtio_net_hdr_tnl_from_skb() to
reject tunnel-GSO skbs with !skb->encapsulation rather than emit these
offsets?
> } else {
> err = udp_gro_complete_segment(skb);
> }
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261112030708.1915665-1-bryon%40fryer.io
next prev parent reply other threads:[~2026-11-16 13:50 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-12 3:07 [PATCH net 0/2] udp: preserve outer transport header after tunnel GRO Bryon Fryer
2026-11-12 3:07 ` [PATCH net 1/2] udp: restore " Bryon Fryer
2026-11-16 13:50 ` netdev-bot+sashiko [this message]
2026-11-12 3:07 ` [PATCH net 2/2] selftests: net: check UDP tunnel GRO virtio offsets Bryon Fryer
2026-11-16 13:50 ` 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=179483703667.3136.1173201547098616400@kernel.org \
--to=netdev-bot+sashiko@kernel.org \
--cc=bryon@fryer.io \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=horms@kernel.org \
--cc=jasowangio@gmail.com \
--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=shuah@kernel.org \
/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