net: Convert tc_action_net_init() and tc_action_net_exit() based pernet_operations
authorKirill Tkhai <ktkhai@virtuozzo.com>
Mon, 26 Feb 2018 13:00:31 +0000 (16:00 +0300)
committerDavid S. Miller <davem@davemloft.net>
Tue, 27 Feb 2018 16:01:36 +0000 (11:01 -0500)
These pernet_operations are from net/sched directory, and they call only
tc_action_net_init() and tc_action_net_exit():

bpf_net_ops
connmark_net_ops
csum_net_ops
gact_net_ops
ife_net_ops
ipt_net_ops
xt_net_ops
mirred_net_ops
nat_net_ops
pedit_net_ops
police_net_ops
sample_net_ops
simp_net_ops
skbedit_net_ops
skbmod_net_ops
tunnel_key_net_ops
vlan_net_ops

1)tc_action_net_init() just allocates and initializes per-net memory.
2)There should not be in-flight packets at the time of tc_action_net_exit()
call, or another pernet_operations send packets to dying net (except
netlink). So, it seems they can be marked as async.

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 files changed:
net/sched/act_bpf.c
net/sched/act_connmark.c
net/sched/act_csum.c
net/sched/act_gact.c
net/sched/act_ife.c
net/sched/act_ipt.c
net/sched/act_mirred.c
net/sched/act_nat.c
net/sched/act_pedit.c
net/sched/act_police.c
net/sched/act_sample.c
net/sched/act_simple.c
net/sched/act_skbedit.c
net/sched/act_skbmod.c
net/sched/act_tunnel_key.c
net/sched/act_vlan.c

index cb3c5d403c887dd360feac64bdb8232b3b22c5dc..da72e0cf2b1f31d3b5d3e78d081aa62e5bd6727d 100644 (file)
@@ -413,6 +413,7 @@ static struct pernet_operations bpf_net_ops = {
        .exit_batch = bpf_exit_net,
        .id   = &bpf_net_id,
        .size = sizeof(struct tc_action_net),
+       .async = true,
 };
 
 static int __init bpf_init_module(void)
index e4b880fa51fec90fa1a1d92c11f8a337637d3509..371e5e4ab3e2331e86a6508563622198b52bb30e 100644 (file)
@@ -222,6 +222,7 @@ static struct pernet_operations connmark_net_ops = {
        .exit_batch = connmark_exit_net,
        .id   = &connmark_net_id,
        .size = sizeof(struct tc_action_net),
+       .async = true,
 };
 
 static int __init connmark_init_module(void)
index d5c2e528d150bf8e7d2f9007e34d01bc0347dad4..1fb1f1f6a5554697b8047e5b19c5a4332625b203 100644 (file)
@@ -677,6 +677,7 @@ static struct pernet_operations csum_net_ops = {
        .exit_batch = csum_exit_net,
        .id   = &csum_net_id,
        .size = sizeof(struct tc_action_net),
+       .async = true,
 };
 
 MODULE_DESCRIPTION("Checksum updating actions");
index f072bcf337604396344a1d29ad6cc262c6ae3352..74563254e6763e66d8ce4d6fb62a40a53ab96e07 100644 (file)
@@ -247,6 +247,7 @@ static struct pernet_operations gact_net_ops = {
        .exit_batch = gact_exit_net,
        .id   = &gact_net_id,
        .size = sizeof(struct tc_action_net),
+       .async = true,
 };
 
 MODULE_AUTHOR("Jamal Hadi Salim(2002-4)");
index a5994cf0512bd731f55a1dfa798d85ff658e18ef..555b1caeff727561d0664a4abee6ff9b46aad857 100644 (file)
@@ -870,6 +870,7 @@ static struct pernet_operations ife_net_ops = {
        .exit_batch = ife_exit_net,
        .id   = &ife_net_id,
        .size = sizeof(struct tc_action_net),
+       .async = true,
 };
 
 static int __init ife_init_module(void)
