mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/3] net: ethernet: ti: am65-cpsw: Allow for MTU values
@ 2024-01-02  8:19 Sanjuán García, Jorge
  2024-01-02  8:19 ` [PATCH 1/3] net: ethernet: ti: am65-cpsw: Fix max mtu to fit ethernet frames Sanjuán García, Jorge
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Sanjuán García, Jorge @ 2024-01-02  8:19 UTC (permalink / raw)
  To: davem, edumazet, kuba, pabeni
  Cc: s-vadapalli, grygorii.strashko, netdev, linux-kernel,
	Sanjuán García, Jorge

The am65-cpsw-nuss driver has a fixed definition for the maximum ethernet
frame length of 1522 bytes (AM65_CPSW_MAX_PACKET_SIZE). This limits the switch
ports to only operate at a maximum MTU of 1500 bytes. When combining this CPSW
switch with a DSA switch connected to one of its ports this limitation shows up.
The extra 8 bytes the DSA subsystem adds internally to the ethernet frame
create resulting frames bigger than 1522 bytes (1518 for non VLAN + 8 for DSA
stuff) so they get dropped by the switch.

One of the issues with the the am65-cpsw-nuss driver is that the network device
max_mtu was being set to the same fixed value defined for the max total frame
length (1522 bytes). This makes the DSA subsystem believe that the MTU of the
interface can be set to 1508 bytes to make room for the extra 8 bytes of the DSA
headers. However, all packages created assuming the 1500 bytes payload get
dropped by the switch as oversized.

This series offers a solution to this problem. First, the max_mtu advertised on
the network device and the actual max frame size configured on the switch
registers are made consistent by letting the extra room needed for the ethernet
headers and the frame checksum (22 bytes including VLAN). Also, make the max
frame length configurable via a devicetree property to allow for MTU values
greater than 1500 bytes.

Jorge Sanjuan Garcia (3):
  net: ethernet: ti: am65-cpsw: Fix max mtu to fit ethernet frames
  net: ethernet: ti: am65-cpsw: Introduce rx_packet_max member
  net: ethernet: ti: am65-cpsw: Add device tree property to set max MTU

 drivers/net/ethernet/ti/am65-cpsw-nuss.c | 26 ++++++++++++++++++------
 drivers/net/ethernet/ti/am65-cpsw-nuss.h |  3 +++
 2 files changed, 23 insertions(+), 6 deletions(-)

-- 
2.34.1

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

end of thread, other threads:[~2024-01-03 13:39 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-02  8:19 [PATCH 0/3] net: ethernet: ti: am65-cpsw: Allow for MTU values Sanjuán García, Jorge
2024-01-02  8:19 ` [PATCH 1/3] net: ethernet: ti: am65-cpsw: Fix max mtu to fit ethernet frames Sanjuán García, Jorge
2024-01-02  9:53   ` Siddharth Vadapalli
2024-01-02  8:19 ` [PATCH 2/3] net: ethernet: ti: am65-cpsw: Introduce rx_packet_max member Sanjuán García, Jorge
2024-01-02 10:10   ` Siddharth Vadapalli
2024-01-02  8:19 ` [PATCH 3/3] net: ethernet: ti: am65-cpsw: Add device tree property to set max MTU Sanjuán García, Jorge
2024-01-02 10:33   ` Siddharth Vadapalli
2024-01-02 15:27     ` Sanjuán García, Jorge
2024-01-03  1:42   ` Andrew Lunn
2024-01-03 10:11     ` Sanjuán García, Jorge
2024-01-03 13:39       ` Andrew Lunn

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

all inboxes | Powered by JetHome®