[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250709120817.5b2f631a@wsk>
Date: Wed, 9 Jul 2025 12:08:16 +0200
From: Lukasz Majewski <lukma@...x.de>
To: Paolo Abeni <pabeni@...hat.com>
Cc: Andrew Lunn <andrew+netdev@...n.ch>, davem@...emloft.net, Eric Dumazet
<edumazet@...gle.com>, Jakub Kicinski <kuba@...nel.org>, 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>
Subject: Re: [net-next v14 06/12] net: mtip: Add net_device_ops functions to
the L2 switch driver
Hi Paolo,
> On 7/1/25 1:49 PM, Lukasz Majewski wrote:
> > +static netdev_tx_t mtip_start_xmit_port(struct sk_buff *skb,
> > + struct net_device *dev,
> > int port) +{
> > + struct mtip_ndev_priv *priv = netdev_priv(dev);
> > + struct switch_enet_private *fep = priv->fep;
> > + unsigned short status;
> > + struct cbd_t *bdp;
> > + void *bufaddr;
> > +
> > + spin_lock(&fep->hw_lock);
>
> mtip_start_xmit_port() runs with BH disabled. The above lock variant
> is inconsistent with what you use in patch 4.
I've looked into the fec_main.c driver. They use for TX path
__netif_tx_lock(nq, cpu); which is a simple spin_lock(). I've followed
the same approach (as _irqsave() seems to be an overkill).
This function (mtip_start_xmit_port()) is call as a callback from:
.ndo_start_xmit (member of struct net_device_ops).
IIRC net core code provides locking on this call anyway.
> Please be sure to run
> tests vs the next iteration with CONFIG_PROVE_LOCKING enabled.
This is already enabled. Locking in this driver is a bit special, as
one uDMA is used for both ports... (unlikely as in fec_main.c).
>
> /P
>
Best regards,
Lukasz Majewski
--
DENX Software Engineering GmbH, Managing Director: Johanna Denk,
Tabea Lutz HRB 165235 Munich, Office: Kirchenstr.5, D-82194
Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma@...x.de
Content of type "application/pgp-signature" skipped
Powered by blists - more mailing lists