index 9784629090ad7cd3c886fc753a540fb46215709a..10866717f88e98b15c9802a51862361ed967b4a3 100644 (file)
@@ -349,6 +349,7 @@ static struct pernet_operations ipt_net_ops = {
        .exit_batch = ipt_exit_net,
        .id   = &ipt_net_id,
        .size = sizeof(struct tc_action_net),
+       .async = true,
 };
 
 static int tcf_xt_walker(struct net *net, struct sk_buff *skb,
@@ -399,6 +400,7 @@ static struct pernet_operations xt_net_ops = {
        .exit_batch = xt_exit_net,
        .id   = &xt_net_id,
        .size = sizeof(struct tc_action_net),
+       .async = true,
 };
 
 MODULE_AUTHOR("Jamal Hadi Salim(2002-13)");
index fd34015331ab86c395a2e599546a51b64efb8625..64c86579c3d9e725040bfafbe74c5dad0d3dba70 100644 (file)
@@ -353,6 +353,7 @@ static struct pernet_operations mirred_net_ops = {
        .exit_batch = mirred_exit_net,
        .id   = &mirred_net_id,
        .size = sizeof(struct tc_action_net),
+       .async = true,
 };
 
 MODULE_AUTHOR("Jamal Hadi Salim(2002)");
index 4b5848b6c25207ac74b0508259f9f3019020d3c9..b1bc757f649129086afea4aa68f74f02d5026a0b 100644 (file)
@@ -323,6 +323,7 @@ static struct pernet_operations nat_net_ops = {
        .exit_batch = nat_exit_net,
        .id   = &nat_net_id,
        .size = sizeof(struct tc_action_net),
+       .async = true,
 };
 
 MODULE_DESCRIPTION("Stateless NAT actions");
index 094303c27c5ea753376844e6130178dc2fd589b8..5e8cc8f63acd3a64da9d38548bd8ea882e5ccacb 100644 (file)
@@ -465,6 +465,7 @@ static struct pernet_operations pedit_net_ops = {
        .exit_batch = pedit_exit_net,
        .id   = &pedit_net_id,
        .size = sizeof(struct tc_action_net),
+       .async = true,
 };
 
 MODULE_AUTHOR("Jamal Hadi Salim(2002-4)");
index ff55bd6c7db002a39ee7107bd005db8434392451..51fe4fe343f79bea65acbad8dd9e0ba1b0cbf26a 100644 (file)
@@ -347,6 +347,7 @@ static struct pernet_operations police_net_ops = {
        .exit_batch = police_exit_net,
        .id   = &police_net_id,
        .size = sizeof(struct tc_action_net),
+       .async = true,
 };
 
 static int __init police_init_module(void)
index 9765145aaf4066775f4ecdc8b90b951992515183..238dfd27e995c45ebffb14e8512444156e09b4ac 100644 (file)
@@ -248,6 +248,7 @@ static struct pernet_operations sample_net_ops = {
        .exit_batch = sample_exit_net,
        .id   = &sample_net_id,
        .size = sizeof(struct tc_action_net),
+       .async = true,
 };
 
 static int __init sample_init_module(void)
index 8244e221fe4f8b6ae9aa2b0f9b03e34a320e3e52..91816d73f3f37ab7db14b127782d6ddf5757eae3 100644 (file)
@@ -216,6 +216,7 @@ static struct pernet_operations simp_net_ops = {
        .exit_batch = simp_exit_net,
        .id   = &simp_net_id,
        .size = sizeof(struct tc_action_net),
+       .async = true,
 };
 
 MODULE_AUTHOR("Jamal Hadi Salim(2005)");
index ddf69fc01bdf8913260b63adb6de0bbbdcf90b25..7971510fe61b680668a757cd3f1af35d868af7aa 100644 (file)
@@ -253,6 +253,7 @@ static struct pernet_operations skbedit_net_ops = {
        .exit_batch = skbedit_exit_net,
        .id   = &skbedit_net_id,
        .size = sizeof(struct tc_action_net),
+       .async = true,
 };
 
 MODULE_AUTHOR("Alexander Duyck, <alexander.h.duyck@intel.com>");
index a406f191cb846da7c2516c476785230101197a8b..febec75f4f7a6755069d33b67685c49e90672b05 100644 (file)
@@ -278,6 +278,7 @@ static struct pernet_operations skbmod_net_ops = {
        .exit_batch = skbmod_exit_net,
        .id   = &skbmod_net_id,
        .size = sizeof(struct tc_action_net),
+       .async = true,
 };
 
 MODULE_AUTHOR("Jamal Hadi Salim, <jhs@mojatatu.com>");
index 41ff9d0e5c62f20078eb6a1b61925001f6dbdf9e..9169b7e78ada0f2e47764532a014e907cdc353a7 100644 (file)
@@ -337,6 +337,7 @@ static struct pernet_operations tunnel_key_net_ops = {
        .exit_batch = tunnel_key_exit_net,
        .id   = &tunnel_key_net_id,
        .size = sizeof(struct tc_action_net),
+       .async = true,
 };
 
 static int __init tunnel_key_init_module(void)
index 71411a255f04e789b170a8ee9382ea3c4923b48f..c2ee7fd51cc9bb6c28386b004b59708a02cd8159 100644 (file)
@@ -313,6 +313,7 @@ static struct pernet_operations vlan_net_ops = {
        .exit_batch = vlan_exit_net,
        .id   = &vlan_net_id,
        .size = sizeof(struct tc_action_net),
+       .async = true,
 };
 
 static int __init vlan_init_module(void)