From: Jakub Kicinski <kuba@kernel.org>
To: Leon Hwang <leon.hwang@linux.dev>
Cc: Leon Hwang <leon.huangfu@shopee.com>,
netdev@vger.kernel.org, Andrew Lunn <andrew+netdev@lunn.ch>,
"David S . Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Paolo Abeni <pabeni@redhat.com>, Shuah Khan <shuah@kernel.org>,
Alexei Starovoitov <ast@kernel.org>,
Daniel Borkmann <daniel@iogearbox.net>,
Jesper Dangaard Brouer <hawk@kernel.org>,
John Fastabend <john.fastabend@gmail.com>,
Stanislav Fomichev <sdf@fomichev.me>,
linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org,
bpf@vger.kernel.org
Subject: Re: [PATCH net-next] selftests/net: Add two xdp tests to xdp.py
Date: Thu, 2 Apr 2026 07:35:20 -0700 [thread overview]
Message-ID: <20260402073520.697dde02@kernel.org> (raw)
In-Reply-To: <6c1d6987-ca73-40de-adab-bc6f9fce67f6@linux.dev>
On Thu, 2 Apr 2026 11:22:15 +0800 Leon Hwang wrote:
> >> +def test_xdp_native_update_mb_to_sb(cfg):
> >> + obj = cfg.net_lib_dir / "xdp_dummy.bpf.o"
> >> +
> >> + _set_jumbo_mtu(cfg, 9000)
> >> +
> >> + attach = _exec_cmd(cfg, obj, "xdp.frags")
> >> + if attach.ret != 0:
> >> + output = attach.stderr.strip() or attach.stdout.strip()
> >> + raise KsftSkipEx(output or "device does not support multi-buffer XDP")
> >> +
> >> + defer(ip, f"link set dev {cfg.ifname} xdpdrv off")
> >> +
> >> + update1 = _exec_cmd(cfg, obj, "xdp.frags", "-force")
> >> + if update1.ret != 0:
> >> + raise KsftFailEx("device fails to update multi-buffer XDP")
> >> +
> >> + update2 = _exec_cmd(cfg, obj, "xdp", "-force")
> >> + if update2.ret == 0:
> >> + raise KsftFailEx("device unexpectedly updates non-multi-buffer XDP")
>
> From sashiko's review [1]:
>
> On architectures with larger page sizes, such as 16KB or 64KB on ARM64 or
> PowerPC, a 9000-byte packet can fit entirely within a single buffer. In
> these environments, the driver might legally accept a non-frag XDP program,
> which would lead to a false positive failure here.
Yes the test is indeed not checking all the corner cases, it should be:
# set mtu to 9k
# try attach xdp
# if ret == 0:
# return // must be 64k pages or something
# try attach xdp.frags
# if ret != 0:
# raise SKIP // driver doesn't support multi-buf
# defer xdp off
# try --froce switch to xdp
# if ret == 0:
# raise FAIL // replace is missing a check
prev parent reply other threads:[~2026-04-02 14:35 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-01 5:27 [PATCH net-next] selftests/net: Add two xdp tests to xdp.py Leon Hwang
2026-04-01 20:20 ` Jakub Kicinski
2026-04-02 3:22 ` Leon Hwang
2026-04-02 14:35 ` Jakub Kicinski [this message]
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=20260402073520.697dde02@kernel.org \
--to=kuba@kernel.org \
--cc=andrew+netdev@lunn.ch \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=hawk@kernel.org \
--cc=john.fastabend@gmail.com \
--cc=leon.huangfu@shopee.com \
--cc=leon.hwang@linux.dev \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=sdf@fomichev.me \
--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