net/mlx5e: Fix TCP checksum in LRO buffers
authorGal Pressman <galp@mellanox.com>
Wed, 20 Dec 2017 06:48:24 +0000 (08:48 +0200)
committerSaeed Mahameed <saeedm@mellanox.com>
Tue, 20 Feb 2018 20:52:54 +0000 (12:52 -0800)
commit8babd44d2079079f9d5a4aca7005aed80236efe0
tree3b24901155a14d4419325a437d2db326659797ec
parent7928b2cbe55b2a410a0f5c1f154610059c57b1b2
net/mlx5e: Fix TCP checksum in LRO buffers

When receiving an LRO packet, the checksum field is set by the hardware
to the checksum of the first coalesced packet. Obviously, this checksum
is not valid for the merged LRO packet and should be fixed.  We can use
the CQE checksum which covers the checksum of the entire merged packet
TCP payload to help us calculate the checksum incrementally.

Tested by sending IPv4/6 traffic with LRO enabled, RX checksum disabled
and watching nstat checksum error counters (in addition to the obvious
bandwidth drop caused by checksum errors).

This bug is usually "hidden" since LRO packets would go through the
CHECKSUM_UNNECESSARY flow which does not validate the packet checksum.

It's important to note that previous to this patch, LRO packets provided
with CHECKSUM_UNNECESSARY are indeed packets with a correct validated
checksum (even though the checksum inside the TCP header is incorrect),
since the hardware LRO aggregation is terminated upon receiving a packet
with bad checksum.

Fixes: e586b3b0baee ("net/mlx5: Ethernet Datapath files")
Signed-off-by: Gal Pressman <galp@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
drivers/net/ethernet/mellanox/mlx5/core/en_rx.c