Re: [PATCH net-next v2 3/4] devlink: expose get/put functions
From: Leon Romanovsky <leon@kernel.org>
Date: 2021-11-01 18:22:06
From: Leon Romanovsky <leon@kernel.org>
Date: 2021-11-01 18:22:06
On Mon, Nov 01, 2021 at 06:44:40AM -0700, Jakub Kicinski wrote:
On Sun, 31 Oct 2021 08:29:20 +0200 Leon Romanovsky wrote:quoted
I really like this series, but your latest netdevsim RFC made me worry. It is important to make sure that these devlink_put() and devlink_get() calls will be out-of-reach from the drivers. Only core code should use them.get/put symbols are not exported so I think we should be safe from driver misuse at this point. If we ever export them we should add a WARN_ON(!(devlink->lock_flags & DEVLINK_LOCK_USE_REF));
Right, for now we are safe.
quoted
Can you please add it as a comment above these functions?Will do if the RFC sinks.
I have a solution at hand that doesn't require exporting get/put interfaces.
quoted
At least for now, till we discuss your RFC.