Thread (26 messages) flat view 26 messages, 5 authors, 2021-12-03

RE: [PATCH net-next 2/2] net: optimize skb_postpull_rcsum()

From: David Laight <hidden>
Date: 2021-12-02 21:00:04

To me it looks like the strange part is that the checksum of the removed
block (printed by me as "csum_partial(start, len, 0)" inside
skb_postpull_rcsum()) is the same as the skb->csum itself.
If you are removing all the bytes that made the original checksum
that will happen.
And that might be true for the packets you are building.

Try replacing both ~ with -.
So replace:
		skb->csum = ~csum_partial(start, len, ~skb->csum);
with:
		skb->csum = -csum_partial(start, len, -skb->csum);

That should geneate ~0u instead 0 (if I've got my maths right).

	David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help