>-----Original Message----- >From: Jakub Kicinski <k...@kernel.org> >Sent: Thursday, April 8, 2021 7:07 PM >To: Y.b. Lu <yangbo...@nxp.com> >Cc: netdev@vger.kernel.org; David S . Miller <da...@davemloft.net>; >Richard Cochran <richardcoch...@gmail.com>; Claudiu Manoil ><claudiu.man...@nxp.com>; Vladimir Oltean <vladimir.olt...@nxp.com>; >Russell King <li...@armlinux.org.uk> >Subject: Re: [net-next, v2, 2/2] enetc: support PTP Sync packet one-step >timestamping > >On Thu, 8 Apr 2021 09:02:50 -0700 Jakub Kicinski wrote: >> if (priv->flags & ONESTEP_BUSY) { >> skb_queue_tail(&priv->tx_skbs, skb); >> return ...; >> } >> priv->flags |= ONESTEP_BUSY; > >Ah, if you have multiple queues this needs to be under a separate >spinlock, 'cause netif_tx_lock() won't be enough.
Hi Yangbo, Please try test_and_set_bit_lock()/ clear_bit_unlock() based on Jakub's suggestion, and see if it works for you / whether it can replace the mutex. Thanks, Claudiu