public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Stanislav Fomichev <stfomichev@gmail.com>
To: Sabrina Dubroca <sd@queasysnail.net>
Cc: Stanislav Fomichev <sdf@fomichev.me>,
	netdev@vger.kernel.org, davem@davemloft.net, edumazet@google.com,
	kuba@kernel.org, pabeni@redhat.com,
	Saeed Mahameed <saeed@kernel.org>
Subject: Re: [PATCH net-next v5 03/12] net: hold netdev instance lock during queue operations
Date: Thu, 20 Feb 2025 09:00:24 -0800	[thread overview]
Message-ID: <Z7dfqFr-knB3Bv0G@mini-arch> (raw)
In-Reply-To: <Z7dGFLSom9mnWFdB@hog>

On 02/20, Sabrina Dubroca wrote:
> 2025-02-19, 12:27:10 -0800, Stanislav Fomichev wrote:
> > diff --git a/drivers/net/ethernet/google/gve/gve_main.c b/drivers/net/ethernet/google/gve/gve_main.c
> > index 533e659b15b3..cf9bd08d04b2 100644
> > --- a/drivers/net/ethernet/google/gve/gve_main.c
> > +++ b/drivers/net/ethernet/google/gve/gve_main.c
> > @@ -1886,7 +1886,7 @@ static void gve_turndown(struct gve_priv *priv)
> >  			netif_queue_set_napi(priv->dev, idx,
> >  					     NETDEV_QUEUE_TYPE_TX, NULL);
> >  
> > -		napi_disable(&block->napi);
> > +		napi_disable_locked(&block->napi);
> 
> I don't think all the codepaths that can lead to gve_turndown have the
> required netdev_lock():
> 
> gve_resume -> gve_reset_recovery -> gve_turndown
Good catch, looks like suspend is missing the netdev lock as well, will
add.

> gve_user_reset -> gve_reset -> gve_reset_recovery
I believe this should be covered by patch "net: ethtool: try to protect
all callback with netdev instance lock", no?

__dev_ethtool
  netdev_lock_ops
  ethtool_reset
    gve_user_reset

Or is there some other reset path I'm missing?

> (and nit:) There's also a few places in the series (bnxt, ethtool
> calling __netdev_update_features) where the lockdep
> annotation/_locked() variant gets introduced before the patch adding
> the corresponding lock.

This is mostly about ethtool patch and queue ops patch? The latter
converts most of the napi/netif calls to _locked variant leaving
a small window where some of the paths might be not properly locked.
Not sure what to do about it, but probably nothing since everything
is still rtnl_lock-protected and the issue is mostly about (temporary)
wrong lockdep annotations? Any other suggestions?

Thanks for the review!

  reply	other threads:[~2025-02-20 17:00 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-19 20:27 [PATCH net-next v5 00/12] net: Hold netdev instance lock during ndo operations Stanislav Fomichev
2025-02-19 20:27 ` [PATCH net-next v5 01/12] net: hold netdev instance lock during ndo_open/ndo_stop Stanislav Fomichev
2025-02-19 20:27 ` [PATCH net-next v5 02/12] net: hold netdev instance lock during ndo_setup_tc Stanislav Fomichev
2025-02-19 20:27 ` [PATCH net-next v5 03/12] net: hold netdev instance lock during queue operations Stanislav Fomichev
2025-02-20 15:11   ` Sabrina Dubroca
2025-02-20 17:00     ` Stanislav Fomichev [this message]
2025-02-21 16:18       ` Sabrina Dubroca
2025-02-21 17:16         ` Stanislav Fomichev
2025-02-19 20:27 ` [PATCH net-next v5 04/12] net: hold netdev instance lock during rtnetlink operations Stanislav Fomichev
2025-02-19 20:27 ` [PATCH net-next v5 05/12] net: hold netdev instance lock during ioctl operations Stanislav Fomichev
2025-02-19 20:27 ` [PATCH net-next v5 06/12] net: hold netdev instance lock during sysfs operations Stanislav Fomichev
2025-02-19 20:27 ` [PATCH net-next v5 07/12] net: hold netdev instance lock during ndo_bpf Stanislav Fomichev
2025-02-19 20:27 ` [PATCH net-next v5 08/12] net: ethtool: try to protect all callback with netdev instance lock Stanislav Fomichev
2025-02-19 20:27 ` [PATCH net-next v5 09/12] net: replace dev_addr_sem " Stanislav Fomichev
2025-02-19 20:27 ` [PATCH net-next v5 10/12] net: add option to request " Stanislav Fomichev
2025-02-19 20:27 ` [PATCH net-next v5 11/12] docs: net: document new locking reality Stanislav Fomichev
2025-02-19 20:27 ` [PATCH net-next v5 12/12] eth: bnxt: remove most dependencies on RTNL Stanislav Fomichev
2025-02-19 21:28   ` Michael Chan
2025-02-19 23:16     ` Stanislav Fomichev

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=Z7dfqFr-knB3Bv0G@mini-arch \
    --to=stfomichev@gmail.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=saeed@kernel.org \
    --cc=sd@queasysnail.net \
    --cc=sdf@fomichev.me \
    /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