mbox series

[v2,0/2] Fixes for KSZ DSA switch

Message ID 20210721215642.19866-1-LinoSanfilippo@gmx.de
Headers show
Series Fixes for KSZ DSA switch | expand

Message

Lino Sanfilippo July 21, 2021, 9:56 p.m. UTC
These patches fix issues I encountered while using a KSZ9897 as a DSA
switch with a broadcom GENET network device as the DSA master device.

PATCH 1 fixes an invalid access to an SKB in case it is scattered.
PATCH 2 fixes incorrect hardware checksum calculation caused by the DSA
tag.

Changes in v2:
- instead of linearizing the SKBs only for KSZ switches ensure linearized
  SKBs for all tail taggers by clearing the feature flags NETIF_F_HW_SG and
  NETIF_F_FRAGLIST (suggested by Vladimir Oltean)

The patches have been tested with a KSZ9897 and apply against net-next.

Lino Sanfilippo (2):
  net: dsa: ensure linearized SKBs in case of tail taggers
  net: dsa: tag_ksz: dont let the hardware process the layer 4 checksum

 net/dsa/slave.c   | 14 +++++++++-----
 net/dsa/tag_ksz.c |  9 +++++++++
 2 files changed, 18 insertions(+), 5 deletions(-)


base-commit: 54cb43199e14c1181ddcd4a3782f1f7eb56bdab8

Comments

Florian Fainelli July 22, 2021, 3:55 a.m. UTC | #1
On 7/21/2021 2:56 PM, Lino Sanfilippo wrote:
> 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>

-- 
Florian
patchwork-bot+netdevbpf@kernel.org July 22, 2021, 6:20 a.m. UTC | #2
Hello:

This series was applied to netdev/net.git (refs/heads/master):

On Wed, 21 Jul 2021 23:56:40 +0200 you wrote:
> These patches fix issues I encountered while using a KSZ9897 as a DSA

> switch with a broadcom GENET network device as the DSA master device.

> 

> PATCH 1 fixes an invalid access to an SKB in case it is scattered.

> PATCH 2 fixes incorrect hardware checksum calculation caused by the DSA

> tag.

> 

> [...]


Here is the summary with links:
  - [v2,1/2] net: dsa: ensure linearized SKBs in case of tail taggers
    https://git.kernel.org/netdev/net/c/21cf377a9c40
  - [v2,2/2] net: dsa: tag_ksz: dont let the hardware process the layer 4 checksum
    https://git.kernel.org/netdev/net/c/37120f23ac89

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html