]> git.baikalelectronics.ru Git - kernel.git/commit
net/mlx5e: Rx, Fixup skb checksum for packets with tail padding
authorSaeed Mahameed <saeedm@mellanox.com>
Tue, 12 Mar 2019 07:24:52 +0000 (00:24 -0700)
committerSaeed Mahameed <saeedm@mellanox.com>
Tue, 9 Apr 2019 19:33:50 +0000 (12:33 -0700)
commit842dcbf01ef3688ccb3da548612999b8e3cbb92b
tree95648030d96c8e9a4dc0c47152dbe8b3b3381853
parent511c4282a24727d86eab0e40d9f7ce46e2e5fc25
net/mlx5e: Rx, Fixup skb checksum for packets with tail padding

When an ethernet frame with ip payload is padded, the padding octets are
not covered by the hardware checksum.

Prior to the cited commit, skb checksum was forced to be CHECKSUM_NONE
when padding is detected. After it, the kernel will try to trim the
padding bytes and subtract their checksum from skb->csum.

In this patch we fixup skb->csum for any ip packet with tail padding of
any size, if any padding found.
FCS case is just one special case of this general purpose patch, hence,
it is removed.

Fixes: e63754b567b2 ("net: pskb_trim_rcsum() and CHECKSUM_COMPLETE are friends"),
Cc: Eric Dumazet <edumazet@google.com>
Reviewed-by: Tariq Toukan <tariqt@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
drivers/net/ethernet/mellanox/mlx5/core/en_rx.c
drivers/net/ethernet/mellanox/mlx5/core/en_stats.c
drivers/net/ethernet/mellanox/mlx5/core/en_stats.h