mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: willemb@google.com
To: Joe Damato <joe@dama.to>, netdev-bot+sashiko@kernel.org
Cc: netdev@vger.kernel.org, michael.chan@broadcom.com,
	 pavan.chebbi@broadcom.com, andrew+netdev@lunn.ch,
	davem@davemloft.net,  edumazet@kernel.org, kuba@kernel.org,
	pabeni@redhat.com,  prashant@broadcom.com, edumazet@google.com,
	horms@kernel.org,  selvin.xavier@broadcom.com,
	kalesh-anakkur.purayil@broadcom.com,
	 linux-kernel@vger.kernel.org
Subject: Re: [PATCH net v6 5/5] bnxt_en: stop the ULP around the reset task
Date: Wed, 25 Nov 2026 19:21:31 -0500	[thread overview]
Message-ID: <willemb.1401f0f6ad765@google.com> (raw)
In-Reply-To: <awTJWtBSMubj4qQ9@devvm20253.cco0.facebook.com>

Joe Damato wrote:
> On Mon, Nov 23, 2026 at 06:31:04PM +0000, netdev-bot+sashiko@kernel.org  
> wrote:
> > Thank you for your contribution! Sashiko AI review found 6 potential
> > issue(s) to consider.
> >
> > Critical: 0 · High: 3 · Medium: 3 · Low: 0
> >
> > If you believe none of the issues are legitimate, please reply to each
> > issue of Medium severity or higher and explain why the AI is wrong.
> > If any of them are legitimate and you plan to respin, please let  
> patchwork
> > know by including "pw-bot: cr" as a separate line at the end of your  
> reply
> > (one such reply per series is enough).
> >
> > - [High] Possible deadlock.
> > - [High] bnxt_reset() decides to call bnxt_ulp_start() only from !silent
> >   && !BNXT_STATE_DMA_STOPPED, after dropping its locks.
> > - [High] Incomplete fix.
> > - [Medium] bnxt_reset_task() discards the return value of
> >   bnxt_open_nic(), and bnxt_reset() calls bnxt_ulp_start() whenever…
> > - [Medium] The new DMA_STOPPED check exists only at the bnxt_reset()  
> call
> >   site.
> > - [Medium] Every non-silent reset now unregisters and re-registers the
> >   RoCE IB device, including the common case where DMA is never stopped,…
> >
> > --
> >
> > bnxt_en: stop the ULP around the reset task
> >
> > For non-silent resets, bnxt_reset() now calls bnxt_ulp_stop() before it
> > takes rtnl and the netdev lock. Afterwards it calls bnxt_ulp_start()  
> unless
> > BNXT_STATE_DMA_STOPPED was set. The goal is to keep the RDMA driver off  
> the
> > device once the reset task has stopped DMA.
> >
> > > diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c  
> b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
> > > index 9daf053293a42..2abb721d87de8 100644
> > > --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
> > > +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
> > > @@ -14710,10 +14710,14 @@ static void bnxt_tph_update(struct bnxt *bp)
> > >  /* Only called from bnxt_sp_task() */
> > >  static void bnxt_reset(struct bnxt *bp, bool silent)
> > >  {
> > > +	if (!silent)
> > > +		bnxt_ulp_stop(bp);
> > >  	bnxt_rtnl_lock_sp(bp);
> >
> > [Severity: High]
> > Can this deadlock against bnxt_close()?
> >
> > bnxt_sp_task() sets BNXT_STATE_IN_SP_TASK before it calls bnxt_reset().
> > bnxt_rtnl_lock_sp() clears that bit only after bnxt_ulp_stop() has
> > returned, and bnxt_rtnl_unlock_sp() sets it again before  
> bnxt_ulp_start()
> > runs. So both new ULP calls run with IN_SP_TASK set.
> >
> > Both ULP callbacks take rtnl_lock():
> >
> > bnxt_ulp_stop()
> >   bnxt_re_suspend()
> >     bnxt_re_update_en_info_rdev()
> >       rtnl_lock()
> >
> > bnxt_ulp_start()
> >   bnxt_re_resume()
> >     bnxt_re_add_device()
> >       bnxt_re_update_en_info_rdev()
> >         rtnl_lock()
> >        
> bnxt_re_ib_init()->ib_register_device()->...->enum_all_gids_of_dev_cb()
> >         rtnl_lock()
> >
> > ndo_stop, meanwhile, holds rtnl and the netdev instance lock and waits  
> for
> > IN_SP_TASK to clear, with no timeout:
> >
> > __bnxt_close_nic() {
> > 	clear_bit(BNXT_STATE_OPEN, &bp->state);
> > 	smp_mb__after_atomic();
> > 	while (bnxt_drv_busy(bp))
> > 		msleep(20);
> > 	...
> > }
> >
> > Suppose "ip link set dev X down" runs just after a TX timeout has  
> scheduled
> > BNXT_RESET_TASK_SP_EVENT. sp_task can block on rtnl inside  
> bnxt_ulp_stop()
> > (or bnxt_ulp_start()), while bnxt_close() spins on bnxt_drv_busy()  
> holding
> > rtnl. The comment above bnxt_lock_sp() warns about this exact case.
> >
> > Before this patch, only the rare RESTART_ULP and firmware reset events
> > called into the ULP with IN_SP_TASK set. The frequent reset path did  
> not.
> >
> > Should the ULP calls happen only while IN_SP_TASK is clear?

> Yea, I think this is real.

> Not sure if Michael or the other Broadcom folks have a suggestion here?  
> Maybe
> the minimal fix is to clear IN_SP_TASK before bnxt_ulp_stop() and call
> bnxt_ulp_start() only after unlock.

> The RDMA teardown on every TX timeout and restart races below would still  
> need
> answers, though.

Are this and your questions in the main thread a reason for a v7?

  reply	other threads:[~2026-11-26  0:21 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-20 15:28 [PATCH net v6 0/5] bnxt_en: Make RING FREE more robust Joe Damato
2026-11-20 15:28 ` [PATCH net v6 1/5] bnxt_en: return the RING_FREE status to callers Joe Damato
2026-11-23 18:30   ` netdev-bot+sashiko
2026-11-23 21:18     ` Joe Damato
2026-11-20 15:28 ` [PATCH net v6 2/5] bnxt_en: check HWRM response if completion never arrives Joe Damato
2026-11-23 18:30   ` netdev-bot+sashiko
2026-11-23 22:43     ` Joe Damato
2026-11-20 15:28 ` [PATCH net v6 3/5] bnxt_en: stop DMA before releasing rings the firmware did not free Joe Damato
2026-11-23 18:31   ` netdev-bot+sashiko
2026-11-23 23:03     ` Joe Damato
2026-11-20 15:28 ` [PATCH net v6 4/5] bnxt_en: refuse to open a device with stopped DMA Joe Damato
2026-11-23 18:31   ` netdev-bot+sashiko
2026-11-23 23:10     ` Joe Damato
2026-11-20 15:28 ` [PATCH net v6 5/5] bnxt_en: stop the ULP around the reset task Joe Damato
2026-11-23 18:31   ` netdev-bot+sashiko
2026-11-23 23:16     ` Joe Damato
2026-11-26  0:21       ` willemb [this message]
2026-11-26  0:41         ` Joe Damato
2026-11-23 23:27 ` [PATCH net v6 0/5] bnxt_en: Make RING FREE more robust Joe Damato

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=willemb.1401f0f6ad765@google.com \
    --to=willemb@google.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=edumazet@kernel.org \
    --cc=horms@kernel.org \
    --cc=joe@dama.to \
    --cc=kalesh-anakkur.purayil@broadcom.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michael.chan@broadcom.com \
    --cc=netdev-bot+sashiko@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=pavan.chebbi@broadcom.com \
    --cc=prashant@broadcom.com \
    --cc=selvin.xavier@broadcom.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®