]> git.baikalelectronics.ru Git - kernel.git/commit
net: dsa: tag_ksz: dont let the hardware process the layer 4 checksum
authorLino Sanfilippo <LinoSanfilippo@gmx.de>
Wed, 21 Jul 2021 21:56:42 +0000 (23:56 +0200)
committerDavid S. Miller <davem@davemloft.net>
Thu, 22 Jul 2021 06:14:49 +0000 (23:14 -0700)
commit93c3014d8b515ed707dc8aaa2f0538b524e64898
treebd298fea6a13fb1ab90d715038de3f3aa728247b
parentc10fb93fa5f3247f6ad6f9a16b10a12f827392d4
net: dsa: tag_ksz: dont let the hardware process the layer 4 checksum

If the checksum calculation is offloaded to the network device (e.g due to
NETIF_F_HW_CSUM inherited from the DSA master device), the calculated
layer 4 checksum is incorrect. This is since the DSA tag which is placed
after the layer 4 data is considered as being part of the daa and thus
errorneously included into the checksum calculation.
To avoid this, always calculate the layer 4 checksum in software.

Signed-off-by: Lino Sanfilippo <LinoSanfilippo@gmx.de>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/dsa/tag_ksz.c