mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2026-06-21 15:43:21 +02:00
net: lan743x: permit VLAN-tagged packets up to configured MTU
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: 23f0703c12 ("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>
Reviewed-by: Nicolai Buchwitz <nb@tipi-net.de>
Tested-by: Nicolai Buchwitz <nb@tipi-net.de> # lan7430 on arm64 (RevPi
Link: https://patch.msgid.link/20260529210300.433135-1-davthompson@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
committed by
Jakub Kicinski
parent
20cf0fb715
commit
8173d22b21
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user