[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CANn89i+cJfGwTw2T6oM=7u3MZe1YL_4pmdZg+TZo0TK28hHr+w@mail.gmail.com>
Date: Wed, 19 Mar 2025 14:23:10 +0100
From: Eric Dumazet <edumazet@...gle.com>
To: Paolo Abeni <pabeni@...hat.com>
Cc: netdev@...r.kernel.org, Andrew Lunn <andrew+netdev@...n.ch>,
"David S. Miller" <davem@...emloft.net>, Jakub Kicinski <kuba@...nel.org>, Simon Horman <horms@...nel.org>,
Sabrina Dubroca <sd@...asysnail.net>
Subject: Re: [PATCH v2] net: introduce per netns packet chains
On Wed, Mar 19, 2025 at 1:59 PM Paolo Abeni <pabeni@...hat.com> wrote:
>
> On 3/18/25 7:03 PM, Paolo Abeni wrote:
> > @@ -2463,16 +2477,18 @@ static inline bool skb_loop_sk(struct packet_type *ptype, struct sk_buff *skb)
> > }
> >
> > /**
> > - * dev_nit_active - return true if any network interface taps are in use
> > + * dev_nit_active_rcu - return true if any network interface taps are in use
> > + *
> > + * The caller must hold the RCU lock
> > *
> > * @dev: network device to check for the presence of taps
> > */
> > -bool dev_nit_active(struct net_device *dev)
> > +bool dev_nit_active_rcu(struct net_device *dev)
> > {
> > - return !list_empty(&net_hotdata.ptype_all) ||
> > + return !list_empty(&dev_net_rcu(dev)->ptype_all) ||
>
> Sadly lockdep is not happy about the above, the caller can acquire
> either the RCU lock and the RCU BH lock, and dev_net_rcu() is happy only
> with the former - even if AFAICT either are safe. I'll use:
>
> /* Callers may hold either RCU or RCU BH lock */
> WARN_ON_ONCE(!rcu_read_lock_held() && !rcu_read_lock_bh_held());
>
> return !list_empty(&dev_net(dev)->ptype_all) ||
This lockdep distinction seems strange.
The old RCU-bh is gone, we might convert network to standard rcu to avoid these.
Powered by blists - more mailing lists