All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Sanjuán García, Jorge" <Jorge.SanjuanGarcia@duagon.com>
To: "andrew@lunn.ch" <andrew@lunn.ch>,
	"davem@davemloft.net" <davem@davemloft.net>,
	"edumazet@google.com" <edumazet@google.com>,
	"kuba@kernel.org" <kuba@kernel.org>,
	"pabeni@redhat.com" <pabeni@redhat.com>,
	"s-vadapalli@ti.com" <s-vadapalli@ti.com>
Cc: "grygorii.strashko@ti.com" <grygorii.strashko@ti.com>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"Sanjuán García, Jorge" <Jorge.SanjuanGarcia@duagon.com>
Subject: [PATCH net v2 0/1] net: ethernet: ti: am65-cpsw: Allow for MTU values
Date: Fri, 5 Jan 2024 08:55:39 +0000	[thread overview]
Message-ID: <20240105085530.14070-1-jorge.sanjuangarcia@duagon.com> (raw)

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. 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).

Changes in v2:
 - Just set the max_mtu to a fixed value and calculate the overheads.
 - Define the max packet size as part of the only commit of this series.

Jorge Sanjuan Garcia (1):
  net: ethernet: ti: am65-cpsw: Fix max mtu to fit ethernet frames

 drivers/net/ethernet/ti/am65-cpsw-nuss.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

-- 
2.34.1

             reply	other threads:[~2024-01-05  8:55 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-05  8:55 Sanjuán García, Jorge [this message]
2024-01-05  8:55 ` [PATCH net v2 1/1] net: ethernet: ti: am65-cpsw: Fix max mtu to fit ethernet frames Sanjuán García, Jorge
2024-01-11  9:18   ` Horatiu Vultur
2024-01-11  9:46   ` Siddharth Vadapalli
2024-01-12  1:00 ` [PATCH net v2 0/1] net: ethernet: ti: am65-cpsw: Allow for MTU values patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240105085530.14070-1-jorge.sanjuangarcia@duagon.com \
    --to=jorge.sanjuangarcia@duagon.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=grygorii.strashko@ti.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=s-vadapalli@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.