From: Jakub Kicinski <kuba@kernel.org>
To: Chris J Arges <carges@cloudflare.com>
Cc: michael.chan@broadcom.com, pavan.chebbi@broadcom.com,
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>,
Simon Horman <horms@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>,
kernel-team@cloudflare.com, linux-kernel@vger.kernel.org,
netdev@vger.kernel.org, linux-kselftest@vger.kernel.org,
bpf@vger.kernel.org
Subject: Re: [PATCH net-next 4/4] selftests: drv-net: xdp: Add rss_hash metadata tests
Date: Fri, 27 Feb 2026 17:14:01 -0800 [thread overview]
Message-ID: <20260227171401.14389c0f@kernel.org> (raw)
In-Reply-To: <4cf6b0ddf92fa8b9bc2107a20be08ea0a232e4ca.1772211065.git.carges@cloudflare.com>
On Fri, 27 Feb 2026 11:40:20 -0600 Chris J Arges wrote:
> This test loads xdp_metadata.bpf which calls bpf_xdp_metadata_rx_hash() on
> incoming packets. The metadata from that packet is then sent to a BPF
> map for validation. It borrows structure from xdp.py, reusing common
> functions.
>
> The test checks the device's xdp-rx-metadata-features via netlink
> before running and skips on devices that do not advertise hash support.
> This allows the tests to pass, but one can override the device and test on
> HW or veth devices.
>
> The test is fairly simple and just verifies that a TCP or UDP packet can be
> identified as an L4 flow. This minimal test also passes if run on a veth
> device.
Thanks for adding the test! The series doesn't seem to apply, I think
you'll need to rebase on latest net-next and repost.
> diff --git a/tools/testing/selftests/drivers/net/Makefile b/tools/testing/selftests/drivers/net/Makefile
> index 8154d6d429d3..6f9708e8d05a 100644
> --- a/tools/testing/selftests/drivers/net/Makefile
> +++ b/tools/testing/selftests/drivers/net/Makefile
the drivers/net tests are expected to run against netdevsim.
You'll need to implement the xmo in netdevsim.. Or does it
already support them given it uses xdp_generic under the hood?
Alternatively you can move the test under hw/ and not bother.
> +# BPF map keys matching the enums in xdp_metadata.bpf.c
> +_SETUP_KEY_PORT = 1
> +
> +_RSS_KEY_HASH = 0
> +_RSS_KEY_TYPE = 1
> +_RSS_KEY_PKT_CNT = 2
> +_RSS_KEY_ERR_CNT = 3
Does pylint complain about those ? We try to keep pylint --disable=R
clean for new tests.
> + ksft_ge(pkt_cnt, 1, "should have received at least one packet")
> + ksft_pr(f" RSS hash error count: {err_cnt}")
Does it randomly report non-zero?
I'm wondering why not ksft_eq(err_cnt, 0, comment='RSS hash error count')
> + ksft_ne(hash_val, 0,
> + f"RSS hash should be non-zero for {proto.upper()} traffic")
> + ksft_pr(f" RSS hash: {hash_val:#010x}")
> +
> + ksft_pr(f" RSS hash type: {hash_type:#06x}")
> + XDP_RSS_L4 = 0x8 # BIT(3) from enum xdp_rss_hash_type
> + ksft_ne(hash_type & XDP_RSS_L4, 0,
> + f"RSS hash type should include L4 for {proto.upper()} traffic")
> +
> +
> +def main():
add:
""" Ksft boiler plate main """
to silence pylint?
prev parent reply other threads:[~2026-02-28 1:14 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-27 17:40 [PATCH net-next 0/4] bnxt_en: add XDP RSS hash metadata support Chris J Arges
2026-02-27 17:40 ` [PATCH net-next 1/4] bnxt_en: use bnxt_xdp_buff for xdp context Chris J Arges
2026-02-27 17:40 ` [PATCH net-next 2/4] bnxt_en: Implement XDP RSS hash metadata extraction Chris J Arges
2026-02-27 19:04 ` Joe Damato
2026-02-27 17:40 ` [PATCH net-next 3/4] selftests: net: move common xdp.py functions into lib Chris J Arges
2026-02-27 19:10 ` Joe Damato
2026-02-27 17:40 ` [PATCH net-next 4/4] selftests: drv-net: xdp: Add rss_hash metadata tests Chris J Arges
2026-02-28 1:14 ` 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=20260227171401.14389c0f@kernel.org \
--to=kuba@kernel.org \
--cc=andrew+netdev@lunn.ch \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=carges@cloudflare.com \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=hawk@kernel.org \
--cc=horms@kernel.org \
--cc=john.fastabend@gmail.com \
--cc=kernel-team@cloudflare.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=michael.chan@broadcom.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=pavan.chebbi@broadcom.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.