[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Z-W9Rkr07PbY3Qf4@mini-arch>
Date: Thu, 27 Mar 2025 14:04:06 -0700
From: Stanislav Fomichev <stfomichev@...il.com>
To: Jakub Kicinski <kuba@...nel.org>
Cc: Stanislav Fomichev <sdf@...ichev.me>, netdev@...r.kernel.org,
davem@...emloft.net, edumazet@...gle.com, pabeni@...hat.com
Subject: Re: [PATCH net v2 06/11] netdevsim: add dummy device notifiers
On 03/27, Jakub Kicinski wrote:
> On Thu, 27 Mar 2025 06:56:54 -0700 Stanislav Fomichev wrote:
> > In order to exercise and verify notifiers' locking assumptions,
> > register dummy notifiers and assert that netdev is ops locked
> > for REGISTER/UNREGISTER/UP.
>
> > +static int nsim_net_event(struct notifier_block *this, unsigned long event,
> > + void *ptr)
> > +{
> > + struct net_device *dev = netdev_notifier_info_to_dev(ptr);
> > +
> > + switch (event) {
> > + case NETDEV_REGISTER:
> > + case NETDEV_UNREGISTER:
> > + case NETDEV_UP:
> > + netdev_ops_assert_locked(dev);
> > + break;
> > + default:
> > + break;
> > + }
> > +
> > + return NOTIFY_DONE;
> > +}
>
> Can we register empty notifiers in nsim (just to make sure it has
> a callback) but do the validation in rtnl_net_debug.c
> I guess we'd need to transform rtnl_net_debug.c a little,
> make it less rtnl specific, compile under DEBUG_NET and ifdef
> out the small rtnl parts?
s/rtnl_net_debug.c/notifiers_debug.c/ + DEBUG_NET? Or I can keep the
name and only do the DEBUG_NET part. Not sure what needs to be ifdef-ed out,
but will take a look (probably just enough to make it compile with
!CONFIG_DEBUG_NET_SMALL_RTNL ?). That should work for the regular notifiers,
but I think register_netdevice_notifier_dev_net needs a netdev?
Powered by blists - more mailing lists