aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/act_api.h
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2017-11-04 09:26:51 +0900
committerDavid S. Miller <davem@davemloft.net>2017-11-04 09:26:51 +0900
commit2a171788ba7bb61995e98e8163204fc7880f63b2 (patch)
tree4150a94dd08323748116e5051e56ddee830d4812 /include/net/act_api.h
parentliquidio: Fix an issue with multiple switchdev enable disables (diff)
parentMerge tag 'clk-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux (diff)
downloadlinux-dev-2a171788ba7bb61995e98e8163204fc7880f63b2.tar.xz
linux-dev-2a171788ba7bb61995e98e8163204fc7880f63b2.zip
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Files removed in 'net-next' had their license header updated in 'net'. We take the remove from 'net-next'. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/act_api.h')
-rw-r--r--include/net/act_api.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/include/net/act_api.h b/include/net/act_api.h
index f5e8c9048fb0..9b8950042c96 100644
--- a/include/net/act_api.h
+++ b/include/net/act_api.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __NET_ACT_API_H
#define __NET_ACT_API_H
@@ -13,6 +14,7 @@
struct tcf_idrinfo {
spinlock_t lock;
struct idr action_idr;
+ struct net *net;
};
struct tc_action_ops;
@@ -103,7 +105,7 @@ struct tc_action_net {
static inline
int tc_action_net_init(struct tc_action_net *tn,
- const struct tc_action_ops *ops)
+ const struct tc_action_ops *ops, struct net *net)
{
int err = 0;
@@ -111,6 +113,7 @@ int tc_action_net_init(struct tc_action_net *tn,
if (!tn->idrinfo)
return -ENOMEM;
tn->ops = ops;
+ tn->idrinfo->net = net;
spin_lock_init(&tn->idrinfo->lock);
idr_init(&tn->idrinfo->action_idr);
return err;
@@ -121,7 +124,9 @@ void tcf_idrinfo_destroy(const struct tc_action_ops *ops,
static inline void tc_action_net_exit(struct tc_action_net *tn)
{
+ rtnl_lock();
tcf_idrinfo_destroy(tn->ops, tn->idrinfo);
+ rtnl_unlock();
kfree(tn->idrinfo);
}