On Mon, Nov 23, 2026 at 2:01 PM Tianyi Gao <[email protected]> wrote:
>
> On Mon, 2026-11-23, Alexander H Duyck wrote:
> > 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.
>
> Thank you for the explanation, Alex.
>
> On Tx the checksum is in the frame, so the program can fix it. On Rx
> the program can't touch skb->csum at all, so there is nothing to push
> back on.
>
> > 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.
>
> Without GCS, TCP and UDP still get CHECKSUM_UNNECESSARY, same as
> E810. GCS only came in v6.15, so this just puts E830 with XDP back
> to where it was.
>
> The cases I can think of that are truly impacted are IPv6 with
> extension headers, and UDP tunnels that the NIC does not parse and
> that have a zero outer checksum. These fall back to software
> checksum.
>
> And programs that do change the frame are worse off today. Every
> packet gets summed again in software, plus the "hw csum failure".
>
> I don't see a fix that meets all of these:
>
> 1. It is small enough and can be backported to stable.
> 2. It fixes the problem fully. We could drop CHECKSUM_COMPLETE only
>    when the program moved data or data_end, but some in-place
>    writes, e.g. NAT or the IPv6 hop limit, would still trigger
>    "hw csum failure". IMO that brings more problems.
> 3. It keeps CHECKSUM_COMPLETE for programs that do not change the
>    frame. But that looks like a bigger change, which doesn't fit
>    net.
>
> If you have one, I am happy to take it. Otherwise, as I understand
> it, the choice is between:
>
> 1. A performance regression for some programs, but no "hw csum
>    failure".
> 2. No regression for those programs, but "hw csum failure" stays
>    for programs that change the frame.
>
> I would like to know how the community normally decides between
> these.

The thing is your fix isn't really complete. As I said it is primarily
just addressing your use case and sweeping follow-on issues under the
rug. In the mlx5e case they were disabling the feature via the private
control flag if it was enabled. In the case of your change you are
just disabling it without exposing that it is disabled.

>From what I can tell you are just bypassing the checksum complete
logic, but you don't exit out of the function as a result. What
effects is that having on frames that would have been normally
checksum complete? Specifically, is it being treated as though the
frame is unrecognized, or is it falling through into the
CHECKSUM_UNNECESSARY path with all the indications that a tunnel was
still there even though you stripped the header?

The issue is that the driver is making a number of assumptions about
what is there based on what the hardware parsed for headers and such.
With the headers being stripped and/or replaced those aren't correct
anymore. That is why we should probably be looking at dropping more of
the existing logic or forcing a rescan of the packet once the headers
are replaced to update the descriptor data for the skb configuration.

Reply via email to