From: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
To: Wang Zhan <wang.zhan@smartx.com>, netdev@vger.kernel.org
Cc: davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
pabeni@redhat.com, horms@kernel.org, keyong.sun@smartx.com,
Willem de Bruijn <willemdebruijn.kernel@gmail.com>,
Jason Wang <jasowangio@gmail.com>,
Andrew Lunn <andrew+netdev@lunn.ch>,
Aaron Conole <aconole@redhat.com>,
Eelco Chaudron <echaudro@redhat.com>,
Ilya Maximets <i.maximets@ovn.org>,
dev@openvswitch.org, Daniel Borkmann <daniel@iogearbox.net>,
Neal Cardwell <ncardwell@google.com>,
Kuniyuki Iwashima <kuniyu@google.com>,
Alice Mikityanska <alice@isovalent.com>,
David Laight <david.laight.linux@gmail.com>,
Wang Zhan <wang.zhan@smartx.com>
Subject: Re: [PATCH net-next v3 5/5] net: net_test: add tests for bounded GSO segmentation
Date: Mon, 28 Sep 2026 19:59:54 -0400 [thread overview]
Message-ID: <willemdebruijn.kernel.3638f2d1c29b1@gmail.com> (raw)
In-Reply-To: <20260928044102.1004310-6-wang.zhan@smartx.com>
Wang Zhan wrote:
> The GSO engine can now be asked to bound the number of MSS segments which
> go into each output skb. Add KUnit coverage for it.
>
> The parameterized GSO test gains a max_segs input and three cases: two
> bounds which cut the input into two and three output skbs, and a bound of
> one MSS, which must leave the ungrouped output of the unbounded path
> alone. It drives skb_segment() directly, because the synthetic protocol
> it uses has no gso_segment callback, and stores the bound in the GSO
> control block itself.
>
> The TCP test drives __skb_gso_segment() with a bound of two MSS and checks
> that every output skb stays GSO, keeps its gso_size, and stays within the
> bound. The length test runs a 200 KiB TCP skb through
> validate_xmit_skb_list(), the caller which sets the bound, and checks that
> the length declared by every output matches the L3 length of that output.
> The limit test checks that the GSO size limit which netif_skb_features()
> applies follows the packet's L3 protocol, for an IPv4 and an IPv6 skb,
> also with the tag inside the frame.
>
> Assisted-by: LLM
> Signed-off-by: Wang Zhan <wang.zhan@smartx.com>
>
> ---
> v3:
> - add cases for the length a bounded output declares and for a bound of one
> MSS, which must leave the output ungrouped
> - cover the IPv4 half of the limit test, checking the protocol's own bit
> - skip the TCP cases without CONFIG_INET and bound the expected index in
> the parameterized loop
> - free the skb and the device on the failure paths
> - reserve headroom so the VLAN step needs no atomic allocation
> - drop NETIF_F_TSO: the transmit path passes the features without it
> v2: https://lore.kernel.org/20260918084651.3022878-5-wang.zhan@smartx.com/
> v1: https://lore.kernel.org/20260917063854.2011613-5-wang.zhan@smartx.com/
> ---
> net/core/net_test.c | 347 ++++++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 347 insertions(+)
>
> diff --git a/net/core/net_test.c b/net/core/net_test.c
> index 9c3a590865d26..a4f61398a90ab 100644
> --- a/net/core/net_test.c
> +++ b/net/core/net_test.c
> @@ -4,7 +4,14 @@
>
> /* GSO */
>
> +#include <linux/if_ether.h>
> +#include <linux/if_vlan.h>
> +#include <linux/ip.h>
> +#include <linux/ipv6.h>
> +#include <linux/netdevice.h>
> #include <linux/skbuff.h>
> +#include <linux/tcp.h>
> +#include <net/gso.h>
>
> static const char hdr[] = "abcdefgh";
> #define GSO_TEST_SIZE 1000
> @@ -34,6 +41,9 @@ enum gso_test_nr {
> GSO_TEST_FRAG_LIST_PURE,
> GSO_TEST_FRAG_LIST_NON_UNIFORM,
> GSO_TEST_GSO_BY_FRAGS,
> + GSO_TEST_BOUNDED,
> + GSO_TEST_BOUNDED_MULTI,
> + GSO_TEST_BOUNDED_ONE_MSS,
nit: bound is not a helpful name for this feature.
The default segments to a stream of skbs of MSS 1, so segmenting to
a stream of skbs larger MSS to me is not bounding. Quite the opposite.
Not a comment only about this test patch.
Perhaps partial or re-segmentation better captures it.
> + {
> + /*
> + * One MSS per skb is what the unbounded path produces, so a
> + * bound of a single segment must not change the output.
> + */
so setting max_segs = 0 is equivalent to setting max_segs = 1.
next prev parent reply other threads:[~2026-09-28 23:59 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-28 4:40 [PATCH net-next v3 0/5] net: resegment oversized TCP GSO skbs Wang Zhan
2026-09-28 4:40 ` [PATCH net-next v3 1/5] net: core: use the packet's L3 protocol for the GSO size limit Wang Zhan
2026-09-28 23:36 ` Willem de Bruijn
2026-09-29 3:44 ` Wang Zhan
2026-09-29 4:01 ` Wang Zhan
2026-09-29 14:59 ` Willem de Bruijn
2026-09-28 4:40 ` [PATCH net-next v3 2/5] net: core: factor out the GSO device limit check Wang Zhan
2026-09-28 23:37 ` Willem de Bruijn
2026-09-29 7:47 ` Paolo Abeni
2026-09-28 4:41 ` [PATCH net-next v3 3/5] net: gso: support bounded TCP segmentation Wang Zhan
2026-09-28 23:39 ` Willem de Bruijn
2026-09-30 4:41 ` netdev-bot+sashiko
2026-09-28 4:41 ` [PATCH net-next v3 4/5] net: core: resegment oversized TCP GSO skbs Wang Zhan
2026-09-28 23:47 ` Willem de Bruijn
2026-09-29 10:25 ` Wang Zhan
2026-09-29 15:00 ` Willem de Bruijn
2026-09-30 4:41 ` netdev-bot+sashiko
2026-09-28 4:41 ` [PATCH net-next v3 5/5] net: net_test: add tests for bounded GSO segmentation Wang Zhan
2026-09-28 23:59 ` Willem de Bruijn [this message]
2026-09-29 10:30 ` Wang Zhan
2026-09-29 15:01 ` Willem de Bruijn
2026-09-30 4:41 ` netdev-bot+sashiko
2026-09-28 4:45 ` [PATCH net-next v3 0/5] net: resegment oversized TCP GSO skbs netdev-bot+sinfo
2026-09-28 5:49 ` Wang Zhan
2026-09-28 23:34 ` Willem de Bruijn
2026-09-29 7:27 ` Paolo Abeni
2026-09-29 11:50 ` Wang Zhan
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=willemdebruijn.kernel.3638f2d1c29b1@gmail.com \
--to=willemdebruijn.kernel@gmail.com \
--cc=aconole@redhat.com \
--cc=alice@isovalent.com \
--cc=andrew+netdev@lunn.ch \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=david.laight.linux@gmail.com \
--cc=dev@openvswitch.org \
--cc=echaudro@redhat.com \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=i.maximets@ovn.org \
--cc=jasowangio@gmail.com \
--cc=keyong.sun@smartx.com \
--cc=kuba@kernel.org \
--cc=kuniyu@google.com \
--cc=ncardwell@google.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=wang.zhan@smartx.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