summaryrefslogtreecommitdiff
path: root/drivers/net/netdevsim
diff options
context:
space:
mode:
authorJiri Pirko <jiri@nvidia.com>2022-07-29 09:10:36 +0200
committerDavid S. Miller <davem@davemloft.net>2022-08-01 12:14:00 +0100
commit644a66c60f02f302d82c3008ae2ffe67cf495383 (patch)
tree4e691ef6ca0960f391c485bc976b4a553407b7ad /drivers/net/netdevsim
parentc2368b19807affd7621f7c4638cd2e17fec13021 (diff)
net: devlink: convert reload command to take implicit devlink->lock
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 <jiri@nvidia.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/netdevsim')
-rw-r--r--drivers/net/netdevsim/dev.c6
1 files changed, 0 insertions, 6 deletions
diff --git a/drivers/net/netdevsim/dev.c b/drivers/net/netdevsim/dev.c
index 5802e80e8fe1..e88f783c297e 100644
--- a/drivers/net/netdevsim/dev.c
+++ b/drivers/net/netdevsim/dev.c
@@ -948,18 +948,15 @@ static int nsim_dev_reload_down(struct devlink *devlink, bool netns_change,
{
struct nsim_dev *nsim_dev = devlink_priv(devlink);
- devl_lock(devlink);
if (nsim_dev->dont_allow_reload) {
/* For testing purposes, user set debugfs dont_allow_reload
* value to true. So forbid it.
*/
NL_SET_ERR_MSG_MOD(extack, "User forbid the reload for testing purposes");
- devl_unlock(devlink);
return -EOPNOTSUPP;
}
nsim_dev_reload_destroy(nsim_dev);
- devl_unlock(devlink);
return 0;
}
@@ -970,19 +967,16 @@ static int nsim_dev_reload_up(struct devlink *devlink, enum devlink_reload_actio
struct nsim_dev *nsim_dev = devlink_priv(devlink);
int ret;
- devl_lock(devlink);
if (nsim_dev->fail_reload) {
/* For testing purposes, user set debugfs fail_reload
* value to true. Fail right away.
*/
NL_SET_ERR_MSG_MOD(extack, "User setup the reload to fail for testing purposes");
- devl_unlock(devlink);
return -EINVAL;
}
*actions_performed = BIT(DEVLINK_RELOAD_ACTION_DRIVER_REINIT);
ret = nsim_dev_reload_create(nsim_dev, extack);
- devl_unlock(devlink);
return ret;
}