All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: "Łukasz Majewski" <lukasz.majewski@mailbox.org>
Cc: Andrew Lunn <andrew+netdev@lunn.ch>,
	davem@davemloft.net, Eric Dumazet <edumazet@google.com>,
	Paolo Abeni <pabeni@redhat.com>, Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Shawn Guo <shawnguo@kernel.org>,
	Sascha Hauer <s.hauer@pengutronix.de>,
	Pengutronix Kernel Team <kernel@pengutronix.de>,
	Fabio Estevam <festevam@gmail.com>,
	Richard Cochran <richardcochran@gmail.com>,
	netdev@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org, imx@lists.linux.dev,
	linux-arm-kernel@lists.infradead.org,
	Stefan Wahren <wahrenst@gmx.net>, Simon Horman <horms@kernel.org>,
	Vladimir Oltean <vladimir.oltean@nxp.com>
Subject: Re: [net-next v19 4/7] net: mtip: Add net_device_ops functions to the L2 switch driver
Date: Thu, 11 Sep 2025 17:17:49 -0700	[thread overview]
Message-ID: <20250911171749.02e9fd99@kernel.org> (raw)
In-Reply-To: <20250911235547.477460e4@wsk>

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.

  reply	other threads:[~2025-09-12  0:17 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-24 22:07 [net-next v19 0/7] net: mtip: Add support for MTIP imx287 L2 switch driver Lukasz Majewski
2025-08-24 22:07 ` [net-next v19 1/7] dt-bindings: net: Add MTIP L2 switch description Lukasz Majewski
2025-08-24 22:07 ` [net-next v19 2/7] net: mtip: The L2 switch driver for imx287 Lukasz Majewski
2025-08-24 22:07 ` [net-next v19 3/7] net: mtip: Add buffers management functions to the L2 switch driver Lukasz Majewski
2025-08-24 22:07 ` [net-next v19 4/7] net: mtip: Add net_device_ops " Lukasz Majewski
2025-08-27 15:25   ` Jakub Kicinski
2025-09-07 16:38     ` Łukasz Majewski
2025-09-09  1:05       ` Jakub Kicinski
2025-09-10 21:15         ` Łukasz Majewski
2025-09-11  0:22           ` Jakub Kicinski
2025-09-11 21:55             ` Łukasz Majewski
2025-09-12  0:17               ` Jakub Kicinski [this message]
2025-08-27 18:16   ` Jakub Kicinski
2025-09-07 16:52     ` Łukasz Majewski
2025-08-24 22:07 ` [net-next v19 5/7] net: mtip: Add mtip_switch_{rx|tx} " Lukasz Majewski
2025-08-27 15:25   ` Jakub Kicinski
2025-09-07 16:48     ` Łukasz Majewski
2025-08-24 22:07 ` [net-next v19 6/7] net: mtip: Extend the L2 switch driver with management operations Lukasz Majewski
2025-08-24 22:07 ` [net-next v19 7/7] net: mtip: Extend the L2 switch driver for imx287 with bridge operations Lukasz Majewski

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=20250911171749.02e9fd99@kernel.org \
    --to=kuba@kernel.org \
    --cc=andrew+netdev@lunn.ch \
    --cc=conor+dt@kernel.org \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=edumazet@google.com \
    --cc=festevam@gmail.com \
    --cc=horms@kernel.org \
    --cc=imx@lists.linux.dev \
    --cc=kernel@pengutronix.de \
    --cc=krzk+dt@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lukasz.majewski@mailbox.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=richardcochran@gmail.com \
    --cc=robh@kernel.org \
    --cc=s.hauer@pengutronix.de \
    --cc=shawnguo@kernel.org \
    --cc=vladimir.oltean@nxp.com \
    --cc=wahrenst@gmx.net \
    /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.