mirror of
https://github.com/torvalds/linux.git
synced 2026-11-20 13:03:48 +00:00
When XDP_UMEM_TX_SW_CSUM is used with multi-buffer TX, xsk_skb_metadata()
calls skb_checksum_help() while only the first descriptor has been added to
the skb. The checksum therefore covers just the first fragment, and
skb_checksum_help() sets ip_summed to CHECKSUM_NONE, so the remaining
fragments are never included in the checksum.
Move the software checksum calculation to the point where the last
descriptor has been added to the skb.
On a checksum failure the packet is now dropped instead of being returned
to the application for a retry. This path is not reachable with the
existing metadata validation, but the behavior change is intentional.
Fixes: 11614723af ("xsk: Add option to calculate TX checksum in SW")
Cc: [email protected]
Reviewed-by: Maciej Fijalkowski <[email protected]>
Acked-by: Stanislav Fomichev <[email protected]>
Reviewed-by: Jason Xing <[email protected]>
Signed-off-by: Rongzheng Wang <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Paolo Abeni <[email protected]>