mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH net v2] net: lan743x: permit VLAN-tagged packets up to configured MTU
@ 2026-05-29 21:03 David Thompson
  2026-06-01  3:33 ` Thangaraj.S
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: David Thompson @ 2026-05-29 21:03 UTC (permalink / raw)
  To: bryan.whitehead, UNGLinuxDriver, andrew+netdev, davem, edumazet,
	kuba, pabeni
  Cc: netdev, linux-kernel, David Thompson

VLAN-tagged interfaces on lan743x devices were previously unreachable via
SSH and failed to respond to large ping packets (e.g. "ping -s 1469" given
MTU=1500). In these scenarios, "ethtool -S" reports non-zero "RX Oversize
Frame Errors". According to Microchip AN2948, the MAC_RX FSE (VLAN field
size enforcement) bit determines whether frames with VLAN tags exceeding
the base MTU plus tag length are discarded.

The driver must set the MAC_RX.FSE bit before setting MAC_RX.RXEN to allow
VLAN-tagged frames up to the interface MTU, preventing them from being
treated as oversized. As a result, both the base and VLAN-tagged interfaces
can use the same MTU without receive errors.

Fixes: 23f0703c125b ("lan743x: Add main source files for new lan743x driver")
Signed-off-by: David Thompson <davthompson@nvidia.com>
---
v2:
- Added helper function, lan743x_mac_rx_enable_fse(), to set FSE bit properly
- Added explicit comment about use of distinct write cycle to set FSE bit
- Moved setting of FSE from lan743x_mac_open() to lan743x_mac_init(), allowing FSE
  bit to be set upon probe() path or suspend/resume path. This change fixes an
  issue raised by Sashiko
---
 drivers/net/ethernet/microchip/lan743x_main.c | 32 +++++++++++++++++++
 drivers/net/ethernet/microchip/lan743x_main.h |  1 +
 2 files changed, 33 insertions(+)

diff --git a/drivers/net/ethernet/microchip/lan743x_main.c b/drivers/net/ethernet/microchip/lan743x_main.c
index f3332417162e..ffac22883e49 100644
--- a/drivers/net/ethernet/microchip/lan743x_main.c
+++ b/drivers/net/ethernet/microchip/lan743x_main.c
@@ -1219,6 +1219,36 @@ static void lan743x_mac_set_address(struct lan743x_adapter *adapter,
 		   "MAC address set to %pM\n", addr);
 }
 
+static void lan743x_mac_rx_enable_fse(struct lan743x_adapter *adapter)
+{
+	u32 mac_rx;
+	bool rxen;
+
+	mac_rx = lan743x_csr_read(adapter, MAC_RX);
+	if (mac_rx & MAC_RX_FSE_)
+		return;
+
+	rxen = mac_rx & MAC_RX_RXEN_;
+	if (rxen) {
+		mac_rx &= ~MAC_RX_RXEN_;
+		lan743x_csr_write(adapter, MAC_RX, mac_rx);
+		lan743x_csr_wait_for_bit(adapter, MAC_RX, MAC_RX_RXD_,
+					 1, 1000, 20000, 100);
+	}
+
+	/* Per AN2948, hardware prevents modification of the FSE bit while the
+	 * MAC receiver is enabled (RXEN bit set). Use separate register write
+	 * to assert the FSE bit before enabling the RXEN bit in MAC_RX
+	 */
+	mac_rx |= MAC_RX_FSE_;
+	lan743x_csr_write(adapter, MAC_RX, mac_rx);
+
+	if (rxen) {
+		mac_rx |= MAC_RX_RXEN_;
+		lan743x_csr_write(adapter, MAC_RX, mac_rx);
+	}
+}
+
 static int lan743x_mac_init(struct lan743x_adapter *adapter)
 {
 	bool mac_address_valid = true;
@@ -1258,6 +1288,8 @@ static int lan743x_mac_init(struct lan743x_adapter *adapter)
 	lan743x_mac_set_address(adapter, adapter->mac_address);
 	eth_hw_addr_set(netdev, adapter->mac_address);
 
+	lan743x_mac_rx_enable_fse(adapter);
+
 	return 0;
 }
 
diff --git a/drivers/net/ethernet/microchip/lan743x_main.h b/drivers/net/ethernet/microchip/lan743x_main.h
index 160d94a7cee6..1573c8f9c993 100644
--- a/drivers/net/ethernet/microchip/lan743x_main.h
+++ b/drivers/net/ethernet/microchip/lan743x_main.h
@@ -182,6 +182,7 @@
 #define MAC_RX				(0x104)
 #define MAC_RX_MAX_SIZE_SHIFT_		(16)
 #define MAC_RX_MAX_SIZE_MASK_		(0x3FFF0000)
+#define MAC_RX_FSE_			BIT(2)
 #define MAC_RX_RXD_			BIT(1)
 #define MAC_RX_RXEN_			BIT(0)
 
-- 
2.43.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [PATCH net v2] net: lan743x: permit VLAN-tagged packets up to configured MTU
  2026-05-29 21:03 [PATCH net v2] net: lan743x: permit VLAN-tagged packets up to configured MTU David Thompson
@ 2026-06-01  3:33 ` Thangaraj.S
  2026-06-01  7:58 ` Nicolai Buchwitz
  2026-06-02 21:20 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 4+ messages in thread
From: Thangaraj.S @ 2026-06-01  3:33 UTC (permalink / raw)
  To: davthompson, Bryan.Whitehead, UNGLinuxDriver, andrew+netdev,
	davem, edumazet, kuba, pabeni
  Cc: netdev, linux-kernel



> -----Original Message-----
> From: David Thompson <davthompson@nvidia.com>
> Sent: Saturday, May 30, 2026 2:33 AM
> To: Bryan Whitehead - C21958 <Bryan.Whitehead@microchip.com>;
> UNGLinuxDriver <UNGLinuxDriver@microchip.com>;
> andrew+netdev@lunn.ch; davem@davemloft.net; edumazet@google.com;
> kuba@kernel.org; pabeni@redhat.com
> Cc: netdev@vger.kernel.org; linux-kernel@vger.kernel.org; David Thompson
> <davthompson@nvidia.com>
> Subject: [PATCH net v2] net: lan743x: permit VLAN-tagged packets up to
> configured MTU
> 
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the
> content is safe
> 
> VLAN-tagged interfaces on lan743x devices were previously unreachable via
> SSH and failed to respond to large ping packets (e.g. "ping -s 1469" given
> MTU=1500). In these scenarios, "ethtool -S" reports non-zero "RX Oversize
> Frame Errors". According to Microchip AN2948, the MAC_RX FSE (VLAN field
> size enforcement) bit determines whether frames with VLAN tags exceeding
> the base MTU plus tag length are discarded.
> 
> The driver must set the MAC_RX.FSE bit before setting MAC_RX.RXEN to
> allow VLAN-tagged frames up to the interface MTU, preventing them from
> being treated as oversized. As a result, both the base and VLAN-tagged
> interfaces can use the same MTU without receive errors.
> 
> Fixes: 23f0703c125b ("lan743x: Add main source files for new lan743x driver")
> Signed-off-by: David Thompson <davthompson@nvidia.com>

Reviewed-by: Thangaraj Samynathan <Thangaraj.s@microchip.com>
> ---
> v2:
> - Added helper function, lan743x_mac_rx_enable_fse(), to set FSE bit properly
> - Added explicit comment about use of distinct write cycle to set FSE bit
> - Moved setting of FSE from lan743x_mac_open() to lan743x_mac_init(),
> allowing FSE
>   bit to be set upon probe() path or suspend/resume path. This change fixes an
>   issue raised by Sashiko
> ---
>  drivers/net/ethernet/microchip/lan743x_main.c | 32 +++++++++++++++++++
> drivers/net/ethernet/microchip/lan743x_main.h |  1 +
>  2 files changed, 33 insertions(+)
> 
> diff --git a/drivers/net/ethernet/microchip/lan743x_main.c
> b/drivers/net/ethernet/microchip/lan743x_main.c
> index f3332417162e..ffac22883e49 100644
> --- a/drivers/net/ethernet/microchip/lan743x_main.c
> +++ b/drivers/net/ethernet/microchip/lan743x_main.c
> @@ -1219,6 +1219,36 @@ static void lan743x_mac_set_address(struct
> lan743x_adapter *adapter,
>                    "MAC address set to %pM\n", addr);  }
> 
> +static void lan743x_mac_rx_enable_fse(struct lan743x_adapter *adapter)
> +{
> +       u32 mac_rx;
> +       bool rxen;
> +
> +       mac_rx = lan743x_csr_read(adapter, MAC_RX);
> +       if (mac_rx & MAC_RX_FSE_)
> +               return;
> +
> +       rxen = mac_rx & MAC_RX_RXEN_;
> +       if (rxen) {
> +               mac_rx &= ~MAC_RX_RXEN_;
> +               lan743x_csr_write(adapter, MAC_RX, mac_rx);
> +               lan743x_csr_wait_for_bit(adapter, MAC_RX, MAC_RX_RXD_,
> +                                        1, 1000, 20000, 100);
> +       }
> +
> +       /* Per AN2948, hardware prevents modification of the FSE bit while the
> +        * MAC receiver is enabled (RXEN bit set). Use separate register write
> +        * to assert the FSE bit before enabling the RXEN bit in MAC_RX
> +        */
> +       mac_rx |= MAC_RX_FSE_;
> +       lan743x_csr_write(adapter, MAC_RX, mac_rx);
> +
> +       if (rxen) {
> +               mac_rx |= MAC_RX_RXEN_;
> +               lan743x_csr_write(adapter, MAC_RX, mac_rx);
> +       }
> +}
> +
>  static int lan743x_mac_init(struct lan743x_adapter *adapter)  {
>         bool mac_address_valid = true;
> @@ -1258,6 +1288,8 @@ static int lan743x_mac_init(struct lan743x_adapter
> *adapter)
>         lan743x_mac_set_address(adapter, adapter->mac_address);
>         eth_hw_addr_set(netdev, adapter->mac_address);
> 
> +       lan743x_mac_rx_enable_fse(adapter);
> +
>         return 0;
>  }
> 
> diff --git a/drivers/net/ethernet/microchip/lan743x_main.h
> b/drivers/net/ethernet/microchip/lan743x_main.h
> index 160d94a7cee6..1573c8f9c993 100644
> --- a/drivers/net/ethernet/microchip/lan743x_main.h
> +++ b/drivers/net/ethernet/microchip/lan743x_main.h
> @@ -182,6 +182,7 @@
>  #define MAC_RX                         (0x104)
>  #define MAC_RX_MAX_SIZE_SHIFT_         (16)
>  #define MAC_RX_MAX_SIZE_MASK_          (0x3FFF0000)
> +#define MAC_RX_FSE_                    BIT(2)
>  #define MAC_RX_RXD_                    BIT(1)
>  #define MAC_RX_RXEN_                   BIT(0)
> 
> --
> 2.43.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net v2] net: lan743x: permit VLAN-tagged packets up to configured MTU
  2026-05-29 21:03 [PATCH net v2] net: lan743x: permit VLAN-tagged packets up to configured MTU David Thompson
  2026-06-01  3:33 ` Thangaraj.S
