RE: [patch net-next 2/4] net: devlink: convert reload command to take implicit devlink->lock
From: "Keller, Jacob E" <jacob.e.keller@intel.com>
Date: 2022-08-05 20:12:56
-----Original Message----- From: Jakub Kicinski <kuba@kernel.org> Sent: Friday, August 05, 2022 12:59 PM To: Keller, Jacob E <jacob.e.keller@intel.com> Cc: Jiri Pirko <jiri@resnulli.us>; netdev@vger.kernel.org; davem@davemloft.net; idosch@nvidia.com; petrm@nvidia.com; pabeni@redhat.com; edumazet@google.com; mlxsw@nvidia.com; saeedm@nvidia.com; tariqt@nvidia.com; leon@kernel.org; moshe@nvidia.com Subject: Re: [patch net-next 2/4] net: devlink: convert reload command to take implicit devlink->lock On Fri, 5 Aug 2022 16:21:16 +0000 Keller, Jacob E wrote:quoted
quoted
Convert reload command to behave the same way as the rest of the commands and let if be called with devlink->lock held. Remove the temporary devl_lock taking from drivers. As the DEVLINK_NL_FLAG_NO_LOCK flag is no longer used, remove it alongside. Signed-off-by: Jiri Pirko <redacted>Wasn't reload avoiding the lock done so that drivers could perform otherdevlink operations during reload? Or is that no longer a problem with the recent refactors done to move devlink initialization and such earlier so that its now safe? Drivers have control over the lock now, they can take the lock themselves (devl_lock()) and call the "I'm already holding the lock" functions. So the expectation is that shared paths used by probe and reload will always run under the lock.
Ah perfect. So essentially, they already take the lock and are calling the "i'm locked" version of the functions, but this now moves the take the lock part into core. Ok great! That sounds better than assuming drivers will take the lock themselves. Thanks, Jake