Home Home > GIT Browse > SLE15-AZURE
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichal Kubecek <mkubecek@suse.cz>2019-02-14 14:04:37 +0100
committerMichal Kubecek <mkubecek@suse.cz>2019-02-14 14:04:37 +0100
commite5f835f04952a8caf9d088a1f785425e00a7a4b4 (patch)
tree27aa3b5bad52016e51c1271d8203eff617cbaf99
parent07f6645c697cc1c94e80247ce93033ea770b7e66 (diff)
ipv6: speedup ipv6 tunnels dismantle (bsc#1122982).
Refresh patches.suse/ip6_vti-fix-a-null-pointer-deference-when-destroy-vt.patch
-rw-r--r--patches.fixes/ipv6-speedup-ipv6-tunnels-dismantle.patch225
-rw-r--r--patches.suse/ip6_vti-fix-a-null-pointer-deference-when-destroy-vt.patch10
-rw-r--r--series.conf1
3 files changed, 231 insertions, 5 deletions
diff --git a/patches.fixes/ipv6-speedup-ipv6-tunnels-dismantle.patch b/patches.fixes/ipv6-speedup-ipv6-tunnels-dismantle.patch
new file mode 100644
index 0000000000..a109ea03b0
--- /dev/null
+++ b/patches.fixes/ipv6-speedup-ipv6-tunnels-dismantle.patch
@@ -0,0 +1,225 @@
+From: Eric Dumazet <edumazet@google.com>
+Date: Tue, 19 Sep 2017 16:27:08 -0700
+Subject: ipv6: speedup ipv6 tunnels dismantle
+Patch-mainline: v4.15-rc1
+Git-commit: bb401caefe9d2c65e0c0fa23b21deecfbfa473fe
+References: bsc#1122982
+
+Implement exit_batch() method to dismantle more devices
+per round.
+
+(rtnl_lock() ...
+ unregister_netdevice_many() ...
+ rtnl_unlock())
+
+Tested:
+$ cat add_del_unshare.sh
+for i in `seq 1 40`
+do
+ (for j in `seq 1 100` ; do unshare -n /bin/true >/dev/null ; done) &
+done
+wait ; grep net_namespace /proc/slabinfo
+
+Before patch :
+$ time ./add_del_unshare.sh
+net_namespace 110 267 5504 1 2 : tunables 8 4 0 : slabdata 110 267 0
+
+real 3m25.292s
+user 0m0.644s
+sys 0m40.153s
+
+After patch:
+
+$ time ./add_del_unshare.sh
+net_namespace 126 282 5504 1 2 : tunables 8 4 0 : slabdata 126 282 0
+
+real 1m38.965s
+user 0m0.688s
+sys 0m37.017s
+
+Signed-off-by: Eric Dumazet <edumazet@google.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Acked-by: Michal Kubecek <mkubecek@suse.cz>
+
+---
+ net/ipv6/ip6_gre.c | 8 +++++---
+ net/ipv6/ip6_tunnel.c | 20 +++++++++++---------
+ net/ipv6/ip6_vti.c | 23 ++++++++++++++---------
+ net/ipv6/sit.c | 9 ++++++---
+ 4 files changed, 36 insertions(+), 24 deletions(-)
+
+--- a/net/ipv6/ip6_gre.c
++++ b/net/ipv6/ip6_gre.c
+@@ -1199,19 +1199,21 @@ static int __net_init ip6gre_init_net(struct net *net)
+ return err;
+ }
+
+-static void __net_exit ip6gre_exit_net(struct net *net)
++static void __net_exit ip6gre_exit_batch_net(struct list_head *net_list)
+ {
++ struct net *net;
+ LIST_HEAD(list);
+
+ rtnl_lock();
+- ip6gre_destroy_tunnels(net, &list);
++ list_for_each_entry(net, net_list, exit_list)
++ ip6gre_destroy_tunnels(net, &list);
+ unregister_netdevice_many(&list);
+ rtnl_unlock();
+ }
+
+ static struct pernet_operations ip6gre_net_ops = {
+ .init = ip6gre_init_net,
+- .exit = ip6gre_exit_net,
++ .exit_batch = ip6gre_exit_batch_net,
+ .id = &ip6gre_net_id,
+ .size = sizeof(struct ip6gre_net),
+ };
+--- a/net/ipv6/ip6_tunnel.c
++++ b/net/ipv6/ip6_tunnel.c
+@@ -2184,17 +2184,16 @@ static struct xfrm6_tunnel ip6ip6_handler __read_mostly = {
+ .priority = 1,
+ };
+
+-static void __net_exit ip6_tnl_destroy_tunnels(struct net *net)
++static void __net_exit ip6_tnl_destroy_tunnels(struct net *net, struct list_head *list)
+ {
+ struct ip6_tnl_net *ip6n = net_generic(net, ip6_tnl_net_id);
+ struct net_device *dev, *aux;
+ int h;
+ struct ip6_tnl *t;
+- LIST_HEAD(list);
+
+ for_each_netdev_safe(net, dev, aux)
+ if (dev->rtnl_link_ops == &ip6_link_ops)
+- unregister_netdevice_queue(dev, &list);
++ unregister_netdevice_queue(dev, list);
+
+ for (h = 0; h < IP6_TUNNEL_HASH_SIZE; h++) {
+ t = rtnl_dereference(ip6n->tnls_r_l[h]);
+@@ -2203,12 +2202,10 @@ static void __net_exit ip6_tnl_destroy_tunnels(struct net *net)
+ * been added to the list by the previous loop.
+ */
+ if (!net_eq(dev_net(t->dev), net))
+- unregister_netdevice_queue(t->dev, &list);
++ unregister_netdevice_queue(t->dev, list);
+ t = rtnl_dereference(t->next);
+ }
+ }
+-
+- unregister_netdevice_many(&list);
+ }
+
+ static int __net_init ip6_tnl_init_net(struct net *net)
+@@ -2252,16 +2249,21 @@ static int __net_init ip6_tnl_init_net(struct net *net)
+ return err;
+ }
+
+-static void __net_exit ip6_tnl_exit_net(struct net *net)
++static void __net_exit ip6_tnl_exit_batch_net(struct list_head *net_list)
+ {
++ struct net *net;
++ LIST_HEAD(list);
++
+ rtnl_lock();
+- ip6_tnl_destroy_tunnels(net);
++ list_for_each_entry(net, net_list, exit_list)
++ ip6_tnl_destroy_tunnels(net, &list);
++ unregister_netdevice_many(&list);
+ rtnl_unlock();
+ }
+
+ static struct pernet_operations ip6_tnl_net_ops = {
+ .init = ip6_tnl_init_net,
+- .exit = ip6_tnl_exit_net,
++ .exit_batch = ip6_tnl_exit_batch_net,
+ .id = &ip6_tnl_net_id,
+ .size = sizeof(struct ip6_tnl_net),
+ };
+--- a/net/ipv6/ip6_vti.c
++++ b/net/ipv6/ip6_vti.c
+@@ -1086,23 +1086,22 @@ static struct rtnl_link_ops vti6_link_ops __read_mostly = {
+ .get_link_net = ip6_tnl_get_link_net,
+ };
+
+-static void __net_exit vti6_destroy_tunnels(struct vti6_net *ip6n)
++static void __net_exit vti6_destroy_tunnels(struct vti6_net *ip6n,
++ struct list_head *list)
+ {
+ int h;
+ struct ip6_tnl *t;
+- LIST_HEAD(list);
+
+ for (h = 0; h < IP6_VTI_HASH_SIZE; h++) {
+ t = rtnl_dereference(ip6n->tnls_r_l[h]);
+ while (t) {
+- unregister_netdevice_queue(t->dev, &list);
++ unregister_netdevice_queue(t->dev, list);
+ t = rtnl_dereference(t->next);
+ }
+ }
+
+ t = rtnl_dereference(ip6n->tnls_wc[0]);
+- unregister_netdevice_queue(t->dev, &list);
+- unregister_netdevice_many(&list);
++ unregister_netdevice_queue(t->dev, list);
+ }
+
+ static int __net_init vti6_init_net(struct net *net)
+@@ -1142,18 +1141,24 @@ static int __net_init vti6_init_net(struct net *net)
+ return err;
+ }
+
+-static void __net_exit vti6_exit_net(struct net *net)
++static void __net_exit vti6_exit_batch_net(struct list_head *net_list)
+ {
+- struct vti6_net *ip6n = net_generic(net, vti6_net_id);
++ struct vti6_net *ip6n;
++ struct net *net;
++ LIST_HEAD(list);
+
+ rtnl_lock();
+- vti6_destroy_tunnels(ip6n);
++ list_for_each_entry(net, net_list, exit_list) {
++ ip6n = net_generic(net, vti6_net_id);
++ vti6_destroy_tunnels(ip6n, &list);
++ }
++ unregister_netdevice_many(&list);
+ rtnl_unlock();
+ }
+
+ static struct pernet_operations vti6_net_ops = {
+ .init = vti6_init_net,
+- .exit = vti6_exit_net,
++ .exit_batch = vti6_exit_batch_net,
+ .id = &vti6_net_id,
+ .size = sizeof(struct vti6_net),
+ };
+--- a/net/ipv6/sit.c
++++ b/net/ipv6/sit.c
+@@ -1850,19 +1850,22 @@ static int __net_init sit_init_net(struct net *net)
+ return err;
+ }
+
+-static void __net_exit sit_exit_net(struct net *net)
++static void __net_exit sit_exit_batch_net(struct list_head *net_list)
+ {
+ LIST_HEAD(list);
++ struct net *net;
+
+ rtnl_lock();
+- sit_destroy_tunnels(net, &list);
++ list_for_each_entry(net, net_list, exit_list)
++ sit_destroy_tunnels(net, &list);
++
+ unregister_netdevice_many(&list);
+ rtnl_unlock();
+ }
+
+ static struct pernet_operations sit_net_ops = {
+ .init = sit_init_net,
+- .exit = sit_exit_net,
++ .exit_batch = sit_exit_batch_net,
+ .id = &sit_net_id,
+ .size = sizeof(struct sit_net),
+ };
diff --git a/patches.suse/ip6_vti-fix-a-null-pointer-deference-when-destroy-vt.patch b/patches.suse/ip6_vti-fix-a-null-pointer-deference-when-destroy-vt.patch
index 2c083f41a6..7f9bdd71dc 100644
--- a/patches.suse/ip6_vti-fix-a-null-pointer-deference-when-destroy-vt.patch
+++ b/patches.suse/ip6_vti-fix-a-null-pointer-deference-when-destroy-vt.patch
@@ -50,18 +50,18 @@ Signed-off-by: Haishuang Yan <yanhaishuang@cmss.chinamobile.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
- net/ipv6/ip6_vti.c | 3 ++-
+ net/ipv6/ip6_vti.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
--- a/net/ipv6/ip6_vti.c
+++ b/net/ipv6/ip6_vti.c
-@@ -1101,7 +1101,8 @@ static void __net_exit vti6_destroy_tunn
+@@ -1101,7 +1101,8 @@ static void __net_exit vti6_destroy_tunnels(struct vti6_net *ip6n,
}
t = rtnl_dereference(ip6n->tnls_wc[0]);
-- unregister_netdevice_queue(t->dev, &list);
+- unregister_netdevice_queue(t->dev, list);
+ if (t)
-+ unregister_netdevice_queue(t->dev, &list);
- unregister_netdevice_many(&list);
++ unregister_netdevice_queue(t->dev, list);
}
+ static int __net_init vti6_init_net(struct net *net)
diff --git a/series.conf b/series.conf
index 91725cba5f..460300ed58 100644
--- a/series.conf
+++ b/series.conf
@@ -8768,6 +8768,7 @@
patches.fixes/kobject-factorize-skb-setup-in-kobject_uevent_net_br.patch
patches.fixes/ipv6-addrlabel-per-netns-list.patch
patches.fixes/tcp-batch-tcp_net_metrics_exit.patch
+ patches.fixes/ipv6-speedup-ipv6-tunnels-dismantle.patch
patches.drivers/cxgb4-add-new-T5-pci-device-id-s-34929cb4.patch
patches.drivers/drivers-net-e1000e-use-setup_timer-helper.patch
patches.drivers/drivers-net-bnxt-use-setup_timer-helper.patch