net: mvpp2: Extract the correct ethtype from the skb for tx csum offload
authorMaxime Chevallier <maxime.chevallier@bootlin.com>
Fri, 5 Oct 2018 07:04:40 +0000 (09:04 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 18 Oct 2018 07:16:18 +0000 (09:16 +0200)
commitd9bf6699aee863044cbb8c2b5d2de5e1db4fd7d8
tree38d24519f9446d88901adf93ea0625297e9b6a64
parent19c5e73c745cac1ff3c54526335f16c515a1e3a7
net: mvpp2: Extract the correct ethtype from the skb for tx csum offload

[ Upstream commit 35f3625c21852ad839f20c91c7d81c4c1101e207 ]

When offloading the L3 and L4 csum computation on TX, we need to extract
the l3_proto from the ethtype, independently of the presence of a vlan
tag.

The actual driver uses skb->protocol as-is, resulting in packets with
the wrong L4 checksum being sent when there's a vlan tag in the packet
header and checksum offloading is enabled.

This commit makes use of vlan_protocol_get() to get the correct ethtype
regardless the presence of a vlan tag.

Fixes: 3f518509dedc ("ethernet: Add new driver for Marvell Armada 375 network unit")
Signed-off-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/marvell/mvpp2.c