Skip to contentSkip to conversation

net: dsa: lantiq_gswip: fix maximum frame length

PATCH Applied Jan Hoffmann 3 participants 3 messages Sep 1, 2021 – Sep 2, 2021

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: dsa: lantiq_gswip: fix maximum frame length

Currently, outgoing packets larger than 1496 bytes are dropped when tagged VLAN is used on a switch port.

Add the frame check sequence length to the value of the register GSWIP_MAC_FLEN to fix this. This matches the lantiq_ppa vendor driver, which uses a value consisting of 1518 bytes for the MAC frame, plus the lengths of special tag and VLAN tags.

Fixes 14fceff4771e ("net: dsa: Add Lantiq / Intel DSA driver for vrx200")
---
 drivers/net/dsa/lantiq_gswip.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/dsa/lantiq_gswip.c +2 -1
index e78026ef6d8c..64d6dfa83122 100644
@@ -843,7 +843,8 @@ static int gswip_setup(struct dsa_switch *ds)
 
 	gswip_switch_mask(priv, 0, GSWIP_MAC_CTRL_2_MLEN,
 			  GSWIP_MAC_CTRL_2p(cpu_port));
-	gswip_switch_w(priv, VLAN_ETH_FRAME_LEN + 8, GSWIP_MAC_FLEN);
+	gswip_switch_w(priv, VLAN_ETH_FRAME_LEN + 8 + ETH_FCS_LEN,
+		       GSWIP_MAC_FLEN);
 	gswip_switch_mask(priv, 0, GSWIP_BM_QUEUE_GCTRL_GL_MOD,
 			  GSWIP_BM_QUEUE_GCTRL);
 
Signature · 1 line
2.33.0
Acked-by on v1 1/1
#1 lore raw
Quoted 7 lines · Jan Hoffmann

Currently, outgoing packets larger than 1496 bytes are dropped when tagged VLAN is used on a switch port.

Add the frame check sequence length to the value of the register GSWIP_MAC_FLEN to fix this. This matches the lantiq_ppa vendor driver, which uses a value consisting of 1518 bytes for the MAC frame, plus the lengths of special tag and VLAN tags.

This field is the size of the Ethernet Frame which probably includes the FCS which your patch adds.

There is also a discussion in the OpenWrt github about the same topic: https://github.com/openwrt/openwrt/pull/4353

Quoted 3 lines
Fixes 14fceff4771e ("net: dsa: Add Lantiq / Intel DSA driver for vrx200")
Quoted 19 lines
---
  drivers/net/dsa/lantiq_gswip.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/dsa/lantiq_gswip.c +2 -1
index e78026ef6d8c..64d6dfa83122 100644
@@ -843,7 +843,8 @@ static int gswip_setup(struct dsa_switch *ds)
 
  	gswip_switch_mask(priv, 0, GSWIP_MAC_CTRL_2_MLEN,
  			  GSWIP_MAC_CTRL_2p(cpu_port));
-	gswip_switch_w(priv, VLAN_ETH_FRAME_LEN + 8, GSWIP_MAC_FLEN);
+	gswip_switch_w(priv, VLAN_ETH_FRAME_LEN + 8 + ETH_FCS_LEN,
+		       GSWIP_MAC_FLEN);
  	gswip_switch_mask(priv, 0, GSWIP_BM_QUEUE_GCTRL_GL_MOD,
  			  GSWIP_BM_QUEUE_GCTRL);
 
#2 lore raw
In reply to Jan Hoffmann
This patch was applied to netdev/net.git (refs/heads/master):

Hello:

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

Quoted 9 lines · On Wed, 1 Sep 2021 20:49:33 +0200 you wrote:

Currently, outgoing packets larger than 1496 bytes are dropped when tagged VLAN is used on a switch port.

Add the frame check sequence length to the value of the register GSWIP_MAC_FLEN to fix this. This matches the lantiq_ppa vendor driver, which uses a value consisting of 1518 bytes for the MAC frame, plus the lengths of special tag and VLAN tags.

[...]

Here is the summary with links:
- [net] net: dsa: lantiq_gswip: fix maximum frame length

    https://git.kernel.org/netdev/net/c/552799f8b3b0

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