net/mlx5e: When RXFCS is set, add FCS data into checksum calculation
authorEran Ben Elisha <eranbe@mellanox.com>
Tue, 1 May 2018 13:25:07 +0000 (16:25 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 11 Jun 2018 20:49:22 +0000 (22:49 +0200)
commit2b8b2b26c378398d003a8833fe9177af9247cfef
tree81c8c6d978a320862b90d15ed59cc666efa8b0cf
parent155cd575588bca1ef1dd77e37386a737f4c0153e
net/mlx5e: When RXFCS is set, add FCS data into checksum calculation

[ Upstream commit 902a545904c71d719ed144234d67df75f31db63b ]

When RXFCS feature is enabled, the HW do not strip the FCS data,
however it is not present in the checksum calculated by the HW.

Fix that by manually calculating the FCS checksum and adding it to the SKB
checksum field.

Add helper function to find the FCS data for all SKB forms (linear,
one fragment or more).

Fixes: 102722fc6832 ("net/mlx5e: Add support for RXFCS feature flag")
Signed-off-by: Eran Ben Elisha <eranbe@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/mellanox/mlx5/core/en_rx.c