]> git.baikalelectronics.ru Git - kernel.git/commit
net: dsa: microchip: lan937x: fix maximum frame length check
authorRakesh Sankaranarayanan <rakesh.sankaranarayanan@microchip.com>
Mon, 12 Sep 2022 05:12:28 +0000 (10:42 +0530)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 20 Sep 2022 10:01:51 +0000 (12:01 +0200)
commit7cba044cbd721265e4b7a1d568047a817c8a2b1d
treefad079facf4f0f74010ed437321d4a80bec8bbbf
parent880bd99d279c90702f1fcd0af6b6841d02b3280d
net: dsa: microchip: lan937x: fix maximum frame length check

Maximum frame length check is enabled in lan937x switch on POR, But it
is found to be disabled on driver during port setup operation. Due to
this, packets are not dropped when transmitted with greater than configured
value. For testing, setup made for lan1->lan2 transmission and configured
lan1 interface with a frame length (less than 1500 as mentioned in
documentation) and transmitted packets with greater than configured value.
Expected no packets at lan2 end, but packets observed at lan2.

Based on the documentation, packets should get discarded if the actual
packet length doesn't match the frame length configured. Frame length check
should be disabled only for cascaded ports due to tailtags.

This feature was disabled on ksz9477 series due to ptp issue, which is
not in lan937x series. But since lan937x took ksz9477 as base, frame
length check disabled here as well. Patch added to remove this portion
from port setup so that maximum frame length check will be active for
normal ports.

Fixes: a19cfad9a414 ("net: dsa: microchip: add DSA support for microchip LAN937x")
Signed-off-by: Rakesh Sankaranarayanan <rakesh.sankaranarayanan@microchip.com>
Link: https://lore.kernel.org/r/20220912051228.1306074-1-rakesh.sankaranarayanan@microchip.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/dsa/microchip/lan937x_main.c