Re: [RFC PATCH bpf-next v1 0/7] xdp: RX checksum metadata hint and checksum assertion over redirect
From: Lorenzo Bianconi <lorenzo@kernel.org>
Date: 2026-07-02 14:52:50
Also in:
bpf
Hi Lorenzo,
Hi Vladimir,
Sorry -- I blindly missed your earlier RX-checksum series before I posted mine, thanks Stanislav for the pointer.
No worries. My series is just adding a new kfunc to report the rx-csum result to an ebpf program running on the NIC. It does not take into account the XDP_REDIRECT use-case. This is orthogonal and we can work on it later.
To answer your question: yes, I'm happy to take on the driver selftest Jakub asked for.
Cool, thx :)
As for my own series, the read side clearly overlaps yours and you own it, so I'll drop my bpf_xdp_metadata_rx_csum() hint and its driver bits. What's left that is genuinely separate is the "assertion" half -- a non-dev-bound bpf_xdp_assert_rx_csum() that preserves the HW verdict across a cpumap/redirect: it sets a flag on the xdp_buff that rides into the xdp_frame and becomes skb->ip_summed = CHECKSUM_UNNECESSARY in __xdp_build_skb_from_frame(). Should I resend that as a small standalone series (v2, assert-only)? It also looks like a PoC that you and Jakub discussed on v3 [1].
I think we should address the 'CHECKSUM_COMPLETE' use case for it, let's work on the problem later, even Jesper is interested in it ;)
A few things I'd like to confirm before writing the test: 1. API for v4. In the v3 discussion you agreed to rework the API to report both COMPLETE and UNNECESSARY (+ csum_level), per Jakub. Do you plan to send that in v4, or should the driver selftest target the current v3 signature (enum xdp_checksum + cksum_meta)? I'd rather write the test against the API you intend to keep.
IIRC I addressed the request (the code is in [0]). What is missing is just the self-test.
2. Documented behavior. The selftest is meant to "check the documented expectation", so which rule should it assert -- "a driver must never report CHECKSUM_COMPLETE while an XDP program is attached", or that the driver downgrades/repairs COMPLETE on the XDP_PASS path? I'll write the doc paragraph and the test to match whatever we settle on.
ack
3. Drivers. Your series adds veth and ice; I don't see mlx5e -- was that intentional (left to the driver maintainers)? I had an mlx5e implementation in my v1 and I'm happy to contribute it to your series if it's useful.
My series does not intend to address all the drivers :)
For the test itself I was thinking of extending tools/testing/selftests/drivers/net/hw/xdp_metadata.py, gated on the new "checksum" xdp-rx-metadata feature, with good-csum / bad-csum / modify + XDP_PASS cases. Does that match what you and Jakub had in mind?
That was my idea too. Regards, Lorenzo
[1] https://lore.kernel.org/bpf/20260217-bpf-xdp-meta-rxcksum-v3-0-30024c50ba71@kernel.org/ (local) Thanks, Vladimir
[0] https://github.com/LorenzoBianconi/net-next/commits/b4/bpf-xdp-meta-rxcksum/
Attachments
- signature.asc [application/pgp-signature] 228 bytes