]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit6fe5a3cdc99d7e1b5819dda587b9f894fa7d808c
tree3b24901155a14d4419325a437d2db326659797ec
parentae0945d7fbe5a6a5e767169d0c9ca622784b3c38
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: 29aa4f99c31a ("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