[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250911171749.02e9fd99@kernel.org>
Date: Thu, 11 Sep 2025 17:17:49 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: Łukasz Majewski <lukasz.majewski@...lbox.org>
Cc: Andrew Lunn <andrew+netdev@...n.ch>, davem@...emloft.net, Eric Dumazet
<edumazet@...gle.com>, Paolo Abeni <pabeni@...hat.com>, Rob Herring
<robh@...nel.org>, Krzysztof Kozlowski <krzk+dt@...nel.org>, Conor Dooley
<conor+dt@...nel.org>, Shawn Guo <shawnguo@...nel.org>, Sascha Hauer
<s.hauer@...gutronix.de>, Pengutronix Kernel Team <kernel@...gutronix.de>,
Fabio Estevam <festevam@...il.com>, Richard Cochran
<richardcochran@...il.com>, netdev@...r.kernel.org,
devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
imx@...ts.linux.dev, linux-arm-kernel@...ts.infradead.org, Stefan Wahren
<wahrenst@....net>, Simon Horman <horms@...nel.org>, Vladimir Oltean
<vladimir.oltean@....com>
Subject: Re: [net-next v19 4/7] net: mtip: Add net_device_ops functions to
the L2 switch driver
On Thu, 11 Sep 2025 23:55:47 +0200 Łukasz Majewski wrote:
> > > Ok. No adjustments needed then. Good :)
> >
> > No, you were talking about build_skb() which is Rx.
> > This is the patch that adds Tx. Tx is wrong.
>
> The same approach is taken in fec_main.c (@ fec_enet_txq_submit_skb()
> function).
FWIW I'm 99% sure we were once investigating a bug in FEC related to
modifying timestamped packets, leading to crashes. Maybe there is more.
> > > could be replaced just with mtip_switch_tx(napi->dev);
> > > as TX via napi->dev shall be forward to both ports if required.
> > >
> > > I will check if this can be done in such a way.
> >
> > Not napi->dev. You have to attribute sent packets to the right netdev.
>
> And then we do have some issue to solve. To be more specific -
> fec_main.c to avoid starvation just from fec_enet_rx_napi() calls
> fec_enet_tx() with only one net device (which it supports).
>
> I wanted to mimic such behaviour with L2 switch driver (at
> mtip_rx_napi()), but then the question - which network device (from
> available two) shall be assigned?
>
> The net device passed to mtip_switch_tx() is only relevant for
> "housekeeping/statistical data" as in fact we just provide another
> descriptor to the HW to be sent.
>
> Maybe I shall extract the net device pointer from the skb structure?
Exactly :)
> > > You mean a separate SW queues for each devices? This is not
> > > supported in the MTIP L2 switch driver. Maybe such high level SW
> > > queues management is available in the upper layers?
> >
> > Not possible, each netdev has it's own private qdisc tree.
>
> Please correct me if I'm wrong, but aren't packets from those queues
> end up with calling ->ndo_start_xmit() function?
Right. I think I'm lost, why does this matter?
> > I think I explained this enough times. Next version is v20.
> > If it's not significantly better than this one, I'm going to have
> > to ask you to stop posting this driver.
>
> I don't know how to reply to this comment, really.
>
> I've spent many hours of my spare time to upstream this driver.
> I'm just disappointed (and maybe I will not say more because of high
> level of my frustration).
I believe mlxsw has fewer DMA queues than ports. But TBH I'm not sure
how they handle the congestion. In your case since you only have two
ports (at most) I think you can trivially just always stop and start
both.
Powered by blists - more mailing lists