Re: [PATCH net v2 1/2] xsk: defer software checksum until the skb is complete
From: Rongzheng Wang
Date: Sat Oct 24 2026 - 23:44:12 EST
Hi Jason,
Sorry for the noise. I posted v2 too quickly and incorrectly threaded it
under the v1 patch. I should have waited and replied to your review here
first. I will hold off on any further revision until this discussion settles.
You are right that I did not answer your questions directly. The cover letter
only summarizes the drop behavior:
> On a checksum failure the packet is now dropped after the descriptors have
> been consumed. Metadata validation makes this path unreachable in the
> current copy-mode implementation; keeping the defensive drop avoids a
> retry path for an skb that is no longer complete.
Let me expand on the two points you asked about.
Drop vs retry: in v2 the checksum is calculated after xskq_cons_release().
At that point the descriptors for the completed packet have already been
consumed, so returning an error and retrying the same skb is not safe. Drop
is intentional for this failure path.
skb_checksum_help() error cases: based on the current XDP_COPY path, I do not
see a reachable error. The skb is not GSO, the fragments are readable kernel
pages, the skb is not cloned or shared, and the metadata validation has
already checked the checksum range. If you think I missed an error case,
please point it out; otherwise I would keep the defensive drop.
I also applied your literal-else and unlikely suggestions, and split/reused
the selftest as 2/2.
Thanks,
Rongzheng