[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Z-sHAbqPcmPQv8Nj@mini-arch>
Date: Mon, 31 Mar 2025 14:20:01 -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 v4 05/11] netdevsim: add dummy device notifiers
On 03/31, Jakub Kicinski wrote:
> On Mon, 31 Mar 2025 08:05:57 -0700 Stanislav Fomichev wrote:
> > +#if IS_ENABLED(CONFIG_DEBUG_NET)
> > +int netdev_debug_event(struct notifier_block *nb, unsigned long event,
> > + void *ptr);
> > +#else
> > +static inline int netdev_debug_event(struct notifier_block *nb,
> > + unsigned long event, void *ptr)
> > +{
> > + return 0;
> > +}
> > +#endif
>
> Maybe we can wrap the while notifier setup in
>
> if (IS_ENABLED(CONFIG_DEBUG_NET)) {
>
> instead? We don't expect more users of the event callback, and it may
> be useful to give readers of the netdevsim code a hint that this
> callback will only do something when DEBUG_NET=y
Will do. I'm not sure if (IS_ENABLED()) will compile, will double-check;
worst case will wrap into #ifdef
> > #endif
> > diff --git a/net/core/lock_debug.c b/net/core/lock_debug.c
> > index 7ecd28cc1c22..506899164f31 100644
> > --- a/net/core/lock_debug.c
> > +++ b/net/core/lock_debug.c
>
> > @@ -66,6 +69,7 @@ static int rtnl_net_debug_event(struct notifier_block *nb,
> >
> > return NOTIFY_DONE;
> > }
> > +EXPORT_SYMBOL_GPL(netdev_debug_event);
>
> EXPORT_SYMBOL_NS_GPL(netdev_debug_event, "NETDEV_INTERNAL");
Ah, good, and it's already imported by netdevsim. I was toying with making
this export dependent on netdevsim=ym...
Powered by blists - more mailing lists