lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Yit/f9MQWusTmsJW@unreal>
Date:   Fri, 11 Mar 2022 18:57:35 +0200
From:   Leon Romanovsky <leonro@...dia.com>
To:     Jakub Kicinski <kuba@...nel.org>
CC:     <idosch@...dia.com>, <petrm@...dia.com>,
        <simon.horman@...igine.com>, <netdev@...r.kernel.org>,
        <jiri@...nulli.us>
Subject: Re: [RFT net-next 1/6] devlink: expose instance locking and add
 locked port registering

On Fri, Mar 11, 2022 at 08:26:11AM -0800, Jakub Kicinski wrote:
> On Fri, 11 Mar 2022 18:09:36 +0200 Leon Romanovsky wrote:
> > What about this?
> 
> Is it better? 

I think so. It doesn't create shadow dependency on LOCKDEP.
In your variant, all users of this call will generate WARN
in production systems that run without lockdep.

So if you want the "eliminate" thing like you wrote in the comment,
the ifdef is a common solution.

> Can do it you prefer, but I'd lean towards a version
> without an ifdef myself.

So you need to add CONFIG_LOCKDEP dependency in devlink Kconfig.

Thanks

> 
> > diff --git a/include/net/devlink.h b/include/net/devlink.h
> > index 8d5349d2fb68..33b47d1a6800 100644
> > --- a/include/net/devlink.h
> > +++ b/include/net/devlink.h
> > @@ -1762,5 +1762,12 @@ devlink_compat_switch_id_get(struct net_device *dev,
> >  }
> >  
> >  #endif
> > -
> > +#if IS_ENABLED(CONFIG_LOCKDEP)
> > +bool devl_lock_is_held(struct devlink *devlink);
> > +#else
> > +static inline bool devl_lock_is_held(struct devlink *devlink)
> > +{
> > +       return true;
> > +}
> > +#endif
> >  #endif /* _NET_DEVLINK_H_ */

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