netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 00/16] Converting pernet_operations (part #5)
@ 2018-03-07  9:38 Kirill Tkhai
  2018-03-07  9:39 ` [PATCH net-next 01/16] net: Convert ip6 tables pernet_operations Kirill Tkhai
                   ` (16 more replies)
  0 siblings, 17 replies; 18+ messages in thread
From: Kirill Tkhai @ 2018-03-07  9:38 UTC (permalink / raw)
  To: davem, pablo, kadlec, fw, netdev, ktkhai

Hi,

this series continues to review and to convert pernet_operations
to make them possible to be executed in parallel for several
net namespaces in the same time. There are mostly netfilter
operations (and they should be the last netfilter's), also
there are two patches touching pktgen and xfrm.

Thanks,
Kirill
---

Kirill Tkhai (16):
      net: Convert ip6 tables pernet_operations
      net: Convert xfrm_user_net_ops
      net: Convert nf_tables_net_ops
      net: Convert nfnetlink_net_ops
      net: Convert nfnl_acct_ops
      net: Convert cttimeout_ops
      net: Convert nfnl_log_net_ops
      net: Convert nfnl_queue_net_ops
      net: Convert pg_net_ops
      net: Convert arptable_filter_net_ops
      net: Convert iptable_mangle_net_ops
      net: Convert iptable_nat_net_ops
      net: Convert iptable_raw_net_ops
      net: Convert iptable_security_net_ops
      net: Convert ipv4_net_ops
      net: Convet ipv6_net_ops


 net/core/pktgen.c                              |    1 +
 net/ipv4/netfilter/arptable_filter.c           |    1 +
 net/ipv4/netfilter/iptable_mangle.c            |    1 +
 net/ipv4/netfilter/iptable_nat.c               |    1 +
 net/ipv4/netfilter/iptable_raw.c               |    1 +
 net/ipv4/netfilter/iptable_security.c          |    1 +
 net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c |    1 +
 net/ipv6/netfilter/ip6table_filter.c           |    1 +
 net/ipv6/netfilter/ip6table_mangle.c           |    1 +
 net/ipv6/netfilter/ip6table_nat.c              |    1 +
 net/ipv6/netfilter/ip6table_raw.c              |    1 +
 net/ipv6/netfilter/ip6table_security.c         |    1 +
 net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c |    1 +
 net/netfilter/nf_tables_api.c                  |    1 +
 net/netfilter/nfnetlink.c                      |    1 +
 net/netfilter/nfnetlink_acct.c                 |    1 +
 net/netfilter/nfnetlink_cttimeout.c            |    1 +
 net/netfilter/nfnetlink_log.c                  |    1 +
 net/netfilter/nfnetlink_queue.c                |    1 +
 net/xfrm/xfrm_user.c                           |    1 +
 20 files changed, 20 insertions(+)

--
Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [PATCH net-next 01/16] net: Convert ip6 tables pernet_operations
  2018-03-07  9:38 [PATCH net-next 00/16] Converting pernet_operations (part #5) Kirill Tkhai
@ 2018-03-07  9:39 ` Kirill Tkhai
  2018-03-07  9:39 ` [PATCH net-next 02/16] net: Convert xfrm_user_net_ops Kirill Tkhai
                   ` (15 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: Kirill Tkhai @ 2018-03-07  9:39 UTC (permalink / raw)
  To: davem, pablo, kadlec, fw, netdev, ktkhai

The pernet_operations:

    ip6table_filter_net_ops
    ip6table_mangle_net_ops
    ip6table_nat_net_ops
    ip6table_raw_net_ops
    ip6table_security_net_ops

have exit methods, which call ip6t_unregister_table().
ip6table_filter_net_ops has init method registering
filter table.

Since there must not be in-flight ipv6 packets at the time
of pernet_operations execution and since pernet_operations
don't send ipv6 packets each other, these pernet_operations
are safe to be async.

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
---
 net/ipv6/netfilter/ip6table_filter.c   |    1 +
 net/ipv6/netfilter/ip6table_mangle.c   |    1 +
 net/ipv6/netfilter/ip6table_nat.c      |    1 +
 net/ipv6/netfilter/ip6table_raw.c      |    1 +
 net/ipv6/netfilter/ip6table_security.c |    1 +
 5 files changed, 5 insertions(+)

diff --git a/net/ipv6/netfilter/ip6table_filter.c b/net/ipv6/netfilter/ip6table_filter.c
index 1343077dde93..06561c84c0bc 100644
--- a/net/ipv6/netfilter/ip6table_filter.c
+++ b/net/ipv6/netfilter/ip6table_filter.c
@@ -87,6 +87,7 @@ static void __net_exit ip6table_filter_net_exit(struct net *net)
 static struct pernet_operations ip6table_filter_net_ops = {
 	.init = ip6table_filter_net_init,
 	.exit = ip6table_filter_net_exit,
+	.async = true,
 };
 
 static int __init ip6table_filter_init(void)
diff --git a/net/ipv6/netfilter/ip6table_mangle.c b/net/ipv6/netfilter/ip6table_mangle.c
index b0524b18c4fb..a11e25936b45 100644
--- a/net/ipv6/netfilter/ip6table_mangle.c
+++ b/net/ipv6/netfilter/ip6table_mangle.c
@@ -107,6 +107,7 @@ static void __net_exit ip6table_mangle_net_exit(struct net *net)
 
 static struct pernet_operations ip6table_mangle_net_ops = {
 	.exit = ip6table_mangle_net_exit,
+	.async = true,
 };
 
 static int __init ip6table_mangle_init(void)
diff --git a/net/ipv6/netfilter/ip6table_nat.c b/net/ipv6/netfilter/ip6table_nat.c
index 47306e45a80a..4475fd300bb6 100644
--- a/net/ipv6/netfilter/ip6table_nat.c
+++ b/net/ipv6/netfilter/ip6table_nat.c
@@ -131,6 +131,7 @@ static void __net_exit ip6table_nat_net_exit(struct net *net)
 
 static struct pernet_operations ip6table_nat_net_ops = {
 	.exit	= ip6table_nat_net_exit,
+	.async	= true,
 };
 
 static int __init ip6table_nat_init(void)
diff --git a/net/ipv6/netfilter/ip6table_raw.c b/net/ipv6/netfilter/ip6table_raw.c
index 710fa0806c37..a88f3b1995b1 100644
--- a/net/ipv6/netfilter/ip6table_raw.c
+++ b/net/ipv6/netfilter/ip6table_raw.c
@@ -75,6 +75,7 @@ static void __net_exit ip6table_raw_net_exit(struct net *net)
 
 static struct pernet_operations ip6table_raw_net_ops = {
 	.exit = ip6table_raw_net_exit,
+	.async = true,
 };
 
 static int __init ip6table_raw_init(void)
diff --git a/net/ipv6/netfilter/ip6table_security.c b/net/ipv6/netfilter/ip6table_security.c
index cf26ccb04056..320048c008dc 100644
--- a/net/ipv6/netfilter/ip6table_security.c
+++ b/net/ipv6/netfilter/ip6table_security.c
@@ -74,6 +74,7 @@ static void __net_exit ip6table_security_net_exit(struct net *net)
 
 static struct pernet_operations ip6table_security_net_ops = {
 	.exit = ip6table_security_net_exit,
+	.async = true,
 };
 
 static int __init ip6table_security_init(void)

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH net-next 02/16] net: Convert xfrm_user_net_ops
  2018-03-07  9:38 [PATCH net-next 00/16] Converting pernet_operations (part #5) Kirill Tkhai
  2018-03-07  9:39 ` [PATCH net-next 01/16] net: Convert ip6 tables pernet_operations Kirill Tkhai
@ 2018-03-07  9:39 ` Kirill Tkhai
  2018-03-07  9:39 ` [PATCH net-next 03/16] net: Convert nf_tables_net_ops Kirill Tkhai
                   ` (14 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: Kirill Tkhai @ 2018-03-07  9:39 UTC (permalink / raw)
  To: davem, pablo, kadlec, fw, netdev, ktkhai

These pernet_operations create and destroy net::xfrm::nlsk
socket of NETLINK_XFRM. There is only entry point, where
it's dereferenced, it's xfrm_user_rcv_msg(). There is no
in-kernel senders to this socket.

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
---
 net/xfrm/xfrm_user.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c
index 7f52b8eb177d..aff2e84ec761 100644
--- a/net/xfrm/xfrm_user.c
+++ b/net/xfrm/xfrm_user.c
@@ -3258,6 +3258,7 @@ static void __net_exit xfrm_user_net_exit(struct list_head *net_exit_list)
 static struct pernet_operations xfrm_user_net_ops = {
 	.init	    = xfrm_user_net_init,
 	.exit_batch = xfrm_user_net_exit,
+	.async	    = true,
 };
 
 static int __init xfrm_user_init(void)

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH net-next 03/16] net: Convert nf_tables_net_ops
  2018-03-07  9:38 [PATCH net-next 00/16] Converting pernet_operations (part #5) Kirill Tkhai
  2018-03-07  9:39 ` [PATCH net-next 01/16] net: Convert ip6 tables pernet_operations Kirill Tkhai
  2018-03-07  9:39 ` [PATCH net-next 02/16] net: Convert xfrm_user_net_ops Kirill Tkhai
@ 2018-03-07  9:39 ` Kirill Tkhai
  2018-03-07  9:39 ` [PATCH net-next 04/16] net: Convert nfnetlink_net_ops Kirill Tkhai
                   ` (13 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: Kirill Tkhai @ 2018-03-07  9:39 UTC (permalink / raw)
  To: davem, pablo, kadlec, fw, netdev, ktkhai

These pernet_operations looks nicely separated per-net.
Exit method unregisters net's nf tables objects.
We allow them be executed in parallel.

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
---
 net/netfilter/nf_tables_api.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c
index 558593e6a0a3..8e19c86d1aa6 100644
--- a/net/netfilter/nf_tables_api.c
+++ b/net/netfilter/nf_tables_api.c
@@ -6596,6 +6596,7 @@ static void __net_exit nf_tables_exit_net(struct net *net)
 static struct pernet_operations nf_tables_net_ops = {
 	.init	= nf_tables_init_net,
 	.exit	= nf_tables_exit_net,
+	.async	= true,
 };
 
 static int __init nf_tables_module_init(void)

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH net-next 04/16] net: Convert nfnetlink_net_ops
  2018-03-07  9:38 [PATCH net-next 00/16] Converting pernet_operations (part #5) Kirill Tkhai
                   ` (2 preceding siblings ...)
  2018-03-07  9:39 ` [PATCH net-next 03/16] net: Convert nf_tables_net_ops Kirill Tkhai
@ 2018-03-07  9:39 ` Kirill Tkhai
  2018-03-07  9:39 ` [PATCH net-next 05/16] net: Convert nfnl_acct_ops Kirill Tkhai
                   ` (12 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: Kirill Tkhai @ 2018-03-07  9:39 UTC (permalink / raw)
  To: davem, pablo, kadlec, fw, netdev, ktkhai

These pernet_operations create and destroy net::nfnl
socket of NETLINK_NETFILTER code. There are no other
places, where such type the socket is created, except
these pernet_operations. It seem other pernet_operations
depending on CONFIG_NETFILTER_NETLINK send messages
to this socket. So, we mark it async.

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
---
 net/netfilter/nfnetlink.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/net/netfilter/nfnetlink.c b/net/netfilter/nfnetlink.c
index 03ead8a9e90c..84fc4954862d 100644
--- a/net/netfilter/nfnetlink.c
+++ b/net/netfilter/nfnetlink.c
@@ -566,6 +566,7 @@ static void __net_exit nfnetlink_net_exit_batch(struct list_head *net_exit_list)
 static struct pernet_operations nfnetlink_net_ops = {
 	.init		= nfnetlink_net_init,
 	.exit_batch	= nfnetlink_net_exit_batch,
+	.async		= true,
 };
 
 static int __init nfnetlink_init(void)

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH net-next 05/16] net: Convert nfnl_acct_ops
  2018-03-07  9:38 [PATCH net-next 00/16] Converting pernet_operations (part #5) Kirill Tkhai
                   ` (3 preceding siblings ...)
  2018-03-07  9:39 ` [PATCH net-next 04/16] net: Convert nfnetlink_net_ops Kirill Tkhai
@ 2018-03-07  9:39 ` Kirill Tkhai
  2018-03-07  9:39 ` [PATCH net-next 06/16] net: Convert cttimeout_ops Kirill Tkhai
                   ` (11 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: Kirill Tkhai @ 2018-03-07  9:39 UTC (permalink / raw)
  To: davem, pablo, kadlec, fw, netdev, ktkhai

These pernet_operations look closed in themself,
and there are no other users of net::nfnl_acct_list
outside. They are safe to be executed for several
net namespaces in parallel.

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
---
 net/netfilter/nfnetlink_acct.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/net/netfilter/nfnetlink_acct.c b/net/netfilter/nfnetlink_acct.c
index 88d427f9f9e6..8d9f18bb8840 100644
--- a/net/netfilter/nfnetlink_acct.c
+++ b/net/netfilter/nfnetlink_acct.c
@@ -515,6 +515,7 @@ static void __net_exit nfnl_acct_net_exit(struct net *net)
 static struct pernet_operations nfnl_acct_ops = {
         .init   = nfnl_acct_net_init,
         .exit   = nfnl_acct_net_exit,
+	.async	= true,
 };
 
 static int __init nfnl_acct_init(void)

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH net-next 06/16] net: Convert cttimeout_ops
  2018-03-07  9:38 [PATCH net-next 00/16] Converting pernet_operations (part #5) Kirill Tkhai
                   ` (4 preceding siblings ...)
  2018-03-07  9:39 ` [PATCH net-next 05/16] net: Convert nfnl_acct_ops Kirill Tkhai
@ 2018-03-07  9:39 ` Kirill Tkhai
  2018-03-07  9:40 ` [PATCH net-next 07/16] net: Convert nfnl_log_net_ops Kirill Tkhai
                   ` (10 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: Kirill Tkhai @ 2018-03-07  9:39 UTC (permalink / raw)
  To: davem, pablo, kadlec, fw, netdev, ktkhai

These pernet_operations also look closed in themself.
Exit method touch only per-net structures, so it's
safe to execute them for several net namespaces in parallel.

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
---
 net/netfilter/nfnetlink_cttimeout.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/net/netfilter/nfnetlink_cttimeout.c b/net/netfilter/nfnetlink_cttimeout.c
index 95b04702a655..6819300f7fb7 100644
--- a/net/netfilter/nfnetlink_cttimeout.c
+++ b/net/netfilter/nfnetlink_cttimeout.c
@@ -586,6 +586,7 @@ static void __net_exit cttimeout_net_exit(struct net *net)
 static struct pernet_operations cttimeout_ops = {
 	.init	= cttimeout_net_init,
 	.exit	= cttimeout_net_exit,
+	.async	= true,
 };
 
 static int __init cttimeout_init(void)

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH net-next 07/16] net: Convert nfnl_log_net_ops
  2018-03-07  9:38 [PATCH net-next 00/16] Converting pernet_operations (part #5) Kirill Tkhai
                   ` (5 preceding siblings ...)
  2018-03-07  9:39 ` [PATCH net-next 06/16] net: Convert cttimeout_ops Kirill Tkhai
@ 2018-03-07  9:40 ` Kirill Tkhai
  2018-03-07  9:40 ` [PATCH net-next 08/16] net: Convert nfnl_queue_net_ops Kirill Tkhai
                   ` (9 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: Kirill Tkhai @ 2018-03-07  9:40 UTC (permalink / raw)
  To: davem, pablo, kadlec, fw, netdev, ktkhai

These pernet_operations create and destroy /proc entries.
Also, exit method unsets nfulnl_logger. The logger is not
set by default, and it becomes bound via userspace request.
So, they look safe to be made async.

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
---
 net/netfilter/nfnetlink_log.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/net/netfilter/nfnetlink_log.c b/net/netfilter/nfnetlink_log.c
index 7b46aa4c478d..b21ef79849a1 100644
--- a/net/netfilter/nfnetlink_log.c
+++ b/net/netfilter/nfnetlink_log.c
@@ -1108,6 +1108,7 @@ static struct pernet_operations nfnl_log_net_ops = {
 	.exit	= nfnl_log_net_exit,
 	.id	= &nfnl_log_net_id,
 	.size	= sizeof(struct nfnl_log_net),
+	.async	= true,
 };
 
 static int __init nfnetlink_log_init(void)

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH net-next 08/16] net: Convert nfnl_queue_net_ops
  2018-03-07  9:38 [PATCH net-next 00/16] Converting pernet_operations (part #5) Kirill Tkhai
                   ` (6 preceding siblings ...)
  2018-03-07  9:40 ` [PATCH net-next 07/16] net: Convert nfnl_log_net_ops Kirill Tkhai
@ 2018-03-07  9:40 ` Kirill Tkhai
  2018-03-07  9:40 ` [PATCH net-next 09/16] net: Convert pg_net_ops Kirill Tkhai
                   ` (8 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: Kirill Tkhai @ 2018-03-07  9:40 UTC (permalink / raw)
  To: davem, pablo, kadlec, fw, netdev, ktkhai

These pernet_operations register and unregister net::nf::queue_handler
and /proc entry. The handler is accessed only under RCU, so this looks
safe to convert them.

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
---
 net/netfilter/nfnetlink_queue.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/net/netfilter/nfnetlink_queue.c b/net/netfilter/nfnetlink_queue.c
index 8bba23160a68..59e2833c17f1 100644
--- a/net/netfilter/nfnetlink_queue.c
+++ b/net/netfilter/nfnetlink_queue.c
@@ -1528,6 +1528,7 @@ static struct pernet_operations nfnl_queue_net_ops = {
 	.exit_batch	= nfnl_queue_net_exit_batch,
 	.id		= &nfnl_queue_net_id,
 	.size		= sizeof(struct nfnl_queue_net),
+	.async		= true,
 };
 
 static int __init nfnetlink_queue_init(void)

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH net-next 09/16] net: Convert pg_net_ops
  2018-03-07  9:38 [PATCH net-next 00/16] Converting pernet_operations (part #5) Kirill Tkhai
                   ` (7 preceding siblings ...)
  2018-03-07  9:40 ` [PATCH net-next 08/16] net: Convert nfnl_queue_net_ops Kirill Tkhai
@ 2018-03-07  9:40 ` Kirill Tkhai
  2018-03-07  9:40 ` [PATCH net-next 10/16] net: Convert arptable_filter_net_ops Kirill Tkhai
                   ` (7 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: Kirill Tkhai @ 2018-03-07  9:40 UTC (permalink / raw)
  To: davem, pablo, kadlec, fw, netdev, ktkhai

These pernet_operations create per-net pktgen threads
and /proc entries. These pernet subsys looks closed
in itself, and there are no pernet_operations outside
this file, which are interested in the threads.
Init and/or exit methods look safe to be executed
in parallel.

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
---
 net/core/pktgen.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/net/core/pktgen.c b/net/core/pktgen.c
index b8ab5c829511..d81bddd1bb80 100644
--- a/net/core/pktgen.c
+++ b/net/core/pktgen.c
@@ -3851,6 +3851,7 @@ static struct pernet_operations pg_net_ops = {
 	.exit = pg_net_exit,
 	.id   = &pg_net_id,
 	.size = sizeof(struct pktgen_net),
+	.async = true,
 };
 
 static int __init pg_init(void)

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH net-next 10/16] net: Convert arptable_filter_net_ops
  2018-03-07  9:38 [PATCH net-next 00/16] Converting pernet_operations (part #5) Kirill Tkhai
                   ` (8 preceding siblings ...)
  2018-03-07  9:40 ` [PATCH net-next 09/16] net: Convert pg_net_ops Kirill Tkhai
@ 2018-03-07  9:40 ` Kirill Tkhai
  2018-03-07  9:40 ` [PATCH net-next 11/16] net: Convert iptable_mangle_net_ops Kirill Tkhai
                   ` (6 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: Kirill Tkhai @ 2018-03-07  9:40 UTC (permalink / raw)
  To: davem, pablo, kadlec, fw, netdev, ktkhai

These pernet_operations unregister net::ipv4::arptable_filter.
Another net/pernet_operations do not send arp packets to foreign
net namespaces. So, we mark them async.

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
---
 net/ipv4/netfilter/arptable_filter.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/net/ipv4/netfilter/arptable_filter.c b/net/ipv4/netfilter/arptable_filter.c
index 8f8713b4388f..49c2490193ae 100644
--- a/net/ipv4/netfilter/arptable_filter.c
+++ b/net/ipv4/netfilter/arptable_filter.c
@@ -65,6 +65,7 @@ static void __net_exit arptable_filter_net_exit(struct net *net)
 
 static struct pernet_operations arptable_filter_net_ops = {
 	.exit = arptable_filter_net_exit,
+	.async = true,
 };
 
 static int __init arptable_filter_init(void)

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH net-next 11/16] net: Convert iptable_mangle_net_ops
  2018-03-07  9:38 [PATCH net-next 00/16] Converting pernet_operations (part #5) Kirill Tkhai
                   ` (9 preceding siblings ...)
  2018-03-07  9:40 ` [PATCH net-next 10/16] net: Convert arptable_filter_net_ops Kirill Tkhai
@ 2018-03-07  9:40 ` Kirill Tkhai
  2018-03-07  9:40 ` [PATCH net-next 12/16] net: Convert iptable_nat_net_ops Kirill Tkhai
                   ` (5 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: Kirill Tkhai @ 2018-03-07  9:40 UTC (permalink / raw)
  To: davem, pablo, kadlec, fw, netdev, ktkhai

These pernet_operations unregister net::ipv4::iptable_mangle table.
Another net/pernet_operations do not send ipv4 packets to foreign
net namespaces. So, we mark them async.

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
---
 net/ipv4/netfilter/iptable_mangle.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/net/ipv4/netfilter/iptable_mangle.c b/net/ipv4/netfilter/iptable_mangle.c
index dea138ca8925..f6074059531a 100644
--- a/net/ipv4/netfilter/iptable_mangle.c
+++ b/net/ipv4/netfilter/iptable_mangle.c
@@ -113,6 +113,7 @@ static void __net_exit iptable_mangle_net_exit(struct net *net)
 
 static struct pernet_operations iptable_mangle_net_ops = {
 	.exit = iptable_mangle_net_exit,
+	.async = true,
 };
 
 static int __init iptable_mangle_init(void)

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH net-next 12/16] net: Convert iptable_nat_net_ops
  2018-03-07  9:38 [PATCH net-next 00/16] Converting pernet_operations (part #5) Kirill Tkhai
                   ` (10 preceding siblings ...)
  2018-03-07  9:40 ` [PATCH net-next 11/16] net: Convert iptable_mangle_net_ops Kirill Tkhai
@ 2018-03-07  9:40 ` Kirill Tkhai
  2018-03-07  9:40 ` [PATCH net-next 13/16] net: Convert iptable_raw_net_ops Kirill Tkhai
                   ` (4 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: Kirill Tkhai @ 2018-03-07  9:40 UTC (permalink / raw)
  To: davem, pablo, kadlec, fw, netdev, ktkhai

These pernet_operations unregister net::ipv4::nat_table table.
Another net/pernet_operations do not send ipv4 packets to foreign
net namespaces. So, we mark them async.

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
---
 net/ipv4/netfilter/iptable_nat.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/net/ipv4/netfilter/iptable_nat.c b/net/ipv4/netfilter/iptable_nat.c
index 0f7255cc65ee..b771af74be79 100644
--- a/net/ipv4/netfilter/iptable_nat.c
+++ b/net/ipv4/netfilter/iptable_nat.c
@@ -129,6 +129,7 @@ static void __net_exit iptable_nat_net_exit(struct net *net)
 
 static struct pernet_operations iptable_nat_net_ops = {
 	.exit	= iptable_nat_net_exit,
+	.async	= true,
 };
 
 static int __init iptable_nat_init(void)

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH net-next 13/16] net: Convert iptable_raw_net_ops
  2018-03-07  9:38 [PATCH net-next 00/16] Converting pernet_operations (part #5) Kirill Tkhai
                   ` (11 preceding siblings ...)
  2018-03-07  9:40 ` [PATCH net-next 12/16] net: Convert iptable_nat_net_ops Kirill Tkhai
@ 2018-03-07  9:40 ` Kirill Tkhai
  2018-03-07  9:41 ` [PATCH net-next 14/16] net: Convert iptable_security_net_ops Kirill Tkhai
                   ` (3 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: Kirill Tkhai @ 2018-03-07  9:40 UTC (permalink / raw)
  To: davem, pablo, kadlec, fw, netdev, ktkhai

These pernet_operations unregister net::ipv4::iptable_raw table.
Another net/pernet_operations do not send ipv4 packets to foreign
net namespaces. So, we mark them async.

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
---
 net/ipv4/netfilter/iptable_raw.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/net/ipv4/netfilter/iptable_raw.c b/net/ipv4/netfilter/iptable_raw.c
index 960625aabf04..963753e50842 100644
--- a/net/ipv4/netfilter/iptable_raw.c
+++ b/net/ipv4/netfilter/iptable_raw.c
@@ -76,6 +76,7 @@ static void __net_exit iptable_raw_net_exit(struct net *net)
 
 static struct pernet_operations iptable_raw_net_ops = {
 	.exit = iptable_raw_net_exit,
+	.async = true,
 };
 
 static int __init iptable_raw_init(void)

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH net-next 14/16] net: Convert iptable_security_net_ops
  2018-03-07  9:38 [PATCH net-next 00/16] Converting pernet_operations (part #5) Kirill Tkhai
                   ` (12 preceding siblings ...)
  2018-03-07  9:40 ` [PATCH net-next 13/16] net: Convert iptable_raw_net_ops Kirill Tkhai
@ 2018-03-07  9:41 ` Kirill Tkhai
  2018-03-07  9:41 ` [PATCH net-next 15/16] net: Convert ipv4_net_ops Kirill Tkhai
                   ` (2 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: Kirill Tkhai @ 2018-03-07  9:41 UTC (permalink / raw)
  To: davem, pablo, kadlec, fw, netdev, ktkhai

These pernet_operations unregister net::ipv4::iptable_security table.
Another net/pernet_operations do not send ipv4 packets to foreign
net namespaces. So, we mark them async.

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
---
 net/ipv4/netfilter/iptable_security.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/net/ipv4/netfilter/iptable_security.c b/net/ipv4/netfilter/iptable_security.c
index e5379fe57b64..c40d6b3d8b6a 100644
--- a/net/ipv4/netfilter/iptable_security.c
+++ b/net/ipv4/netfilter/iptable_security.c
@@ -76,6 +76,7 @@ static void __net_exit iptable_security_net_exit(struct net *net)
 
 static struct pernet_operations iptable_security_net_ops = {
 	.exit = iptable_security_net_exit,
+	.async = true,
 };
 
 static int __init iptable_security_init(void)

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH net-next 15/16] net: Convert ipv4_net_ops
  2018-03-07  9:38 [PATCH net-next 00/16] Converting pernet_operations (part #5) Kirill Tkhai
                   ` (13 preceding siblings ...)
  2018-03-07  9:41 ` [PATCH net-next 14/16] net: Convert iptable_security_net_ops Kirill Tkhai
@ 2018-03-07  9:41 ` Kirill Tkhai
  2018-03-07  9:41 ` [PATCH net-next 16/16] net: Convet ipv6_net_ops Kirill Tkhai
  2018-03-08 17:40 ` [PATCH net-next 00/16] Converting pernet_operations (part #5) David Miller
  16 siblings, 0 replies; 18+ messages in thread
From: Kirill Tkhai @ 2018-03-07  9:41 UTC (permalink / raw)
  To: davem, pablo, kadlec, fw, netdev, ktkhai

These pernet_operations register and unregister bunch
of nf_conntrack_l4proto. Exit method unregisters related
sysctl, init method calls init_net and get_net_proto.
The whole builtin_l4proto4 array has pretty simple
init_net and get_net_proto methods. The first one register
sysctl table, the second one is just RO memory dereference.
So, these pernet_operations are safe to be marked as async.

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
---
 net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c b/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c
index b50721d9d30e..6531f69db010 100644
--- a/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c
+++ b/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c
@@ -399,6 +399,7 @@ static struct pernet_operations ipv4_net_ops = {
 	.exit = ipv4_net_exit,
 	.id = &conntrack4_net_id,
 	.size = sizeof(struct conntrack4_net),
+	.async = true,
 };
 
 static int __init nf_conntrack_l3proto_ipv4_init(void)

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH net-next 16/16] net: Convet ipv6_net_ops
  2018-03-07  9:38 [PATCH net-next 00/16] Converting pernet_operations (part #5) Kirill Tkhai
                   ` (14 preceding siblings ...)
  2018-03-07  9:41 ` [PATCH net-next 15/16] net: Convert ipv4_net_ops Kirill Tkhai
@ 2018-03-07  9:41 ` Kirill Tkhai
  2018-03-08 17:40 ` [PATCH net-next 00/16] Converting pernet_operations (part #5) David Miller
  16 siblings, 0 replies; 18+ messages in thread
From: Kirill Tkhai @ 2018-03-07  9:41 UTC (permalink / raw)
  To: davem, pablo, kadlec, fw, netdev, ktkhai

These pernet_operations are similar to ipv4_net_ops.
They are safe to be async.

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
---
 net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c b/net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c
index 663827ee3cf8..ba54bb3bd1e4 100644
--- a/net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c
+++ b/net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c
@@ -401,6 +401,7 @@ static struct pernet_operations ipv6_net_ops = {
 	.exit = ipv6_net_exit,
 	.id = &conntrack6_net_id,
 	.size = sizeof(struct conntrack6_net),
+	.async = true,
 };
 
 static int __init nf_conntrack_l3proto_ipv6_init(void)

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* Re: [PATCH net-next 00/16] Converting pernet_operations (part #5)
  2018-03-07  9:38 [PATCH net-next 00/16] Converting pernet_operations (part #5) Kirill Tkhai
                   ` (15 preceding siblings ...)
  2018-03-07  9:41 ` [PATCH net-next 16/16] net: Convet ipv6_net_ops Kirill Tkhai
@ 2018-03-08 17:40 ` David Miller
  16 siblings, 0 replies; 18+ messages in thread
From: David Miller @ 2018-03-08 17:40 UTC (permalink / raw)
  To: ktkhai; +Cc: pablo, kadlec, fw, netdev

From: Kirill Tkhai <ktkhai@virtuozzo.com>
Date: Wed, 07 Mar 2018 12:38:57 +0300

> this series continues to review and to convert pernet_operations
> to make them possible to be executed in parallel for several
> net namespaces in the same time. There are mostly netfilter
> operations (and they should be the last netfilter's), also
> there are two patches touching pktgen and xfrm.

Series applied, thanks.

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2018-03-08 17:40 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-03-07  9:38 [PATCH net-next 00/16] Converting pernet_operations (part #5) Kirill Tkhai
2018-03-07  9:39 ` [PATCH net-next 01/16] net: Convert ip6 tables pernet_operations Kirill Tkhai
2018-03-07  9:39 ` [PATCH net-next 02/16] net: Convert xfrm_user_net_ops Kirill Tkhai
2018-03-07  9:39 ` [PATCH net-next 03/16] net: Convert nf_tables_net_ops Kirill Tkhai
2018-03-07  9:39 ` [PATCH net-next 04/16] net: Convert nfnetlink_net_ops Kirill Tkhai
2018-03-07  9:39 ` [PATCH net-next 05/16] net: Convert nfnl_acct_ops Kirill Tkhai
2018-03-07  9:39 ` [PATCH net-next 06/16] net: Convert cttimeout_ops Kirill Tkhai
2018-03-07  9:40 ` [PATCH net-next 07/16] net: Convert nfnl_log_net_ops Kirill Tkhai
2018-03-07  9:40 ` [PATCH net-next 08/16] net: Convert nfnl_queue_net_ops Kirill Tkhai
2018-03-07  9:40 ` [PATCH net-next 09/16] net: Convert pg_net_ops Kirill Tkhai
2018-03-07  9:40 ` [PATCH net-next 10/16] net: Convert arptable_filter_net_ops Kirill Tkhai
2018-03-07  9:40 ` [PATCH net-next 11/16] net: Convert iptable_mangle_net_ops Kirill Tkhai
2018-03-07  9:40 ` [PATCH net-next 12/16] net: Convert iptable_nat_net_ops Kirill Tkhai
2018-03-07  9:40 ` [PATCH net-next 13/16] net: Convert iptable_raw_net_ops Kirill Tkhai
2018-03-07  9:41 ` [PATCH net-next 14/16] net: Convert iptable_security_net_ops Kirill Tkhai
2018-03-07  9:41 ` [PATCH net-next 15/16] net: Convert ipv4_net_ops Kirill Tkhai
2018-03-07  9:41 ` [PATCH net-next 16/16] net: Convet ipv6_net_ops Kirill Tkhai
2018-03-08 17:40 ` [PATCH net-next 00/16] Converting pernet_operations (part #5) David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).