From: Lorenzo Bianconi <lorenzo@kernel.org>
To: Donald Hunter <donald.hunter@gmail.com>,
Jakub Kicinski <kuba@kernel.org>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Paolo Abeni <pabeni@redhat.com>, 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>,
Andrew Lunn <andrew+netdev@lunn.ch>,
Tony Nguyen <anthony.l.nguyen@intel.com>,
Przemek Kitszel <przemyslaw.kitszel@intel.com>,
Alexander Lobakin <aleksander.lobakin@intel.com>,
Andrii Nakryiko <andrii@kernel.org>,
Martin KaFai Lau <martin.lau@linux.dev>,
Eduard Zingerman <eddyz87@gmail.com>, Song Liu <song@kernel.org>,
Yonghong Song <yonghong.song@linux.dev>,
KP Singh <kpsingh@kernel.org>, Hao Luo <haoluo@google.com>,
Jiri Olsa <jolsa@kernel.org>, Shuah Khan <shuah@kernel.org>,
Maciej Fijalkowski <maciej.fijalkowski@intel.com>
Cc: Jakub Sitnicki <jakub@cloudflare.com>,
netdev@vger.kernel.org, bpf@vger.kernel.org,
intel-wired-lan@lists.osuosl.org,
linux-kselftest@vger.kernel.org,
Lorenzo Bianconi <lorenzo@kernel.org>
Subject: [PATCH bpf-next 0/5] Add the the capability to load HW RX checsum in eBPF programs
Date: Tue, 10 Feb 2026 18:21:46 +0100 [thread overview]
Message-ID: <20260210-bpf-xdp-meta-rxcksum-v1-0-e5d55caa0541@kernel.org> (raw)
Introduce bpf_xdp_metadata_rx_checksum() kfunc in order to load the HW
RX cheksum results in the eBPF program binded to the NIC.
Implement xmo_rx_checksum callback for veth and ice drivers.
If the hardware detects a wrong/failed checksum, it will report
CHECKSUM_NONE in the packet metadata. Moreover, CHECKSUM_NONE will be
returned even if the NIC can't parse the packet (e.g. if it does not
support a specific protocol). A possible use case for
bpf_xdp_metadata_rx_checksum() would be to implement a XDP DDoS
application [1] combining the info from bpf_xdp_metadata_rx_checksum()
and bpf_xdp_metadata_rx_hash() kfuncs in order to filter packets with a
wrong/failed checksum.
[1] https://blog.cloudflare.com/unimog-cloudflares-edge-load-balancer/
---
Changes in v1:
- Rebase on top of bpf-next
- Test ice driver using xdp_hw_metadata tool available in the bpf
kernel selftest
- Improve cover letter with an use-case for
bpf_xdp_metadata_rx_checksum()
- Link to RFC v2: https://lore.kernel.org/r/20250925-bpf-xdp-meta-rxcksum-v2-0-6b3fe987ce91@kernel.org
Changes in RFC v2:
- Squash patch 1/6 and 2/6
- Introduce enum xdp_checksum definitions
- Rework ice support to reuse ice_rx_csum codebase
---
Lorenzo Bianconi (5):
netlink: specs: Add XDP RX checksum capability to XDP metadata specs
net: veth: Add xmo_rx_checksum callback to veth driver
net: ice: Add xmo_rx_checksum callback
selftests/bpf: Add selftest support for bpf_xdp_metadata_rx_checksum
selftests/bpf: Add bpf_xdp_metadata_rx_checksum support to xdp_hw_metadat prog
Documentation/netlink/specs/netdev.yaml | 5 +
drivers/net/ethernet/intel/ice/ice_txrx_lib.c | 114 +++++++++++++--------
drivers/net/veth.c | 20 ++++
include/net/xdp.h | 14 +++
include/uapi/linux/netdev.h | 3 +
net/core/xdp.c | 29 ++++++
tools/include/uapi/linux/netdev.h | 3 +
.../selftests/bpf/prog_tests/xdp_metadata.c | 7 ++
.../testing/selftests/bpf/progs/xdp_hw_metadata.c | 7 ++
tools/testing/selftests/bpf/progs/xdp_metadata.c | 1 +
tools/testing/selftests/bpf/xdp_hw_metadata.c | 28 +++++
tools/testing/selftests/bpf/xdp_metadata.h | 13 +++
12 files changed, 204 insertions(+), 40 deletions(-)
---
base-commit: db975debcb8c4cd367a78811bc1ba84c83f854bd
change-id: 20250925-bpf-xdp-meta-rxcksum-900685e2909d
Best regards,
--
Lorenzo Bianconi <lorenzo@kernel.org>
next reply other threads:[~2026-02-10 17:22 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-10 17:21 Lorenzo Bianconi [this message]
2026-02-10 17:21 ` [PATCH bpf-next 1/5] netlink: specs: Add XDP RX checksum capability to XDP metadata specs Lorenzo Bianconi
2026-02-10 17:54 ` bot+bpf-ci
2026-02-13 5:18 ` Stanislav Fomichev
2026-02-13 10:40 ` Lorenzo Bianconi
2026-02-10 17:21 ` [PATCH bpf-next 2/5] net: veth: Add xmo_rx_checksum callback to veth driver Lorenzo Bianconi
2026-02-10 17:54 ` bot+bpf-ci
2026-02-11 8:04 ` [Intel-wired-lan] " Loktionov, Aleksandr
2026-02-13 15:22 ` Lorenzo Bianconi
2026-02-10 17:21 ` [PATCH bpf-next 3/5] net: ice: Add xmo_rx_checksum callback Lorenzo Bianconi
2026-02-10 17:54 ` bot+bpf-ci
2026-02-11 6:07 ` [Intel-wired-lan] " kernel test robot
2026-02-10 17:21 ` [PATCH bpf-next 4/5] selftests/bpf: Add selftest support for bpf_xdp_metadata_rx_checksum Lorenzo Bianconi
2026-02-10 17:55 ` bot+bpf-ci
2026-02-11 8:05 ` [Intel-wired-lan] " Loktionov, Aleksandr
2026-02-10 17:21 ` [PATCH bpf-next 5/5] selftests/bpf: Add bpf_xdp_metadata_rx_checksum support to xdp_hw_metadat prog Lorenzo Bianconi
2026-02-10 17:54 ` bot+bpf-ci
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=20260210-bpf-xdp-meta-rxcksum-v1-0-e5d55caa0541@kernel.org \
--to=lorenzo@kernel.org \
--cc=aleksander.lobakin@intel.com \
--cc=andrew+netdev@lunn.ch \
--cc=andrii@kernel.org \
--cc=anthony.l.nguyen@intel.com \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=donald.hunter@gmail.com \
--cc=eddyz87@gmail.com \
--cc=edumazet@google.com \
--cc=haoluo@google.com \
--cc=hawk@kernel.org \
--cc=horms@kernel.org \
--cc=intel-wired-lan@lists.osuosl.org \
--cc=jakub@cloudflare.com \
--cc=john.fastabend@gmail.com \
--cc=jolsa@kernel.org \
--cc=kpsingh@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=maciej.fijalkowski@intel.com \
--cc=martin.lau@linux.dev \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=przemyslaw.kitszel@intel.com \
--cc=sdf@fomichev.me \
--cc=shuah@kernel.org \
--cc=song@kernel.org \
--cc=yonghong.song@linux.dev \
/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