On Mon, Nov 23, 2026 at 3:26 PM Tianyi Gao <[email protected]> wrote: > > Hi Alex, > > Thank you for being so responsive, and I really appreciate it. > > On Mon, 2026-11-23 at 14:42 -0800, Alexander Duyck wrote: > > 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. > > mlx5 does not change the private flag when a program is attached. It > sets MLX5E_RQ_STATE_NO_CSUM_COMPLETE on the RQ, and > rx_no_csum_complete keeps its value ("off" by default). > > > 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? > > Yes, the same path as E810, and mlx5 does the same with a program > attached. > > > 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. > > This was discussed in the thread of [1], including the decap problem > with csum_level. The summary there was that reporting > CHECKSUM_COMPLETE on the XDP-to-skb path is unsafe, and that the > safest option for now is CHECKSUM_UNNECESSARY only [3]. The decap > case with CHECKSUM_UNNECESSARY was left open as a known problem. > > I am also working on the long-term design in [2], though there is > still a long way to go. Please take a look if you are interested. > > For this patch, my aim is simple: stop the "hw csum failure", and > make E830 with XDP report RX checksums the same way as E810, i.e. as > before GCS was added. > > [3] https://lore.kernel.org/all/[email protected]/ > > Thanks, > Tianyi
Any reason why you couldn't just strip the GCS enable flags from the rings when you add the XDP program in ndo_bpf instead of having to add a check for every packet if the XDP program is present? That would be closer to what they did for the Mellanox NIC and wouldn't be adding code to the hot path. Then it is just a matter of also adding an info message that you are disabling this in the log so if somebody does have to figure out a regression it should be more obvious. Thinking in terms of what the final fix for this might look like, currently the drivers are already starting to carry stuff for frags to determine if they support jumbo frames via frags or not. I suspect we will likely need to do something similar when the time comes indicating if the program can avoid corrupting a checksum or not when it is stripping headers. I am not super thrilled with the idea of this becoming standardized. In theory this would be much better if there was some way to pass the data out that the frame was mangled and what the checksum adjustment is to the total frame. As it stands we are probably going to be getting CHECKSUM_UNNECESSARY on everything even if we don't expect it. For example I don't know what will happen with an ICMP frame sent over this tunnel. I assume it is likely just discaring the CHECKSUM_UNECESSARY since it isn't used.
