Thread (9 messages) flat view 9 messages, 5 authors, 2018-12-05

Re: [Patch net v3] mlx5: force CHECKSUM_NONE for short ethernet frames

From: Saeed Mahameed <hidden>
Date: 2018-12-04 19:18:01

On Mon, Dec 3, 2018 at 11:52 PM Eric Dumazet [off-list ref] wrote:
On Mon, Dec 3, 2018 at 11:30 PM Cong Wang [off-list ref] wrote:
quoted
On Mon, Dec 3, 2018 at 11:08 PM Eric Dumazet [off-list ref] wrote:
quoted
The hardware has probably validated the L3 & L4 checksum just fine.

Note that if ip_summed is CHECKSUM_UNNECESSARY, the padding bytes (if any)
have no impact on the csum that has been verified by the NIC.

Why? Why does the hardware validates L3/L4 checksum when it
supplies a full-packet checksum? What's its point here?
The point is that the driver author can decide what is best.

For native IP+TCP or IP+UDP, the NIC has the ability to fully
understand the packet and fully validate the checksum.
Also for Native IP4 and IP6 plain L3 packets.
The Hardware validates the csum when it can, and always provides
checksum complete for all packets.
One of the reason to validate is that sometimes we want to skip
checksum complete, but still leverage the hw validation,
like in your patch :), or LRO case, or many other cases in other
kernels/OSes/drivers.

So i agree with Eric, let's jump to checksum_unnecessary for short packets.
quoted
If it really validates L3/L4 checksum, then a full-packet checksum
is not needed.
Yes, this is exactly what CHECKSUM_UNNECESSARY means.
linux stack does not have to perform the check another time.

For example, no call to csum_partial() is needed, even for IPv6+TCP or IPv6+UDP
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help