]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
net: dsa: tag_8021q: replace dsa_8021q_remove_header with __skb_vlan_pop
authorVladimir Oltean <vladimir.oltean@nxp.com>
Tue, 24 Mar 2020 09:45:34 +0000 (11:45 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 1 Apr 2020 08:59:38 +0000 (10:59 +0200)
commit2ab5f2913623c4aaa4bbb614cc3d3d2f8b762550
tree3e1538ef679ae901c4037b8c4ef2a6c89fbe6401
parent73593a06e7a81633d7aa0746bbe3a9774e0a5506
net: dsa: tag_8021q: replace dsa_8021q_remove_header with __skb_vlan_pop

[ Upstream commit e80f40cbe4dd51371818e967d40da8fe305db5e4 ]

Not only did this wheel did not need reinventing, but there is also
an issue with it: It doesn't remove the VLAN header in a way that
preserves the L2 payload checksum when that is being provided by the DSA
master hw.  It should recalculate checksum both for the push, before
removing the header, and for the pull afterwards. But the current
implementation is quite dizzying, with pulls followed immediately
afterwards by pushes, the memmove is done before the push, etc.  This
makes a DSA master with RX checksumming offload to print stack traces
with the infamous 'hw csum failure' message.

So remove the dsa_8021q_remove_header function and replace it with
something that actually works with inet checksumming.

Fixes: d461933638ae ("net: dsa: tag_8021q: Create helper function for removing VLAN header")
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
include/linux/dsa/8021q.h
net/dsa/tag_8021q.c
net/dsa/tag_sja1105.c