Skip to content

Commit 685ecfb

Browse files
Kirill Tkhaidavem330
authored andcommitted
net: Convert tc_action_net_init() and tc_action_net_exit() based pernet_operations
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>
1 parent 5fcc858 commit 685ecfb

File tree

16 files changed

+17
-0
lines changed

16 files changed

+17
-0
lines changed

net/sched/act_bpf.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -413,6 +413,7 @@ static struct pernet_operations bpf_net_ops = {
413413
.exit_batch = bpf_exit_net,
414414
.id = &bpf_net_id,
415415
.size = sizeof(struct tc_action_net),
416+
.async = true,
416417
};
417418

418419
static int __init bpf_init_module(void)

net/sched/act_connmark.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,7 @@ static struct pernet_operations connmark_net_ops = {
222222
.exit_batch = connmark_exit_net,
223223
.id = &connmark_net_id,
224224
.size = sizeof(struct tc_action_net),
225+
.async = true,
225226
};
226227

227228
static int __init connmark_init_module(void)

net/sched/act_csum.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -677,6 +677,7 @@ static struct pernet_operations csum_net_ops = {
677677
.exit_batch = csum_exit_net,
678678
.id = &csum_net_id,
679679
.size = sizeof(struct tc_action_net),
680+
.async = true,
680681
};
681682

682683
MODULE_DESCRIPTION("Checksum updating actions");

net/sched/act_gact.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,7 @@ static struct pernet_operations gact_net_ops = {
247247
.exit_batch = gact_exit_net,
248248
.id = &gact_net_id,
249249
.size = sizeof(struct tc_action_net),
250+
.async = true,
250251
};
251252

252253
MODULE_AUTHOR("Jamal Hadi Salim(2002-4)");

net/sched/act_ife.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -870,6 +870,7 @@ static struct pernet_operations ife_net_ops = {
870870
.exit_batch = ife_exit_net,
871871
.id = &ife_net_id,
872872
.size = sizeof(struct tc_action_net),
873+
.async = true,
873874
};
874875

875876
static int __init ife_init_module(void)

net/sched/act_ipt.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,7 @@ static struct pernet_operations ipt_net_ops = {
349349
.exit_batch = ipt_exit_net,
350350
.id = &ipt_net_id,
351351
.size = sizeof(struct tc_action_net),
352+
.async = true,
352353
};
353354

354355
static int tcf_xt_walker(struct net *net, struct sk_buff *skb,
@@ -399,6 +400,7 @@ static struct pernet_operations xt_net_ops = {
399400
.exit_batch = xt_exit_net,
400401
.id = &xt_net_id,
401402
.size = sizeof(struct tc_action_net),
403+
.async = true,
402404
};
403405

404406
MODULE_AUTHOR("Jamal Hadi Salim(2002-13)");

net/sched/act_mirred.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,7 @@ static struct pernet_operations mirred_net_ops = {
353353
.exit_batch = mirred_exit_net,
354354
.id = &mirred_net_id,
355355
.size = sizeof(struct tc_action_net),
356+
.async = true,
356357
};
357358

358359
MODULE_AUTHOR("Jamal Hadi Salim(2002)");

net/sched/act_nat.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,7 @@ static struct pernet_operations nat_net_ops = {
323323
.exit_batch = nat_exit_net,
324324
.id = &nat_net_id,
325325
.size = sizeof(struct tc_action_net),
326+
.async = true,
326327
};
327328

328329
MODULE_DESCRIPTION("Stateless NAT actions");

net/sched/act_pedit.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -465,6 +465,7 @@ static struct pernet_operations pedit_net_ops = {
465465
.exit_batch = pedit_exit_net,
466466
.id = &pedit_net_id,
467467
.size = sizeof(struct tc_action_net),
468+
.async = true,
468469
};
469470

470471
MODULE_AUTHOR("Jamal Hadi Salim(2002-4)");

net/sched/act_police.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,7 @@ static struct pernet_operations police_net_ops = {
347347
.exit_batch = police_exit_net,
348348
.id = &police_net_id,
349349
.size = sizeof(struct tc_action_net),
350+
.async = true,
350351
};
351352

352353
static int __init police_init_module(void)

0 commit comments

Comments
 (0)