]> git.baikalelectronics.ru Git - kernel.git/commit
net: dsa: hellcreek: Calculate checksums in tagger
authorKurt Kanzenbach <kurt@linutronix.de>
Fri, 15 Apr 2022 10:33:20 +0000 (12:33 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 27 Apr 2022 12:38:54 +0000 (14:38 +0200)
commitdef65cda5a806cb19632b672c874999958459010
treeb0f861cc89bfad6d45e7a15aca86e6ed44b75483
parent9ba0f2304763d7aad54e133b3734472962389d7d
net: dsa: hellcreek: Calculate checksums in tagger

[ Upstream commit a1bfc093a00c6e5f111483013f8d2519c7d66615 ]

In case the checksum calculation is offloaded to the DSA master network
interface, it will include the switch trailing tag. As soon as the switch strips
that tag on egress, the calculated checksum is wrong.

Therefore, add the checksum calculation to the tagger (if required) before
adding the switch tag. This way, the hellcreek code works with all DSA master
interfaces regardless of their declared feature set.

Fixes: f042e73d9af9 ("net: dsa: Add tag handling for Hirschmann Hellcreek switches")
Signed-off-by: Kurt Kanzenbach <kurt@linutronix.de>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Link: https://lore.kernel.org/r/20220415103320.90657-1-kurt@linutronix.de
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/dsa/tag_hellcreek.c