From: Stanislav Fomichev <stfomichev@gmail.com>
To: Jakub Kicinski <kuba@kernel.org>, edumazet@google.com
Cc: Stanislav Fomichev <sdf@fomichev.me>,
netdev@vger.kernel.org, davem@davemloft.net, edumazet@google.com,
pabeni@redhat.com, Saeed Mahameed <saeed@kernel.org>
Subject: Re: [PATCH net-next v7 04/12] net: hold netdev instance lock during rtnetlink operations
Date: Wed, 26 Feb 2025 09:17:45 -0800 [thread overview]
Message-ID: <Z79MuRd1ZBfbDj4p@mini-arch> (raw)
In-Reply-To: <Z76S925bMuXh7VKn@mini-arch>
On 02/25, Stanislav Fomichev wrote:
> On 02/25, Jakub Kicinski wrote:
> > On Mon, 24 Feb 2025 10:08:00 -0800 Stanislav Fomichev wrote:
> > > +static inline int netdev_lock_cmp_fn(const struct lockdep_map *a,
> > > + const struct lockdep_map *b)
> > > +{
> > > + /* Only lower devices currently grab the instance lock, so no
> > > + * real ordering issues can occur. In the near future, only
> > > + * hardware devices will grab instance lock which also does not
> > > + * involve any ordering. Suppress lockdep ordering warnings
> > > + * until (if) we start grabbing instance lock on pure SW
> > > + * devices (bond/team/veth/etc).
> > > + */
> > > + return -1;
> >
> > Does this no kill all lockdep warnings?
>
> Initially I was gonna say "no" because I've seen (and do see) deadlock
> warnings with netdevsim, but looking at the code I think you're right.
[..]
> And netdevsim doesn't call netdev_lockdep_set_classes :-/ I think we want
> to add that as well?
More context: commit 0bef512012b1 ("net: add netdev_lockdep_set_classes() to
virtual drivers") added netdev_lockdep_set_classes invocation to tunnel
devices (which makes sense), but also lo and dummy (which doesn't). It
might have been overly eager? As discussed, I was under the impression
that netdev_lockdep_set_classes is needed only for the stacked devices or
devices that have peers.
Eric, if you have more context on why we need netdev_lockdep_set_classes
in dummy/lo please chime in. I'll post v8 without adding
netdev_lockdep_set_classes to netdevsim, can follow up separately.
> I will make cmp_fn be:
> if (a == b)
> return 0;
> return -1;
>
> That should bring back deadlock detection for the rest for the sw
> drivers.
next prev parent reply other threads:[~2025-02-26 17:17 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-24 18:07 [PATCH net-next v7 00/12] net: Hold netdev instance lock during ndo operations Stanislav Fomichev
2025-02-24 18:07 ` [PATCH net-next v7 01/12] net: hold netdev instance lock during ndo_open/ndo_stop Stanislav Fomichev
2025-02-24 18:07 ` [PATCH net-next v7 02/12] net: hold netdev instance lock during ndo_setup_tc Stanislav Fomichev
2025-02-24 18:07 ` [PATCH net-next v7 03/12] net: hold netdev instance lock during queue operations Stanislav Fomichev
2025-02-24 18:08 ` [PATCH net-next v7 04/12] net: hold netdev instance lock during rtnetlink operations Stanislav Fomichev
2025-02-26 3:00 ` Jakub Kicinski
2025-02-26 4:05 ` Stanislav Fomichev
2025-02-26 17:17 ` Stanislav Fomichev [this message]
2025-02-24 18:08 ` [PATCH net-next v7 05/12] net: hold netdev instance lock during ioctl operations Stanislav Fomichev
2025-02-24 18:08 ` [PATCH net-next v7 06/12] net: hold netdev instance lock during sysfs operations Stanislav Fomichev
2025-02-24 18:08 ` [PATCH net-next v7 07/12] net: hold netdev instance lock during ndo_bpf Stanislav Fomichev
2025-02-24 18:08 ` [PATCH net-next v7 08/12] net: ethtool: try to protect all callback with netdev instance lock Stanislav Fomichev
2025-02-24 18:08 ` [PATCH net-next v7 09/12] net: replace dev_addr_sem " Stanislav Fomichev
2025-02-24 18:08 ` [PATCH net-next v7 10/12] net: add option to request " Stanislav Fomichev
2025-02-24 18:08 ` [PATCH net-next v7 11/12] docs: net: document new locking reality Stanislav Fomichev
2025-02-24 18:08 ` [PATCH net-next v7 12/12] eth: bnxt: remove most dependencies on RTNL 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=Z79MuRd1ZBfbDj4p@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=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;
as well as URLs for NNTP newsgroup(s).