On Mon, Nov 23, 2026 at 12:35 PM Tianyi Gao <[email protected]> wrote: > > On Mon, 2026-11-23 at 10:49 -0800, Alexander H Duyck wrote: > > I'm not sure this is the best fix for this. If we are needing all NICs > > that support CHECKSUM_COMPLETE *and* XDP to report CHECKSUM_NONE in the > > event of a frame being modified by XDP it really feels like we should > > probably look at moving this further up the stack. > > Thanks for the review, Alex. > > IMHO we should first make sure XDP programs do not cause "hw csum > failure" in current kernels. Whatever an XDP program does, it should > not be able to trigger a hw csum failure. It's not an uncommon use > case, e.g., Katran from Meta [3] and Cloudflare's load balancer. And > existing selftests already do it (test_xdp_native_adjst_head_* and > test_xdp_native_adjst_tail_* in > tools/testing/selftests/drivers/net/xdp.py).
That is exactly my point though. What we have is a divergence between a number of the existing drivers in how they handle these things. As a result the behavior is currently different depending on which NIC is in use. For example, one recent one I saw was an issue on the Tx side where an outgoing XDP program was modifying the frame and actually not updating the pseudoheader checksum. As a result it was breaking Tx checksum offloads for NICs that were using the HW_CSUM that used that checksum header. We could have fixed it by forcing all the drivers to recalculate the pseudo-header checksum, but instead we pushed back on the program that was making that change. > > Also even if we go the multiple driver fix route I wonder if we > > shouldn't look at adding a new XDP return type to indicate that we are > > passing a modified frame > > IMHO that is for net-next. There we can add optimizations, such as a > way to keep CHECKSUM_COMPLETE for programs that do not change the > frame, potentially after [1] or [2] is accepted. The point is you are fixing things for your use case, but anybody who is using the CHECKSUM_COMPLETE to compute the checksum on the frames and using XDP without changing the frames will see this as a significant performance regression.
