mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Sanjuán García, Jorge" <Jorge.SanjuanGarcia@duagon.com>
To: "andrew@lunn.ch" <andrew@lunn.ch>
Cc: "s-vadapalli@ti.com" <s-vadapalli@ti.com>,
	"davem@davemloft.net" <davem@davemloft.net>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"grygorii.strashko@ti.com" <grygorii.strashko@ti.com>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"kuba@kernel.org" <kuba@kernel.org>,
	"edumazet@google.com" <edumazet@google.com>,
	"pabeni@redhat.com" <pabeni@redhat.com>
Subject: Re: [PATCH 3/3] net: ethernet: ti: am65-cpsw: Add device tree property to set max MTU
Date: Wed, 3 Jan 2024 10:11:57 +0000	[thread overview]
Message-ID: <2e09402c8cdd1109e730df58df3e59fdb3e5ab53.camel@duagon.com> (raw)
In-Reply-To: <285f6402-db06-462b-9ca5-8363027283e1@lunn.ch>

On Wed, 2024-01-03 at 02:42 +0100, Andrew Lunn wrote:
> [No suele recibir correo electrónico de andrew@lunn.ch. Descubra por
> qué esto es importante en
> https://aka.ms/LearnAboutSenderIdentification ]
> 
> On Tue, Jan 02, 2024 at 08:19:15AM +0000, Sanjuán García, Jorge
> wrote:
> > The switch supports ethernet frame sizes between 64 and 2024 bytes
> > (including VLAN) as stated in the technical reference manual.
> > 
> > This patch adds a new devicetree property so the switch ports can
> > be configured with an MTU higher than the standar 1500 bytes,
> > making
> > the max frame length configured on the registers and the max_mtu
> > advertised on the network device consistent.
> 
> Why do you need a device tree property for this? How many other
> drivers have a device tree property like this? Why not set
> ndev->max_mtu to 2024 minus overheads?

Hi Andrew,

There are a few drivers that set the max_mtu based on "max_frame_size"
parsed from device tree. Here is a list:

driver/net/ethernet/
  stmicro/stmmac/stmmac_platform.c
  altera/altera_tse_main.c
  socionext/netsec.c
  ibm/emac/core.c

I also considered hardcoding this to the maximum capabilities of the HW
but I ended making this a configurable frame size. I beleive this way
it is more stable as I don't know whether there may be any performance
issues if we default the max frame size on the swith registers to be
something different than the standard 1522 bytes. I need it for my use
case where there is a DSA switch connected to one port and I need some
extra room for the DSA headers.

Regards,
Jorge

> 
>         Andrew


  reply	other threads:[~2024-01-03 10:12 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2024-01-03 13:39       ` Andrew Lunn

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=2e09402c8cdd1109e730df58df3e59fdb3e5ab53.camel@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 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®