Subject: Re: [PATCH net-next v5 12/12] eth: bnxt: remove most dependencies on RTNL

From: Stanislav Fomichev <[email-masked]>
Date: Wed, 19 Feb 2025 15:16:49 -0800

On 02/19, Michael Chan wrote:
> On Wed, Feb 19, 2025 at 12:30 PM Stanislav Fomichev <[email-masked]> wrote:
> >
> > Only devlink and sriov paths are grabbing rtnl explicitly. The rest is
> > covered by netdev instance lock which the core now grabs, so there is
> > no need to manage rtnl in most places anymore.
> >
> > On the core side we can now try to drop rtnl in some places
> > (do_setlink for example) for the drivers that signal non-rtnl
> > mode (TBD).
> >
> > Boot-tested and with `ethtool -L eth1 combined 24` to trigger reset.
> >
> > Cc: Saeed Mahameed <[email-masked]>
> > Signed-off-by: Stanislav Fomichev <[email-masked]>
> 
> A typo in a comment below.  Otherwise it looks good to me.
> 
> Reviewed-by: Michael Chan <[email-masked]>
> 
> > @@ -13965,30 +13967,30 @@ static void bnxt_timer(struct timer_list *t)
> >         mod_timer(&bp->timer, jiffies + bp->current_interval);
> >  }
> >
> > -static void bnxt_rtnl_lock_sp(struct bnxt *bp)
> > +static void bnxt_lock_sp(struct bnxt *bp)
> >  {
> >         /* We are called from bnxt_sp_task which has BNXT_STATE_IN_SP_TASK
> >          * set.  If the device is being closed, bnxt_close() may be holding
> > -        * rtnl() and waiting for BNXT_STATE_IN_SP_TASK to clear.  So we
> > -        * must clear BNXT_STATE_IN_SP_TASK before holding rtnl().
> > +        * netdev instance lock and waiting for BNXT_STATE_IN_SP_TASK to clear.
> > +        * So we must clear BNXT_STATE_IN_SP_TASK before holding rtnl().
> 
> ... before holding netdev instance lock.

Thanks for the review! Will fix and repost tomorrow (unless Jakub pulls
and fixes on his side)