]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
net/mlx5e: Rx, Fixup skb checksum for packets with tail padding
authorSaeed Mahameed <saeedm@mellanox.com>
Tue, 10 Dec 2019 23:24:00 +0000 (00:24 +0100)
committerMarcelo Henrique Cerri <marcelo.cerri@canonical.com>
Fri, 17 Jan 2020 17:23:08 +0000 (14:23 -0300)
commitd1a32cb24dfe39ead2299c7dc9d77424fb167c3c
tree6cc0af6396bba212516e3bfb062b0a47aa3d9c1a
parent73d0d548f6257f441e6228d4786d727b003b8479
net/mlx5e: Rx, Fixup skb checksum for packets with tail padding

BugLink: https://bugs.launchpad.net/bugs/1854842
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: 88078d98d1bb ("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>
(backported from commit 0aa1d18615c163f92935b806dcaff9157645233a)
[mruffell: file change mlx5e_update_sw_counters, context adjustments]
Signed-off-by: Matthew Ruffell <matthew.ruffell@canonical.com>
Acked-by: Connor Kuehl <connor.kuehl@canonical.com>
Acked-by: Marcelo Henrique Cerri <marcelo.cerri@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
drivers/net/ethernet/mellanox/mlx5/core/en_main.c
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