* [PATCH 01/16] net: Convert inet6_net_ops
2018-02-19 8:47 [PATCH 00/16] Converting pernet_operations (part #2) Kirill Tkhai
@ 2018-02-19 8:48 ` Kirill Tkhai
2018-02-19 8:48 ` [PATCH 02/16] net: Convert cfg80211_pernet_ops Kirill Tkhai
` (16 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: Kirill Tkhai @ 2018-02-19 8:48 UTC (permalink / raw)
To: davem, avagin, pablo, kadlec, fw, yoshfuji, afaerber,
steffen.klassert, herbert, johannes, netdev, ktkhai
init method initializes sysctl defaults, allocates
percpu arrays and creates /proc entries.
exit method reverts the above.
There are no pernet_operations, which are interested
in the above entities of foreign net namespace, so
inet6_net_ops are able to be marked as async.
Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
---
net/ipv6/af_inet6.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c
index c1e292db04db..dbbe04018813 100644
--- a/net/ipv6/af_inet6.c
+++ b/net/ipv6/af_inet6.c
@@ -857,6 +857,7 @@ static void __net_exit inet6_net_exit(struct net *net)
static struct pernet_operations inet6_net_ops = {
.init = inet6_net_init,
.exit = inet6_net_exit,
+ .async = true,
};
static const struct ipv6_stub ipv6_stub_impl = {
^ permalink raw reply related [flat|nested] 19+ messages in thread* [PATCH 02/16] net: Convert cfg80211_pernet_ops
2018-02-19 8:47 [PATCH 00/16] Converting pernet_operations (part #2) Kirill Tkhai
2018-02-19 8:48 ` [PATCH 01/16] net: Convert inet6_net_ops Kirill Tkhai
@ 2018-02-19 8:48 ` Kirill Tkhai
2018-02-19 8:48 ` [PATCH 03/16] net: Convert ip6mr_net_ops Kirill Tkhai
` (15 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: Kirill Tkhai @ 2018-02-19 8:48 UTC (permalink / raw)
To: davem, avagin, pablo, kadlec, fw, yoshfuji, afaerber,
steffen.klassert, herbert, johannes, netdev, ktkhai
This patch finishes converting pernet_operations
registered in net/wireless directory.
These pernet_operations have only exit method,
which moves devices to init_net. This action
is not pernet_operations-specific, and function
cfg80211_switch_netns() may be called all time
during the system life. All necessary protection
against concurrent cfg80211_pernet_exit() is made
by rtnl_lock(). So, cfg80211_pernet_ops is able
to be marked as async.
Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
---
net/wireless/core.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/net/wireless/core.c b/net/wireless/core.c
index a6f3cac8c640..670aa229168a 100644
--- a/net/wireless/core.c
+++ b/net/wireless/core.c
@@ -1340,6 +1340,7 @@ static void __net_exit cfg80211_pernet_exit(struct net *net)
static struct pernet_operations cfg80211_pernet_ops = {
.exit = cfg80211_pernet_exit,
+ .async = true,
};
static int __init cfg80211_init(void)
^ permalink raw reply related [flat|nested] 19+ messages in thread* [PATCH 03/16] net: Convert ip6mr_net_ops
2018-02-19 8:47 [PATCH 00/16] Converting pernet_operations (part #2) Kirill Tkhai
2018-02-19 8:48 ` [PATCH 01/16] net: Convert inet6_net_ops Kirill Tkhai
2018-02-19 8:48 ` [PATCH 02/16] net: Convert cfg80211_pernet_ops Kirill Tkhai
@ 2018-02-19 8:48 ` Kirill Tkhai
2018-02-19 8:48 ` [PATCH 04/16] net: Convert icmpv6_sk_ops, ndisc_net_ops and igmp6_net_ops Kirill Tkhai
` (14 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: Kirill Tkhai @ 2018-02-19 8:48 UTC (permalink / raw)
To: davem, avagin, pablo, kadlec, fw, yoshfuji, afaerber,
steffen.klassert, herbert, johannes, netdev, ktkhai
These pernet_operations create and destroy /proc entries,
populate and depopulate net::rules_ops and multiroute table.
All the structures are pernet, and they are not touched
by foreign net pernet_operations. So, it's possible to mark
them async.
Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
---
net/ipv6/ip6mr.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/net/ipv6/ip6mr.c b/net/ipv6/ip6mr.c
index 9f6cace9c817..295eb5ecaee5 100644
--- a/net/ipv6/ip6mr.c
+++ b/net/ipv6/ip6mr.c
@@ -1397,6 +1397,7 @@ static void __net_exit ip6mr_net_exit(struct net *net)
static struct pernet_operations ip6mr_net_ops = {
.init = ip6mr_net_init,
.exit = ip6mr_net_exit,
+ .async = true,
};
int __init ip6_mr_init(void)
^ permalink raw reply related [flat|nested] 19+ messages in thread* [PATCH 04/16] net: Convert icmpv6_sk_ops, ndisc_net_ops and igmp6_net_ops
2018-02-19 8:47 [PATCH 00/16] Converting pernet_operations (part #2) Kirill Tkhai
` (2 preceding siblings ...)
2018-02-19 8:48 ` [PATCH 03/16] net: Convert ip6mr_net_ops Kirill Tkhai
@ 2018-02-19 8:48 ` Kirill Tkhai
2018-02-19 8:49 ` [PATCH 05/16] net: Convert raw6_net_ops, udplite6_net_ops, ipv6_proc_ops, if6_proc_net_ops and ip6_route_net_late_ops Kirill Tkhai
` (13 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: Kirill Tkhai @ 2018-02-19 8:48 UTC (permalink / raw)
To: davem, avagin, pablo, kadlec, fw, yoshfuji, afaerber,
steffen.klassert, herbert, johannes, netdev, ktkhai
These pernet_operations create and destroy net::ipv6.icmp_sk
socket, used to send ICMP or error reply.
Nobody can dereference the socket to handle a packet before
net is initialized, as there is no routing; nobody can do
that in parallel with exit, as all of devices are moved
to init_net or destroyed and there are no packets it-flight.
So, it's possible to mark these pernet_operations as async.
The same for ndisc_net_ops and for igmp6_net_ops. The last
one also creates and destroys /proc entries.
Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
---
net/ipv6/icmp.c | 1 +
net/ipv6/mcast.c | 1 +
net/ipv6/ndisc.c | 1 +
3 files changed, 3 insertions(+)
diff --git a/net/ipv6/icmp.c b/net/ipv6/icmp.c
index 6ae5dd3f4d0d..4fa4f1b150a4 100644
--- a/net/ipv6/icmp.c
+++ b/net/ipv6/icmp.c
@@ -997,6 +997,7 @@ static void __net_exit icmpv6_sk_exit(struct net *net)
static struct pernet_operations icmpv6_sk_ops = {
.init = icmpv6_sk_init,
.exit = icmpv6_sk_exit,
+ .async = true,
};
int __init icmpv6_init(void)
diff --git a/net/ipv6/mcast.c b/net/ipv6/mcast.c
index 9b9d2ff01b35..d9bb933dd5c4 100644
--- a/net/ipv6/mcast.c
+++ b/net/ipv6/mcast.c
@@ -2997,6 +2997,7 @@ static void __net_exit igmp6_net_exit(struct net *net)
static struct pernet_operations igmp6_net_ops = {
.init = igmp6_net_init,
.exit = igmp6_net_exit,
+ .async = true,
};
int __init igmp6_init(void)
diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c
index f61a5b613b52..0a19ce3a6f7f 100644
--- a/net/ipv6/ndisc.c
+++ b/net/ipv6/ndisc.c
@@ -1882,6 +1882,7 @@ static void __net_exit ndisc_net_exit(struct net *net)
static struct pernet_operations ndisc_net_ops = {
.init = ndisc_net_init,
.exit = ndisc_net_exit,
+ .async = true,
};
int __init ndisc_init(void)
^ permalink raw reply related [flat|nested] 19+ messages in thread* [PATCH 05/16] net: Convert raw6_net_ops, udplite6_net_ops, ipv6_proc_ops, if6_proc_net_ops and ip6_route_net_late_ops
2018-02-19 8:47 [PATCH 00/16] Converting pernet_operations (part #2) Kirill Tkhai
` (3 preceding siblings ...)
2018-02-19 8:48 ` [PATCH 04/16] net: Convert icmpv6_sk_ops, ndisc_net_ops and igmp6_net_ops Kirill Tkhai
@ 2018-02-19 8:49 ` Kirill Tkhai
2018-02-19 8:49 ` [PATCH 06/16] net: Convert ipv6_inetpeer_ops Kirill Tkhai
` (12 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: Kirill Tkhai @ 2018-02-19 8:49 UTC (permalink / raw)
To: davem, avagin, pablo, kadlec, fw, yoshfuji, afaerber,
steffen.klassert, herbert, johannes, netdev, ktkhai
These pernet_operations create and destroy /proc entries
and safely may be converted and safely may be mark as async.
Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
---
net/ipv6/addrconf.c | 1 +
net/ipv6/proc.c | 1 +
net/ipv6/raw.c | 1 +
net/ipv6/route.c | 2 ++
4 files changed, 5 insertions(+)
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index 8c17f8d8d5d9..4facfe0b1888 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -4257,6 +4257,7 @@ static void __net_exit if6_proc_net_exit(struct net *net)
static struct pernet_operations if6_proc_net_ops = {
.init = if6_proc_net_init,
.exit = if6_proc_net_exit,
+ .async = true,
};
int __init if6_proc_init(void)
diff --git a/net/ipv6/proc.c b/net/ipv6/proc.c
index b67814242f78..b8858c546f41 100644
--- a/net/ipv6/proc.c
+++ b/net/ipv6/proc.c
@@ -343,6 +343,7 @@ static void __net_exit ipv6_proc_exit_net(struct net *net)
static struct pernet_operations ipv6_proc_ops = {
.init = ipv6_proc_init_net,
.exit = ipv6_proc_exit_net,
+ .async = true,
};
int __init ipv6_misc_proc_init(void)
diff --git a/net/ipv6/raw.c b/net/ipv6/raw.c
index 4c25339b1984..10a4ac4933b7 100644
--- a/net/ipv6/raw.c
+++ b/net/ipv6/raw.c
@@ -1332,6 +1332,7 @@ static void __net_exit raw6_exit_net(struct net *net)
static struct pernet_operations raw6_net_ops = {
.init = raw6_init_net,
.exit = raw6_exit_net,
+ .async = true,
};
int __init raw6_proc_init(void)
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index f0baae26db8f..1be84ef23f43 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -4972,6 +4972,7 @@ static void __net_exit ip6_route_net_exit_late(struct net *net)
static struct pernet_operations ip6_route_net_ops = {
.init = ip6_route_net_init,
.exit = ip6_route_net_exit,
+ .async = true,
};
static int __net_init ipv6_inetpeer_init(struct net *net)
@@ -5002,6 +5003,7 @@ static struct pernet_operations ipv6_inetpeer_ops = {
static struct pernet_operations ip6_route_net_late_ops = {
.init = ip6_route_net_init_late,
.exit = ip6_route_net_exit_late,
+ .async = true,
};
static struct notifier_block ip6_route_dev_notifier = {
^ permalink raw reply related [flat|nested] 19+ messages in thread* [PATCH 06/16] net: Convert ipv6_inetpeer_ops
2018-02-19 8:47 [PATCH 00/16] Converting pernet_operations (part #2) Kirill Tkhai
` (4 preceding siblings ...)
2018-02-19 8:49 ` [PATCH 05/16] net: Convert raw6_net_ops, udplite6_net_ops, ipv6_proc_ops, if6_proc_net_ops and ip6_route_net_late_ops Kirill Tkhai
@ 2018-02-19 8:49 ` Kirill Tkhai
2018-02-19 8:49 ` [PATCH 07/16] net: Convert fib6_rules_net_ops Kirill Tkhai
` (11 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: Kirill Tkhai @ 2018-02-19 8:49 UTC (permalink / raw)
To: davem, avagin, pablo, kadlec, fw, yoshfuji, afaerber,
steffen.klassert, herbert, johannes, netdev, ktkhai
net->ipv6.peers is dereferenced in three places via inet_getpeer_v6(),
and it's used to handle skb. All the users of inet_getpeer_v6() do not
look like be able to be called from foreign net pernet_operations, so
we may mark them as async.
Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
---
net/ipv6/route.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index 1be84ef23f43..aa709b644945 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -4998,6 +4998,7 @@ static void __net_exit ipv6_inetpeer_exit(struct net *net)
static struct pernet_operations ipv6_inetpeer_ops = {
.init = ipv6_inetpeer_init,
.exit = ipv6_inetpeer_exit,
+ .async = true,
};
static struct pernet_operations ip6_route_net_late_ops = {
^ permalink raw reply related [flat|nested] 19+ messages in thread* [PATCH 07/16] net: Convert fib6_rules_net_ops
2018-02-19 8:47 [PATCH 00/16] Converting pernet_operations (part #2) Kirill Tkhai
` (5 preceding siblings ...)
2018-02-19 8:49 ` [PATCH 06/16] net: Convert ipv6_inetpeer_ops Kirill Tkhai
@ 2018-02-19 8:49 ` Kirill Tkhai
2018-02-19 8:49 ` [PATCH 08/16] net: Convert tcpv6_net_ops Kirill Tkhai
` (10 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: Kirill Tkhai @ 2018-02-19 8:49 UTC (permalink / raw)
To: davem, avagin, pablo, kadlec, fw, yoshfuji, afaerber,
steffen.klassert, herbert, johannes, netdev, ktkhai
These pernet_operations register and unregister
net::ipv6.fib6_rules_ops, which are used for
routing. It looks like there are no pernet_operations,
which send ipv6 packages to another net, so we
are able to mark them as async.
Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
---
net/ipv6/fib6_rules.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/net/ipv6/fib6_rules.c b/net/ipv6/fib6_rules.c
index b240f24a6e52..95a2c9e8699a 100644
--- a/net/ipv6/fib6_rules.c
+++ b/net/ipv6/fib6_rules.c
@@ -368,6 +368,7 @@ static void __net_exit fib6_rules_net_exit(struct net *net)
static struct pernet_operations fib6_rules_net_ops = {
.init = fib6_rules_net_init,
.exit = fib6_rules_net_exit,
+ .async = true,
};
int __init fib6_rules_init(void)
^ permalink raw reply related [flat|nested] 19+ messages in thread* [PATCH 08/16] net: Convert tcpv6_net_ops
2018-02-19 8:47 [PATCH 00/16] Converting pernet_operations (part #2) Kirill Tkhai
` (6 preceding siblings ...)
2018-02-19 8:49 ` [PATCH 07/16] net: Convert fib6_rules_net_ops Kirill Tkhai
@ 2018-02-19 8:49 ` Kirill Tkhai
2018-02-19 8:49 ` [PATCH 09/16] net: Convert ipv6_sysctl_net_ops Kirill Tkhai
` (9 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: Kirill Tkhai @ 2018-02-19 8:49 UTC (permalink / raw)
To: davem, avagin, pablo, kadlec, fw, yoshfuji, afaerber,
steffen.klassert, herbert, johannes, netdev, ktkhai
These pernet_operations create and destroy net::ipv6.tcp_sk
socket, which is used in tcp_v6_send_response() only. It looks
like foreign pernet_operations don't want to set ipv6 connection
inside destroyed net, so this socket may be created in destroyed
in parallel with anything else. inet_twsk_purge() is also safe
for that, as described in patch for tcp_sk_ops. So, it's possible
to mark them as async.
Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
---
net/ipv6/tcp_ipv6.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
index 883df0ad5bfe..5425d7b100ee 100644
--- a/net/ipv6/tcp_ipv6.c
+++ b/net/ipv6/tcp_ipv6.c
@@ -2007,6 +2007,7 @@ static struct pernet_operations tcpv6_net_ops = {
.init = tcpv6_net_init,
.exit = tcpv6_net_exit,
.exit_batch = tcpv6_net_exit_batch,
+ .async = true,
};
int __init tcpv6_init(void)
^ permalink raw reply related [flat|nested] 19+ messages in thread* [PATCH 09/16] net: Convert ipv6_sysctl_net_ops
2018-02-19 8:47 [PATCH 00/16] Converting pernet_operations (part #2) Kirill Tkhai
` (7 preceding siblings ...)
2018-02-19 8:49 ` [PATCH 08/16] net: Convert tcpv6_net_ops Kirill Tkhai
@ 2018-02-19 8:49 ` Kirill Tkhai
2018-02-19 8:49 ` [PATCH 10/16] net: Convert ping_v6_net_ops Kirill Tkhai
` (8 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: Kirill Tkhai @ 2018-02-19 8:49 UTC (permalink / raw)
To: davem, avagin, pablo, kadlec, fw, yoshfuji, afaerber,
steffen.klassert, herbert, johannes, netdev, ktkhai
These pernet_operations create and destroy sysctl tables.
They are not touched by another net pernet_operations.
So, it's possible to execute them in parallel with others.
Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
---
net/ipv6/sysctl_net_ipv6.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/net/ipv6/sysctl_net_ipv6.c b/net/ipv6/sysctl_net_ipv6.c
index a789a8ac6a64..262f791f1b9b 100644
--- a/net/ipv6/sysctl_net_ipv6.c
+++ b/net/ipv6/sysctl_net_ipv6.c
@@ -251,6 +251,7 @@ static void __net_exit ipv6_sysctl_net_exit(struct net *net)
static struct pernet_operations ipv6_sysctl_net_ops = {
.init = ipv6_sysctl_net_init,
.exit = ipv6_sysctl_net_exit,
+ .async = true,
};
static struct ctl_table_header *ip6_header;
^ permalink raw reply related [flat|nested] 19+ messages in thread* [PATCH 10/16] net: Convert ping_v6_net_ops
2018-02-19 8:47 [PATCH 00/16] Converting pernet_operations (part #2) Kirill Tkhai
` (8 preceding siblings ...)
2018-02-19 8:49 ` [PATCH 09/16] net: Convert ipv6_sysctl_net_ops Kirill Tkhai
@ 2018-02-19 8:49 ` Kirill Tkhai
2018-02-19 8:50 ` [PATCH 11/16] net: Convert ip6_flowlabel_net_ops Kirill Tkhai
` (7 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: Kirill Tkhai @ 2018-02-19 8:49 UTC (permalink / raw)
To: davem, avagin, pablo, kadlec, fw, yoshfuji, afaerber,
steffen.klassert, herbert, johannes, netdev, ktkhai
These pernet_operations only register and unregister /proc
entries, so it's possible to mark them async.
Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
---
net/ipv6/ping.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/net/ipv6/ping.c b/net/ipv6/ping.c
index d12c55dad7d1..318c6e914234 100644
--- a/net/ipv6/ping.c
+++ b/net/ipv6/ping.c
@@ -240,6 +240,7 @@ static void __net_init ping_v6_proc_exit_net(struct net *net)
static struct pernet_operations ping_v6_net_ops = {
.init = ping_v6_proc_init_net,
.exit = ping_v6_proc_exit_net,
+ .async = true,
};
#endif
^ permalink raw reply related [flat|nested] 19+ messages in thread* [PATCH 11/16] net: Convert ip6_flowlabel_net_ops
2018-02-19 8:47 [PATCH 00/16] Converting pernet_operations (part #2) Kirill Tkhai
` (9 preceding siblings ...)
2018-02-19 8:49 ` [PATCH 10/16] net: Convert ping_v6_net_ops Kirill Tkhai
@ 2018-02-19 8:50 ` Kirill Tkhai
2018-02-19 8:50 ` [PATCH 12/16] net: Convert xfrm6_net_ops Kirill Tkhai
` (6 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: Kirill Tkhai @ 2018-02-19 8:50 UTC (permalink / raw)
To: davem, avagin, pablo, kadlec, fw, yoshfuji, afaerber,
steffen.klassert, herbert, johannes, netdev, ktkhai
These pernet_operations create and destroy /proc entries.
ip6_fl_purge() makes almost the same actions as timer
ip6_fl_gc_timer does, and as it can be executed in parallel
with ip6_fl_purge(), two parallel ip6_fl_purge() may be
executed. So, we can mark it async.
Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
---
net/ipv6/ip6_flowlabel.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/net/ipv6/ip6_flowlabel.c b/net/ipv6/ip6_flowlabel.c
index 3dab664ff503..6ddf52282894 100644
--- a/net/ipv6/ip6_flowlabel.c
+++ b/net/ipv6/ip6_flowlabel.c
@@ -873,6 +873,7 @@ static void __net_exit ip6_flowlabel_net_exit(struct net *net)
static struct pernet_operations ip6_flowlabel_net_ops = {
.init = ip6_flowlabel_proc_init,
.exit = ip6_flowlabel_net_exit,
+ .async = true,
};
int ip6_flowlabel_init(void)
^ permalink raw reply related [flat|nested] 19+ messages in thread* [PATCH 12/16] net: Convert xfrm6_net_ops
2018-02-19 8:47 [PATCH 00/16] Converting pernet_operations (part #2) Kirill Tkhai
` (10 preceding siblings ...)
2018-02-19 8:50 ` [PATCH 11/16] net: Convert ip6_flowlabel_net_ops Kirill Tkhai
@ 2018-02-19 8:50 ` Kirill Tkhai
2018-02-19 8:50 ` [PATCH 13/16] net: Convert fib6_net_ops, ipv6_addr_label_ops and ip6_segments_ops Kirill Tkhai
` (5 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: Kirill Tkhai @ 2018-02-19 8:50 UTC (permalink / raw)
To: davem, avagin, pablo, kadlec, fw, yoshfuji, afaerber,
steffen.klassert, herbert, johannes, netdev, ktkhai
These pernet_operations create sysctl tables and
initialize net::xfrm.xfrm6_dst_ops used for routing.
It doesn't look like another pernet_operations send
ipv6 packets to foreign net namespaces, so it should
be safe to mark the pernet_operations as async.
Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
---
net/ipv6/xfrm6_policy.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/net/ipv6/xfrm6_policy.c b/net/ipv6/xfrm6_policy.c
index 09fb44ee3b45..88cd0c90fa81 100644
--- a/net/ipv6/xfrm6_policy.c
+++ b/net/ipv6/xfrm6_policy.c
@@ -395,6 +395,7 @@ static void __net_exit xfrm6_net_exit(struct net *net)
static struct pernet_operations xfrm6_net_ops = {
.init = xfrm6_net_init,
.exit = xfrm6_net_exit,
+ .async = true,
};
int __init xfrm6_init(void)
^ permalink raw reply related [flat|nested] 19+ messages in thread* [PATCH 13/16] net: Convert fib6_net_ops, ipv6_addr_label_ops and ip6_segments_ops
2018-02-19 8:47 [PATCH 00/16] Converting pernet_operations (part #2) Kirill Tkhai
` (11 preceding siblings ...)
2018-02-19 8:50 ` [PATCH 12/16] net: Convert xfrm6_net_ops Kirill Tkhai
@ 2018-02-19 8:50 ` Kirill Tkhai
2018-02-19 8:50 ` [PATCH 14/16] net: Convert ip6_frags_ops Kirill Tkhai
` (4 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: Kirill Tkhai @ 2018-02-19 8:50 UTC (permalink / raw)
To: davem, avagin, pablo, kadlec, fw, yoshfuji, afaerber,
steffen.klassert, herbert, johannes, netdev, ktkhai
These pernet_operations register and unregister tables
and lists for packets forwarding. All of the entities
are per-net. Init methods makes simple initializations,
and since net is not visible for foreigners at the time
it is working, it can't race with anything. Exit method
is executed when there are only local devices, and there
mustn't be packets in-flight. Also, it looks like no one
pernet_operations want to send ipv6 packets to foreign
net. The same reasons are for ipv6_addr_label_ops and
ip6_segments_ops. So, we are able to mark all them as
async.
Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
---
net/ipv6/addrlabel.c | 1 +
net/ipv6/ip6_fib.c | 1 +
net/ipv6/seg6.c | 1 +
3 files changed, 3 insertions(+)
diff --git a/net/ipv6/addrlabel.c b/net/ipv6/addrlabel.c
index 1d6ced37ad71..ba2e63633370 100644
--- a/net/ipv6/addrlabel.c
+++ b/net/ipv6/addrlabel.c
@@ -344,6 +344,7 @@ static void __net_exit ip6addrlbl_net_exit(struct net *net)
static struct pernet_operations ipv6_addr_label_ops = {
.init = ip6addrlbl_net_init,
.exit = ip6addrlbl_net_exit,
+ .async = true,
};
int __init ipv6_addr_label_init(void)
diff --git a/net/ipv6/ip6_fib.c b/net/ipv6/ip6_fib.c
index 92b8d8c75eed..cab95cf3b39f 100644
--- a/net/ipv6/ip6_fib.c
+++ b/net/ipv6/ip6_fib.c
@@ -2160,6 +2160,7 @@ static void fib6_net_exit(struct net *net)
static struct pernet_operations fib6_net_ops = {
.init = fib6_net_init,
.exit = fib6_net_exit,
+ .async = true,
};
int __init fib6_init(void)
diff --git a/net/ipv6/seg6.c b/net/ipv6/seg6.c
index 7f5621d09571..c3f13c3bd8a9 100644
--- a/net/ipv6/seg6.c
+++ b/net/ipv6/seg6.c
@@ -395,6 +395,7 @@ static void __net_exit seg6_net_exit(struct net *net)
static struct pernet_operations ip6_segments_ops = {
.init = seg6_net_init,
.exit = seg6_net_exit,
+ .async = true,
};
static const struct genl_ops seg6_genl_ops[] = {
^ permalink raw reply related [flat|nested] 19+ messages in thread* [PATCH 14/16] net: Convert ip6_frags_ops
2018-02-19 8:47 [PATCH 00/16] Converting pernet_operations (part #2) Kirill Tkhai
` (12 preceding siblings ...)
2018-02-19 8:50 ` [PATCH 13/16] net: Convert fib6_net_ops, ipv6_addr_label_ops and ip6_segments_ops Kirill Tkhai
@ 2018-02-19 8:50 ` Kirill Tkhai
2018-02-19 8:50 ` [PATCH 15/16] net: Convert ip_tables_net_ops, udplite6_net_ops and xt_net_ops Kirill Tkhai
` (3 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: Kirill Tkhai @ 2018-02-19 8:50 UTC (permalink / raw)
To: davem, avagin, pablo, kadlec, fw, yoshfuji, afaerber,
steffen.klassert, herbert, johannes, netdev, ktkhai
Exit methods calls inet_frags_exit_net() with global ip6_frags
as argument. So, after we make the pernet_operations async,
a pair of exit methods may be called to iterate this hash table.
Since there is inet_frag_worker(), which already may work
in parallel with inet_frags_exit_net(), and it can make the same
cleanup, that inet_frags_exit_net() does, it's safe. So we may
mark these pernet_operations as async.
Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
---
net/ipv6/reassembly.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/net/ipv6/reassembly.c b/net/ipv6/reassembly.c
index afbc000ad4f2..b5da69c83123 100644
--- a/net/ipv6/reassembly.c
+++ b/net/ipv6/reassembly.c
@@ -733,6 +733,7 @@ static void __net_exit ipv6_frags_exit_net(struct net *net)
static struct pernet_operations ip6_frags_ops = {
.init = ipv6_frags_init_net,
.exit = ipv6_frags_exit_net,
+ .async = true,
};
int __init ipv6_frag_init(void)
^ permalink raw reply related [flat|nested] 19+ messages in thread* [PATCH 15/16] net: Convert ip_tables_net_ops, udplite6_net_ops and xt_net_ops
2018-02-19 8:47 [PATCH 00/16] Converting pernet_operations (part #2) Kirill Tkhai
` (13 preceding siblings ...)
2018-02-19 8:50 ` [PATCH 14/16] net: Convert ip6_frags_ops Kirill Tkhai
@ 2018-02-19 8:50 ` Kirill Tkhai
2018-02-19 8:50 ` [PATCH 16/16] net: Convert iptable_filter_net_ops Kirill Tkhai
` (2 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: Kirill Tkhai @ 2018-02-19 8:50 UTC (permalink / raw)
To: davem, avagin, pablo, kadlec, fw, yoshfuji, afaerber,
steffen.klassert, herbert, johannes, netdev, ktkhai
ip_tables_net_ops and udplite6_net_ops create and destroy /proc entries.
xt_net_ops does nothing.
So, we are able to mark them async.
Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
---
net/ipv4/netfilter/ip_tables.c | 1 +
net/ipv6/udplite.c | 1 +
net/netfilter/x_tables.c | 1 +
3 files changed, 3 insertions(+)
diff --git a/net/ipv4/netfilter/ip_tables.c b/net/ipv4/netfilter/ip_tables.c
index 9a71f3149507..39a7cf9160e6 100644
--- a/net/ipv4/netfilter/ip_tables.c
+++ b/net/ipv4/netfilter/ip_tables.c
@@ -1911,6 +1911,7 @@ static void __net_exit ip_tables_net_exit(struct net *net)
static struct pernet_operations ip_tables_net_ops = {
.init = ip_tables_net_init,
.exit = ip_tables_net_exit,
+ .async = true,
};
static int __init ip_tables_init(void)
diff --git a/net/ipv6/udplite.c b/net/ipv6/udplite.c
index 14ae32bb1f3d..f3839780dc31 100644
--- a/net/ipv6/udplite.c
+++ b/net/ipv6/udplite.c
@@ -123,6 +123,7 @@ static void __net_exit udplite6_proc_exit_net(struct net *net)
static struct pernet_operations udplite6_net_ops = {
.init = udplite6_proc_init_net,
.exit = udplite6_proc_exit_net,
+ .async = true,
};
int __init udplite6_proc_init(void)
diff --git a/net/netfilter/x_tables.c b/net/netfilter/x_tables.c
index 2f685ee1f9c8..a6a435d7c8f4 100644
--- a/net/netfilter/x_tables.c
+++ b/net/netfilter/x_tables.c
@@ -1765,6 +1765,7 @@ static void __net_exit xt_net_exit(struct net *net)
static struct pernet_operations xt_net_ops = {
.init = xt_net_init,
.exit = xt_net_exit,
+ .async = true,
};
static int __init xt_init(void)
^ permalink raw reply related [flat|nested] 19+ messages in thread* [PATCH 16/16] net: Convert iptable_filter_net_ops
2018-02-19 8:47 [PATCH 00/16] Converting pernet_operations (part #2) Kirill Tkhai
` (14 preceding siblings ...)
2018-02-19 8:50 ` [PATCH 15/16] net: Convert ip_tables_net_ops, udplite6_net_ops and xt_net_ops Kirill Tkhai
@ 2018-02-19 8:50 ` Kirill Tkhai
2018-02-19 13:51 ` [PATCH 00/16] Converting pernet_operations (part #2) Kirill Tkhai
2018-02-19 19:22 ` David Miller
17 siblings, 0 replies; 19+ messages in thread
From: Kirill Tkhai @ 2018-02-19 8:50 UTC (permalink / raw)
To: davem, avagin, pablo, kadlec, fw, yoshfuji, afaerber,
steffen.klassert, herbert, johannes, netdev, ktkhai
These pernet_operations register and unregister
net::ipv4.iptable_filter table. Since there are
no packets in-flight at the time of exit method
is working, iptables rules should not be touched.
Also, pernet_operations should not send ipv4
packets each other. So, it's safe to mark them
async.
Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
---
net/ipv4/netfilter/iptable_filter.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/net/ipv4/netfilter/iptable_filter.c b/net/ipv4/netfilter/iptable_filter.c
index 9ac92ea7b93c..c1c136a93911 100644
--- a/net/ipv4/netfilter/iptable_filter.c
+++ b/net/ipv4/netfilter/iptable_filter.c
@@ -87,6 +87,7 @@ static void __net_exit iptable_filter_net_exit(struct net *net)
static struct pernet_operations iptable_filter_net_ops = {
.init = iptable_filter_net_init,
.exit = iptable_filter_net_exit,
+ .async = true,
};
static int __init iptable_filter_init(void)
^ permalink raw reply related [flat|nested] 19+ messages in thread* Re: [PATCH 00/16] Converting pernet_operations (part #2)
2018-02-19 8:47 [PATCH 00/16] Converting pernet_operations (part #2) Kirill Tkhai
` (15 preceding siblings ...)
2018-02-19 8:50 ` [PATCH 16/16] net: Convert iptable_filter_net_ops Kirill Tkhai
@ 2018-02-19 13:51 ` Kirill Tkhai
2018-02-19 19:22 ` David Miller
17 siblings, 0 replies; 19+ messages in thread
From: Kirill Tkhai @ 2018-02-19 13:51 UTC (permalink / raw)
To: davem, avagin, pablo, kadlec, fw, yoshfuji, afaerber,
steffen.klassert, herbert, johannes, netdev
The topic has to contain [net-next]. Sorry for I forgot to add it.
Thanks.
On 19.02.2018 11:47, Kirill Tkhai wrote:
> This patchset continues to review and to convert pernet_operations
> to async. There are mostly ipv6, also some regular used netfilter
> pernet_operations are involved. One more converted is cfg80211_pernet_ops.
>
> ---
>
> Kirill Tkhai (16):
> net: Convert inet6_net_ops
> net: Convert cfg80211_pernet_ops
> net: Convert ip6mr_net_ops
> net: Convert icmpv6_sk_ops, ndisc_net_ops and igmp6_net_ops
> net: Convert raw6_net_ops, udplite6_net_ops, ipv6_proc_ops, if6_proc_net_ops and ip6_route_net_late_ops
> net: Convert ipv6_inetpeer_ops
> net: Convert fib6_rules_net_ops
> net: Convert tcpv6_net_ops
> net: Convert ipv6_sysctl_net_ops
> net: Convert ping_v6_net_ops
> net: Convert ip6_flowlabel_net_ops
> net: Convert xfrm6_net_ops
> net: Convert fib6_net_ops, ipv6_addr_label_ops and ip6_segments_ops
> net: Convert ip6_frags_ops
> net: Convert ip_tables_net_ops, udplite6_net_ops and xt_net_ops
> net: Convert iptable_filter_net_ops
>
>
> net/ipv4/netfilter/ip_tables.c | 1 +
> net/ipv4/netfilter/iptable_filter.c | 1 +
> net/ipv6/addrconf.c | 1 +
> net/ipv6/addrlabel.c | 1 +
> net/ipv6/af_inet6.c | 1 +
> net/ipv6/fib6_rules.c | 1 +
> net/ipv6/icmp.c | 1 +
> net/ipv6/ip6_fib.c | 1 +
> net/ipv6/ip6_flowlabel.c | 1 +
> net/ipv6/ip6mr.c | 1 +
> net/ipv6/mcast.c | 1 +
> net/ipv6/ndisc.c | 1 +
> net/ipv6/ping.c | 1 +
> net/ipv6/proc.c | 1 +
> net/ipv6/raw.c | 1 +
> net/ipv6/reassembly.c | 1 +
> net/ipv6/route.c | 3 +++
> net/ipv6/seg6.c | 1 +
> net/ipv6/sysctl_net_ipv6.c | 1 +
> net/ipv6/tcp_ipv6.c | 1 +
> net/ipv6/udplite.c | 1 +
> net/ipv6/xfrm6_policy.c | 1 +
> net/netfilter/x_tables.c | 1 +
> net/wireless/core.c | 1 +
> 24 files changed, 26 insertions(+)
>
> --
> Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
>
^ permalink raw reply [flat|nested] 19+ messages in thread* Re: [PATCH 00/16] Converting pernet_operations (part #2)
2018-02-19 8:47 [PATCH 00/16] Converting pernet_operations (part #2) Kirill Tkhai
` (16 preceding siblings ...)
2018-02-19 13:51 ` [PATCH 00/16] Converting pernet_operations (part #2) Kirill Tkhai
@ 2018-02-19 19:22 ` David Miller
17 siblings, 0 replies; 19+ messages in thread
From: David Miller @ 2018-02-19 19:22 UTC (permalink / raw)
To: ktkhai
Cc: avagin, pablo, kadlec, fw, yoshfuji, afaerber, steffen.klassert,
herbert, johannes, netdev
From: Kirill Tkhai <ktkhai@virtuozzo.com>
Date: Mon, 19 Feb 2018 11:47:55 +0300
> This patchset continues to review and to convert pernet_operations
> to async. There are mostly ipv6, also some regular used netfilter
> pernet_operations are involved. One more converted is cfg80211_pernet_ops.
Series applied.
Thanks for explaining why each transformation to async is legitimate
in each and every commit message, it made the review of this series
that much easier.
^ permalink raw reply [flat|nested] 19+ messages in thread