From: Omar Ramadan <omar@blockcast.net>
To: Taehee Yoo <ap420073@gmail.com>,
Andrew Lunn <andrew+netdev@lunn.ch>,
"David S . Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Shuah Khan <shuah@kernel.org>
Cc: Simon Horman <horms@kernel.org>,
netdev@vger.kernel.org, linux-kselftest@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: [PATCH net-next 0/2] amt: mark relay data as a UDP tunnel packet, with a selftest
Date: Thu, 1 Oct 2026 20:10:14 +0300 [thread overview]
Message-ID: <20261001171016.88208-1-omar@blockcast.net> (raw)
This series follows the discussion of my earlier [PATCH net] "amt: do
not offer software GSO on the amt device", which I withdrew. Eric
Dumazet pointed out that tx checksum offload is off by default on amt,
so that case does not trigger by default, and that the better fix is to
call udp_tunnel_handle_offloads() in amt_send_multicast_data() like the
other UDP tunnels do. Patch 1 does that, and patch 2 adds the selftest
that I said I would send with it.
The earlier thread: https://lore.kernel.org/all/20260928181554.85766-1-omar@blockcast.net/
The trigger needs a non-default setting (ethtool -K <amt dev> tx on) and a
GSO source, such as a UDP_SEGMENT sender on the relay. The problem was
found by an LLM-assisted code review of drivers/net/amt.c, while
developing an IPv6 outer transport for amt.
Results, from the selftest in patch 2 in a KVM guest on net-next
commit eb0c18404c89 ("amt: pull the AMT header behind the transport
header in amt_parse_type()") with CONFIG_DEBUG_NET=y, eleven runs per
kernel:
without patch 1 the UDP_SEGMENT burst with tx on is dropped (0 of 900
datagrams arrive, tx_dropped of the relay's egress device +100 per run,
a trace shows __udp_gso_segment() returning -EINVAL during the
segmentation on that device); with patch 1 all 900 arrive intact and
tx_dropped does not move. With tx off, and with plain datagrams, both
kernels pass. The existing amt.sh passes with patch 1 (it was not run
on the unpatched kernel).
Not tested: hardware with UDP tunnel segmentation offload, hardware
checksumming on the egress device (the selftest turns it off there, so
the non-GSO CHECKSUM_PARTIAL packet that now leaves with
skb->encapsulation set is only checked through the software path),
KASAN, sparse, the udp_csum=false variant, and NETIF_F_GSO_FRAGLIST.
The selftest is a small sample so far: an earlier version of it failed
intermittently in about 3 of 25 full runs (listener counters rose but
the receiver got nothing, which I think was its idle timer expiring
before the sender started, inferred and not confirmed). The final
version passed or failed as expected in all 22 runs, but those were in
one 4-vCPU KVM guest, so it may still be flaky elsewhere.
Known and not touched here: amt advertises NETIF_F_GSO_FRAGLIST, and
skb_copy_expand() refuses a SKB_GSO_FRAGLIST skb with a WARN_ON_ONCE().
That is independent of this series, I have not reproduced it, and if it
is real it would be a separate fix for the net tree.
Assisted-by: LLM
Omar Ramadan (2):
amt: mark relay data as a UDP tunnel packet before sending it
selftests: net: add an amt test for UDP_SEGMENT through the relay
drivers/net/amt.c | 11 +
tools/testing/selftests/net/.gitignore | 1 +
tools/testing/selftests/net/Makefile | 2 +
tools/testing/selftests/net/amt_gso.c | 473 +++++++++++++++++++++++++
tools/testing/selftests/net/amt_gso.sh | 269 ++++++++++++++
5 files changed, 756 insertions(+)
create mode 100644 tools/testing/selftests/net/amt_gso.c
create mode 100755 tools/testing/selftests/net/amt_gso.sh
--
2.43.0
next reply other threads:[~2026-10-01 17:10 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-01 17:10 Omar Ramadan [this message]
2026-10-01 17:10 ` [PATCH net-next 1/2] amt: mark relay data as a UDP tunnel packet before sending it Omar Ramadan
2026-10-01 17:33 ` Eric Dumazet
2026-10-01 18:26 ` Omar Ramadan
2026-10-01 17:10 ` [PATCH net-next 2/2] selftests: net: add an amt test for UDP_SEGMENT through the relay Omar Ramadan
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=20261001171016.88208-1-omar@blockcast.net \
--to=omar@blockcast.net \
--cc=andrew+netdev@lunn.ch \
--cc=ap420073@gmail.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--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=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
all inboxes | Powered by JetHome®