@ 2026-06-01  7:58 ` Nicolai Buchwitz
  2026-06-02 21:20 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 4+ messages in thread
From: Nicolai Buchwitz @ 2026-06-01  7:58 UTC (permalink / raw)
  To: David Thompson
  Cc: bryan.whitehead, UNGLinuxDriver, andrew+netdev, davem, edumazet,
	kuba, pabeni, netdev, linux-kernel

Hi David

On 29.5.2026 23:03, David Thompson wrote:
> VLAN-tagged interfaces on lan743x devices were previously unreachable 
> via
> SSH and failed to respond to large ping packets (e.g. "ping -s 1469" 
> given
> MTU=1500). In these scenarios, "ethtool -S" reports non-zero "RX 
> Oversize
> Frame Errors". According to Microchip AN2948, the MAC_RX FSE (VLAN 
> field
> size enforcement) bit determines whether frames with VLAN tags 
> exceeding
> the base MTU plus tag length are discarded.
> 
> The driver must set the MAC_RX.FSE bit before setting MAC_RX.RXEN to 
> allow
> VLAN-tagged frames up to the interface MTU, preventing them from being
> treated as oversized. As a result, both the base and VLAN-tagged 
> interfaces
> can use the same MTU without receive errors.
> 
> Fixes: 23f0703c125b ("lan743x: Add main source files for new lan743x 
> driver")
> Signed-off-by: David Thompson <davthompson@nvidia.com>
> ---
> v2:
> - Added helper function, lan743x_mac_rx_enable_fse(), to set FSE bit 
> properly
> - Added explicit comment about use of distinct write cycle to set FSE 
> bit
> - Moved setting of FSE from lan743x_mac_open() to lan743x_mac_init(), 
> allowing FSE
>   bit to be set upon probe() path or suspend/resume path. This change 
> fixes an
>   issue raised by Sashiko
> ---
>  drivers/net/ethernet/microchip/lan743x_main.c | 32 +++++++++++++++++++
>  drivers/net/ethernet/microchip/lan743x_main.h |  1 +
>  2 files changed, 33 insertions(+)
> 
> diff --git a/drivers/net/ethernet/microchip/lan743x_main.c 
> b/drivers/net/ethernet/microchip/lan743x_main.c
> index f3332417162e..ffac22883e49 100644
> --- a/drivers/net/ethernet/microchip/lan743x_main.c
> +++ b/drivers/net/ethernet/microchip/lan743x_main.c
> @@ -1219,6 +1219,36 @@ static void lan743x_mac_set_address(struct 
> lan743x_adapter *adapter,
>  		   "MAC address set to %pM\n", addr);
>  }
> 
> +static void lan743x_mac_rx_enable_fse(struct lan743x_adapter *adapter)
> +{
> +	u32 mac_rx;
> +	bool rxen;
> +
> +	mac_rx = lan743x_csr_read(adapter, MAC_RX);
> +	if (mac_rx & MAC_RX_FSE_)
> +		return;
> +
> +	rxen = mac_rx & MAC_RX_RXEN_;
> +	if (rxen) {
> +		mac_rx &= ~MAC_RX_RXEN_;
> +		lan743x_csr_write(adapter, MAC_RX, mac_rx);
> +		lan743x_csr_wait_for_bit(adapter, MAC_RX, MAC_RX_RXD_,
> +					 1, 1000, 20000, 100);
> +	}
> +
> +	/* Per AN2948, hardware prevents modification of the FSE bit while 
> the
> +	 * MAC receiver is enabled (RXEN bit set). Use separate register 
> write
> +	 * to assert the FSE bit before enabling the RXEN bit in MAC_RX
> +	 */
> +	mac_rx |= MAC_RX_FSE_;
> +	lan743x_csr_write(adapter, MAC_RX, mac_rx);
> +
> +	if (rxen) {
> +		mac_rx |= MAC_RX_RXEN_;
> +		lan743x_csr_write(adapter, MAC_RX, mac_rx);
> +	}
> +}
> +
>  static int lan743x_mac_init(struct lan743x_adapter *adapter)
>  {
>  	bool mac_address_valid = true;
> @@ -1258,6 +1288,8 @@ static int lan743x_mac_init(struct 
> lan743x_adapter *adapter)
>  	lan743x_mac_set_address(adapter, adapter->mac_address);
>  	eth_hw_addr_set(netdev, adapter->mac_address);
> 
> +	lan743x_mac_rx_enable_fse(adapter);
> +
>  	return 0;
>  }
> 
> diff --git a/drivers/net/ethernet/microchip/lan743x_main.h 
> b/drivers/net/ethernet/microchip/lan743x_main.h
> index 160d94a7cee6..1573c8f9c993 100644
> --- a/drivers/net/ethernet/microchip/lan743x_main.h
> +++ b/drivers/net/ethernet/microchip/lan743x_main.h
> @@ -182,6 +182,7 @@
>  #define MAC_RX				(0x104)
>  #define MAC_RX_MAX_SIZE_SHIFT_		(16)
>  #define MAC_RX_MAX_SIZE_MASK_		(0x3FFF0000)
> +#define MAC_RX_FSE_			BIT(2)
>  #define MAC_RX_RXD_			BIT(1)
>  #define MAC_RX_RXEN_			BIT(0)

Reviewed-by: Nicolai Buchwitz <nb@tipi-net.de>
Tested-by: Nicolai Buchwitz <nb@tipi-net.de> # lan7430 on arm64 (RevPi 
Connect 5)

Thanks,
Nicolai

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net v2] net: lan743x: permit VLAN-tagged packets up to configured MTU
  2026-05-29 21:03 [PATCH net v2] net: lan743x: permit VLAN-tagged packets up to configured MTU David Thompson
  2026-06-01  3:33 ` Thangaraj.S
  2026-06-01  7:58 ` Nicolai Buchwitz
@ 2026-06-02 21:20 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2026-06-02 21:20 UTC (permalink / raw)
  To: David Thompson
  Cc: bryan.whitehead, UNGLinuxDriver, andrew+netdev, davem, edumazet,
	kuba, pabeni, netdev, linux-kernel

Hello:

This patch was applied to netdev/net.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Fri, 29 May 2026 21:03:00 +0000 you wrote:
> VLAN-tagged interfaces on lan743x devices were previously unreachable via
> SSH and failed to respond to large ping packets (e.g. "ping -s 1469" given
> MTU=1500). In these scenarios, "ethtool -S" reports non-zero "RX Oversize
> Frame Errors". According to Microchip AN2948, the MAC_RX FSE (VLAN field
> size enforcement) bit determines whether frames with VLAN tags exceeding
> the base MTU plus tag length are discarded.
> 
> [...]

Here is the summary with links:
  - [net,v2] net: lan743x: permit VLAN-tagged packets up to configured MTU
    https://git.kernel.org/netdev/net/c/8173d22b211f

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



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-06-02 21:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-05-29 21:03 [PATCH net v2] net: lan743x: permit VLAN-tagged packets up to configured MTU David Thompson
2026-06-01  3:33 ` Thangaraj.S
2026-06-01  7:58 ` Nicolai Buchwitz
2026-06-02 21:20 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox