Commit 294c4f57 authored by Jiri Pirko's avatar Jiri Pirko Committed by Jakub Kicinski

net: devlink: move net check into devlinks_xa_for_each_registered_get()

Benefit from having devlinks iterator helper
devlinks_xa_for_each_registered_get() and move the net pointer
check inside.
Suggested-by: default avatarJakub Kicinski <kuba@kernel.org>
Signed-off-by: default avatarJiri Pirko <jiri@nvidia.com>
Reviewed-by: default avatarJakub Kicinski <kuba@kernel.org>
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 30bab7cd
...@@ -289,7 +289,7 @@ void devl_unlock(struct devlink *devlink) ...@@ -289,7 +289,7 @@ void devl_unlock(struct devlink *devlink)
EXPORT_SYMBOL_GPL(devl_unlock); EXPORT_SYMBOL_GPL(devl_unlock);
static struct devlink * static struct devlink *
devlinks_xa_find_get(unsigned long *indexp, xa_mark_t filter, devlinks_xa_find_get(struct net *net, unsigned long *indexp, xa_mark_t filter,
void * (*xa_find_fn)(struct xarray *, unsigned long *, void * (*xa_find_fn)(struct xarray *, unsigned long *,
unsigned long, xa_mark_t)) unsigned long, xa_mark_t))
{ {
...@@ -304,33 +304,40 @@ devlinks_xa_find_get(unsigned long *indexp, xa_mark_t filter, ...@@ -304,33 +304,40 @@ devlinks_xa_find_get(unsigned long *indexp, xa_mark_t filter,
xa_find_fn = xa_find_after; xa_find_fn = xa_find_after;
if (!devlink_try_get(devlink)) if (!devlink_try_get(devlink))
goto retry; goto retry;
if (!net_eq(devlink_net(devlink), net)) {
devlink_put(devlink);
goto retry;
}
unlock: unlock:
rcu_read_unlock(); rcu_read_unlock();
return devlink; return devlink;
} }
static struct devlink *devlinks_xa_find_get_first(unsigned long *indexp, static struct devlink *devlinks_xa_find_get_first(struct net *net,
unsigned long *indexp,
xa_mark_t filter) xa_mark_t filter)
{ {
return devlinks_xa_find_get(indexp, filter, xa_find); return devlinks_xa_find_get(net, indexp, filter, xa_find);
} }
static struct devlink *devlinks_xa_find_get_next(unsigned long *indexp, static struct devlink *devlinks_xa_find_get_next(struct net *net,
unsigned long *indexp,
xa_mark_t filter) xa_mark_t filter)
{ {
return devlinks_xa_find_get(indexp, filter, xa_find_after); return devlinks_xa_find_get(net, indexp, filter, xa_find_after);
} }
/* Iterate over devlink pointers which were possible to get reference to. /* Iterate over devlink pointers which were possible to get reference to.
* devlink_put() needs to be called for each iterated devlink pointer * devlink_put() needs to be called for each iterated devlink pointer
* in loop body in order to release the reference. * in loop body in order to release the reference.
*/ */
#define devlinks_xa_for_each_get(index, devlink, filter) \ #define devlinks_xa_for_each_get(net, index, devlink, filter) \
for (index = 0, devlink = devlinks_xa_find_get_first(&index, filter); \ for (index = 0, \
devlink; devlink = devlinks_xa_find_get_next(&index, filter)) devlink = devlinks_xa_find_get_first(net, &index, filter); \
devlink; devlink = devlinks_xa_find_get_next(net, &index, filter))
#define devlinks_xa_for_each_registered_get(index, devlink) \ #define devlinks_xa_for_each_registered_get(net, index, devlink) \
devlinks_xa_for_each_get(index, devlink, DEVLINK_REGISTERED) devlinks_xa_for_each_get(net, index, devlink, DEVLINK_REGISTERED)
static struct devlink *devlink_get_from_attrs(struct net *net, static struct devlink *devlink_get_from_attrs(struct net *net,
struct nlattr **attrs) struct nlattr **attrs)
...@@ -346,10 +353,9 @@ static struct devlink *devlink_get_from_attrs(struct net *net, ...@@ -346,10 +353,9 @@ static struct devlink *devlink_get_from_attrs(struct net *net,
busname = nla_data(attrs[DEVLINK_ATTR_BUS_NAME]); busname = nla_data(attrs[DEVLINK_ATTR_BUS_NAME]);
devname = nla_data(attrs[DEVLINK_ATTR_DEV_NAME]); devname = nla_data(attrs[DEVLINK_ATTR_DEV_NAME]);
devlinks_xa_for_each_registered_get(index, devlink) { devlinks_xa_for_each_registered_get(net, index, devlink) {
if (strcmp(devlink->dev->bus->name, busname) == 0 && if (strcmp(devlink->dev->bus->name, busname) == 0 &&
strcmp(dev_name(devlink->dev), devname) == 0 && strcmp(dev_name(devlink->dev), devname) == 0)
net_eq(devlink_net(devlink), net))
return devlink; return devlink;
devlink_put(devlink); devlink_put(devlink);
} }
...@@ -1376,10 +1382,7 @@ static int devlink_nl_cmd_rate_get_dumpit(struct sk_buff *msg, ...@@ -1376,10 +1382,7 @@ static int devlink_nl_cmd_rate_get_dumpit(struct sk_buff *msg,
int err = 0; int err = 0;
mutex_lock(&devlink_mutex); mutex_lock(&devlink_mutex);
devlinks_xa_for_each_registered_get(index, devlink) { devlinks_xa_for_each_registered_get(sock_net(msg->sk), index, devlink) {
if (!net_eq(devlink_net(devlink), sock_net(msg->sk)))
goto retry;
devl_lock(devlink); devl_lock(devlink);
list_for_each_entry(devlink_rate, &devlink->rate_list, list) { list_for_each_entry(devlink_rate, &devlink->rate_list, list) {
enum devlink_command cmd = DEVLINK_CMD_RATE_NEW; enum devlink_command cmd = DEVLINK_CMD_RATE_NEW;
...@@ -1400,7 +1403,6 @@ static int devlink_nl_cmd_rate_get_dumpit(struct sk_buff *msg, ...@@ -1400,7 +1403,6 @@ static int devlink_nl_cmd_rate_get_dumpit(struct sk_buff *msg,
idx++; idx++;
} }
devl_unlock(devlink); devl_unlock(devlink);
retry:
devlink_put(devlink); devlink_put(devlink);
} }
out: out:
...@@ -1476,12 +1478,7 @@ static int devlink_nl_cmd_get_dumpit(struct sk_buff *msg, ...@@ -1476,12 +1478,7 @@ static int devlink_nl_cmd_get_dumpit(struct sk_buff *msg,
int err; int err;
mutex_lock(&devlink_mutex); mutex_lock(&devlink_mutex);
devlinks_xa_for_each_registered_get(index, devlink) { devlinks_xa_for_each_registered_get(sock_net(msg->sk), index, devlink) {
if (!net_eq(devlink_net(devlink), sock_net(msg->sk))) {
devlink_put(devlink);
continue;
}
if (idx < start) { if (idx < start) {
idx++; idx++;
devlink_put(devlink); devlink_put(devlink);
...@@ -1536,10 +1533,7 @@ static int devlink_nl_cmd_port_get_dumpit(struct sk_buff *msg, ...@@ -1536,10 +1533,7 @@ static int devlink_nl_cmd_port_get_dumpit(struct sk_buff *msg,
int err; int err;
mutex_lock(&devlink_mutex); mutex_lock(&devlink_mutex);
devlinks_xa_for_each_registered_get(index, devlink) { devlinks_xa_for_each_registered_get(sock_net(msg->sk), index, devlink) {
if (!net_eq(devlink_net(devlink), sock_net(msg->sk)))
goto retry;
devl_lock(devlink); devl_lock(devlink);
list_for_each_entry(devlink_port, &devlink->port_list, list) { list_for_each_entry(devlink_port, &devlink->port_list, list) {
if (idx < start) { if (idx < start) {
...@@ -1559,7 +1553,6 @@ static int devlink_nl_cmd_port_get_dumpit(struct sk_buff *msg, ...@@ -1559,7 +1553,6 @@ static int devlink_nl_cmd_port_get_dumpit(struct sk_buff *msg,
idx++; idx++;
} }
devl_unlock(devlink); devl_unlock(devlink);
retry:
devlink_put(devlink); devlink_put(devlink);
} }
out: out:
...@@ -2215,10 +2208,7 @@ static int devlink_nl_cmd_linecard_get_dumpit(struct sk_buff *msg, ...@@ -2215,10 +2208,7 @@ static int devlink_nl_cmd_linecard_get_dumpit(struct sk_buff *msg,
int err; int err;
mutex_lock(&devlink_mutex); mutex_lock(&devlink_mutex);
devlinks_xa_for_each_registered_get(index, devlink) { devlinks_xa_for_each_registered_get(sock_net(msg->sk), index, devlink) {
if (!net_eq(devlink_net(devlink), sock_net(msg->sk)))
goto retry;
mutex_lock(&devlink->linecards_lock); mutex_lock(&devlink->linecards_lock);
list_for_each_entry(linecard, &devlink->linecard_list, list) { list_for_each_entry(linecard, &devlink->linecard_list, list) {
if (idx < start) { if (idx < start) {
...@@ -2241,7 +2231,6 @@ static int devlink_nl_cmd_linecard_get_dumpit(struct sk_buff *msg, ...@@ -2241,7 +2231,6 @@ static int devlink_nl_cmd_linecard_get_dumpit(struct sk_buff *msg,
idx++; idx++;
} }
mutex_unlock(&devlink->linecards_lock); mutex_unlock(&devlink->linecards_lock);
retry:
devlink_put(devlink); devlink_put(devlink);
} }
out: out:
...@@ -2484,10 +2473,7 @@ static int devlink_nl_cmd_sb_get_dumpit(struct sk_buff *msg, ...@@ -2484,10 +2473,7 @@ static int devlink_nl_cmd_sb_get_dumpit(struct sk_buff *msg,
int err; int err;
mutex_lock(&devlink_mutex); mutex_lock(&devlink_mutex);
devlinks_xa_for_each_registered_get(index, devlink) { devlinks_xa_for_each_registered_get(sock_net(msg->sk), index, devlink) {
if (!net_eq(devlink_net(devlink), sock_net(msg->sk)))
goto retry;
devl_lock(devlink); devl_lock(devlink);
list_for_each_entry(devlink_sb, &devlink->sb_list, list) { list_for_each_entry(devlink_sb, &devlink->sb_list, list) {
if (idx < start) { if (idx < start) {
...@@ -2507,7 +2493,6 @@ static int devlink_nl_cmd_sb_get_dumpit(struct sk_buff *msg, ...@@ -2507,7 +2493,6 @@ static int devlink_nl_cmd_sb_get_dumpit(struct sk_buff *msg,
idx++; idx++;
} }
devl_unlock(devlink); devl_unlock(devlink);
retry:
devlink_put(devlink); devlink_put(devlink);
} }
out: out:
...@@ -2633,7 +2618,7 @@ static int devlink_nl_cmd_sb_pool_get_dumpit(struct sk_buff *msg, ...@@ -2633,7 +2618,7 @@ static int devlink_nl_cmd_sb_pool_get_dumpit(struct sk_buff *msg,
int err = 0; int err = 0;
mutex_lock(&devlink_mutex); mutex_lock(&devlink_mutex);
devlinks_xa_for_each_registered_get(index, devlink) { devlinks_xa_for_each_registered_get(sock_net(msg->sk), index, devlink) {
if (!net_eq(devlink_net(devlink), sock_net(msg->sk)) || if (!net_eq(devlink_net(devlink), sock_net(msg->sk)) ||
!devlink->ops->sb_pool_get) !devlink->ops->sb_pool_get)
goto retry; goto retry;
...@@ -2851,9 +2836,8 @@ static int devlink_nl_cmd_sb_port_pool_get_dumpit(struct sk_buff *msg, ...@@ -2851,9 +2836,8 @@ static int devlink_nl_cmd_sb_port_pool_get_dumpit(struct sk_buff *msg,
int err = 0; int err = 0;
mutex_lock(&devlink_mutex); mutex_lock(&devlink_mutex);
devlinks_xa_for_each_registered_get(index, devlink) { devlinks_xa_for_each_registered_get(sock_net(msg->sk), index, devlink) {
if (!net_eq(devlink_net(devlink), sock_net(msg->sk)) || if (!devlink->ops->sb_port_pool_get)
!devlink->ops->sb_port_pool_get)
goto retry; goto retry;
devl_lock(devlink); devl_lock(devlink);
...@@ -3097,9 +3081,8 @@ devlink_nl_cmd_sb_tc_pool_bind_get_dumpit(struct sk_buff *msg, ...@@ -3097,9 +3081,8 @@ devlink_nl_cmd_sb_tc_pool_bind_get_dumpit(struct sk_buff *msg,
int err = 0; int err = 0;
mutex_lock(&devlink_mutex); mutex_lock(&devlink_mutex);
devlinks_xa_for_each_registered_get(index, devlink) { devlinks_xa_for_each_registered_get(sock_net(msg->sk), index, devlink) {
if (!net_eq(devlink_net(devlink), sock_net(msg->sk)) || if (!devlink->ops->sb_tc_pool_bind_get)
!devlink->ops->sb_tc_pool_bind_get)
goto retry; goto retry;
devl_lock(devlink); devl_lock(devlink);
...@@ -5181,10 +5164,7 @@ static int devlink_nl_cmd_param_get_dumpit(struct sk_buff *msg, ...@@ -5181,10 +5164,7 @@ static int devlink_nl_cmd_param_get_dumpit(struct sk_buff *msg,
int err = 0; int err = 0;
mutex_lock(&devlink_mutex); mutex_lock(&devlink_mutex);
devlinks_xa_for_each_registered_get(index, devlink) { devlinks_xa_for_each_registered_get(sock_net(msg->sk), index, devlink) {
if (!net_eq(devlink_net(devlink), sock_net(msg->sk)))
goto retry;
devl_lock(devlink); devl_lock(devlink);
list_for_each_entry(param_item, &devlink->param_list, list) { list_for_each_entry(param_item, &devlink->param_list, list) {
if (idx < start) { if (idx < start) {
...@@ -5206,7 +5186,6 @@ static int devlink_nl_cmd_param_get_dumpit(struct sk_buff *msg, ...@@ -5206,7 +5186,6 @@ static int devlink_nl_cmd_param_get_dumpit(struct sk_buff *msg,
idx++; idx++;
} }
devl_unlock(devlink); devl_unlock(devlink);
retry:
devlink_put(devlink); devlink_put(devlink);
} }
out: out:
...@@ -5413,10 +5392,7 @@ static int devlink_nl_cmd_port_param_get_dumpit(struct sk_buff *msg, ...@@ -5413,10 +5392,7 @@ static int devlink_nl_cmd_port_param_get_dumpit(struct sk_buff *msg,
int err = 0; int err = 0;
mutex_lock(&devlink_mutex); mutex_lock(&devlink_mutex);
devlinks_xa_for_each_registered_get(index, devlink) { devlinks_xa_for_each_registered_get(sock_net(msg->sk), index, devlink) {
if (!net_eq(devlink_net(devlink), sock_net(msg->sk)))
goto retry;
devl_lock(devlink); devl_lock(devlink);
list_for_each_entry(devlink_port, &devlink->port_list, list) { list_for_each_entry(devlink_port, &devlink->port_list, list) {
list_for_each_entry(param_item, list_for_each_entry(param_item,
...@@ -5443,7 +5419,6 @@ static int devlink_nl_cmd_port_param_get_dumpit(struct sk_buff *msg, ...@@ -5443,7 +5419,6 @@ static int devlink_nl_cmd_port_param_get_dumpit(struct sk_buff *msg,
} }
} }
devl_unlock(devlink); devl_unlock(devlink);
retry:
devlink_put(devlink); devlink_put(devlink);
} }
out: out:
...@@ -5994,13 +5969,9 @@ static int devlink_nl_cmd_region_get_dumpit(struct sk_buff *msg, ...@@ -5994,13 +5969,9 @@ static int devlink_nl_cmd_region_get_dumpit(struct sk_buff *msg,
int err = 0; int err = 0;
mutex_lock(&devlink_mutex); mutex_lock(&devlink_mutex);
devlinks_xa_for_each_registered_get(index, devlink) { devlinks_xa_for_each_registered_get(sock_net(msg->sk), index, devlink) {
if (!net_eq(devlink_net(devlink), sock_net(msg->sk)))
goto retry;
err = devlink_nl_cmd_region_get_devlink_dumpit(msg, cb, devlink, err = devlink_nl_cmd_region_get_devlink_dumpit(msg, cb, devlink,
&idx, start); &idx, start);
retry:
devlink_put(devlink); devlink_put(devlink);
if (err) if (err)
goto out; goto out;
...@@ -6525,10 +6496,7 @@ static int devlink_nl_cmd_info_get_dumpit(struct sk_buff *msg, ...@@ -6525,10 +6496,7 @@ static int devlink_nl_cmd_info_get_dumpit(struct sk_buff *msg,
int err = 0; int err = 0;
mutex_lock(&devlink_mutex); mutex_lock(&devlink_mutex);
devlinks_xa_for_each_registered_get(index, devlink) { devlinks_xa_for_each_registered_get(sock_net(msg->sk), index, devlink) {
if (!net_eq(devlink_net(devlink), sock_net(msg->sk)))
goto retry;
if (idx < start || !devlink->ops->info_get) if (idx < start || !devlink->ops->info_get)
goto inc; goto inc;
...@@ -6546,7 +6514,6 @@ static int devlink_nl_cmd_info_get_dumpit(struct sk_buff *msg, ...@@ -6546,7 +6514,6 @@ static int devlink_nl_cmd_info_get_dumpit(struct sk_buff *msg,
} }
inc: inc:
idx++; idx++;
retry:
devlink_put(devlink); devlink_put(devlink);
} }
mutex_unlock(&devlink_mutex); mutex_unlock(&devlink_mutex);
...@@ -7702,10 +7669,7 @@ devlink_nl_cmd_health_reporter_get_dumpit(struct sk_buff *msg, ...@@ -7702,10 +7669,7 @@ devlink_nl_cmd_health_reporter_get_dumpit(struct sk_buff *msg,
int err; int err;
mutex_lock(&devlink_mutex); mutex_lock(&devlink_mutex);
devlinks_xa_for_each_registered_get(index, devlink) { devlinks_xa_for_each_registered_get(sock_net(msg->sk), index, devlink) {
if (!net_eq(devlink_net(devlink), sock_net(msg->sk)))
goto retry_rep;
mutex_lock(&devlink->reporters_lock); mutex_lock(&devlink->reporters_lock);
list_for_each_entry(reporter, &devlink->reporter_list, list_for_each_entry(reporter, &devlink->reporter_list,
list) { list) {
...@@ -7725,14 +7689,10 @@ devlink_nl_cmd_health_reporter_get_dumpit(struct sk_buff *msg, ...@@ -7725,14 +7689,10 @@ devlink_nl_cmd_health_reporter_get_dumpit(struct sk_buff *msg,
idx++; idx++;
} }
mutex_unlock(&devlink->reporters_lock); mutex_unlock(&devlink->reporters_lock);
retry_rep:
devlink_put(devlink); devlink_put(devlink);
} }
devlinks_xa_for_each_registered_get(index, devlink) { devlinks_xa_for_each_registered_get(sock_net(msg->sk), index, devlink) {
if (!net_eq(devlink_net(devlink), sock_net(msg->sk)))
goto retry_port;
devl_lock(devlink); devl_lock(devlink);
list_for_each_entry(port, &devlink->port_list, list) { list_for_each_entry(port, &devlink->port_list, list) {
mutex_lock(&port->reporters_lock); mutex_lock(&port->reporters_lock);
...@@ -7757,7 +7717,6 @@ devlink_nl_cmd_health_reporter_get_dumpit(struct sk_buff *msg, ...@@ -7757,7 +7717,6 @@ devlink_nl_cmd_health_reporter_get_dumpit(struct sk_buff *msg,
mutex_unlock(&port->reporters_lock); mutex_unlock(&port->reporters_lock);
} }
devl_unlock(devlink); devl_unlock(devlink);
retry_port:
devlink_put(devlink); devlink_put(devlink);
} }
out: out:
...@@ -8296,10 +8255,7 @@ static int devlink_nl_cmd_trap_get_dumpit(struct sk_buff *msg, ...@@ -8296,10 +8255,7 @@ static int devlink_nl_cmd_trap_get_dumpit(struct sk_buff *msg,
int err; int err;
mutex_lock(&devlink_mutex); mutex_lock(&devlink_mutex);
devlinks_xa_for_each_registered_get(index, devlink) { devlinks_xa_for_each_registered_get(sock_net(msg->sk), index, devlink) {
if (!net_eq(devlink_net(devlink), sock_net(msg->sk)))
goto retry;
devl_lock(devlink); devl_lock(devlink);
list_for_each_entry(trap_item, &devlink->trap_list, list) { list_for_each_entry(trap_item, &devlink->trap_list, list) {
if (idx < start) { if (idx < start) {
...@@ -8319,7 +8275,6 @@ static int devlink_nl_cmd_trap_get_dumpit(struct sk_buff *msg, ...@@ -8319,7 +8275,6 @@ static int devlink_nl_cmd_trap_get_dumpit(struct sk_buff *msg,
idx++; idx++;
} }
devl_unlock(devlink); devl_unlock(devlink);
retry:
devlink_put(devlink); devlink_put(devlink);
} }
out: out:
...@@ -8520,10 +8475,7 @@ static int devlink_nl_cmd_trap_group_get_dumpit(struct sk_buff *msg, ...@@ -8520,10 +8475,7 @@ static int devlink_nl_cmd_trap_group_get_dumpit(struct sk_buff *msg,
int err; int err;
mutex_lock(&devlink_mutex); mutex_lock(&devlink_mutex);
devlinks_xa_for_each_registered_get(index, devlink) { devlinks_xa_for_each_registered_get(sock_net(msg->sk), index, devlink) {
if (!net_eq(devlink_net(devlink), sock_net(msg->sk)))
goto retry;
devl_lock(devlink); devl_lock(devlink);
list_for_each_entry(group_item, &devlink->trap_group_list, list_for_each_entry(group_item, &devlink->trap_group_list,
list) { list) {
...@@ -8544,7 +8496,6 @@ static int devlink_nl_cmd_trap_group_get_dumpit(struct sk_buff *msg, ...@@ -8544,7 +8496,6 @@ static int devlink_nl_cmd_trap_group_get_dumpit(struct sk_buff *msg,
idx++; idx++;
} }
devl_unlock(devlink); devl_unlock(devlink);
retry:
devlink_put(devlink); devlink_put(devlink);
} }
out: out:
...@@ -8831,10 +8782,7 @@ static int devlink_nl_cmd_trap_policer_get_dumpit(struct sk_buff *msg, ...@@ -8831,10 +8782,7 @@ static int devlink_nl_cmd_trap_policer_get_dumpit(struct sk_buff *msg,
int err; int err;
mutex_lock(&devlink_mutex); mutex_lock(&devlink_mutex);
devlinks_xa_for_each_registered_get(index, devlink) { devlinks_xa_for_each_registered_get(sock_net(msg->sk), index, devlink) {
if (!net_eq(devlink_net(devlink), sock_net(msg->sk)))
goto retry;
devl_lock(devlink); devl_lock(devlink);
list_for_each_entry(policer_item, &devlink->trap_policer_list, list_for_each_entry(policer_item, &devlink->trap_policer_list,
list) { list) {
...@@ -8855,7 +8803,6 @@ static int devlink_nl_cmd_trap_policer_get_dumpit(struct sk_buff *msg, ...@@ -8855,7 +8803,6 @@ static int devlink_nl_cmd_trap_policer_get_dumpit(struct sk_buff *msg,
idx++; idx++;
} }
devl_unlock(devlink); devl_unlock(devlink);
retry:
devlink_put(devlink); devlink_put(devlink);
} }
out: out:
...@@ -12273,10 +12220,7 @@ static void __net_exit devlink_pernet_pre_exit(struct net *net) ...@@ -12273,10 +12220,7 @@ static void __net_exit devlink_pernet_pre_exit(struct net *net)
* all devlink instances from this namespace into init_net. * all devlink instances from this namespace into init_net.
*/ */
mutex_lock(&devlink_mutex); mutex_lock(&devlink_mutex);
devlinks_xa_for_each_registered_get(index, devlink) { devlinks_xa_for_each_registered_get(net, index, devlink) {
if (!net_eq(devlink_net(devlink), net))
goto retry;
WARN_ON(!(devlink->features & DEVLINK_F_RELOAD)); WARN_ON(!(devlink->features & DEVLINK_F_RELOAD));
err = devlink_reload(devlink, &init_net, err = devlink_reload(devlink, &init_net,
DEVLINK_RELOAD_ACTION_DRIVER_REINIT, DEVLINK_RELOAD_ACTION_DRIVER_REINIT,
...@@ -12284,7 +12228,6 @@ static void __net_exit devlink_pernet_pre_exit(struct net *net) ...@@ -12284,7 +12228,6 @@ static void __net_exit devlink_pernet_pre_exit(struct net *net)
&actions_performed, NULL); &actions_performed, NULL);
if (err && err != -EOPNOTSUPP) if (err && err != -EOPNOTSUPP)
pr_warn("Failed to reload devlink instance into init_net\n"); pr_warn("Failed to reload devlink instance into init_net\n");
retry:
devlink_put(devlink); devlink_put(devlink);
} }
mutex_unlock(&devlink_mutex); mutex_unlock(&devlink_mutex);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment