Home Home > GIT Browse > SLE15-AZURE
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichal Kubecek <mkubecek@suse.cz>2019-02-14 18:06:38 +0100
committerMichal Kubecek <mkubecek@suse.cz>2019-02-14 18:06:38 +0100
commit0d1872e0ba54072153fc764cdd8a61efc0209c9a (patch)
tree0242d0be274a2480702f18a180a2162395aafbec
parent3f503173f6dabd583947d12a7d7df9de29dfa643 (diff)
net: add uevent socket member (bsc#1122982).
-rw-r--r--patches.fixes/net-add-uevent-socket-member.patch90
-rw-r--r--series.conf1
2 files changed, 91 insertions, 0 deletions
diff --git a/patches.fixes/net-add-uevent-socket-member.patch b/patches.fixes/net-add-uevent-socket-member.patch
new file mode 100644
index 0000000000..39e382a21c
--- /dev/null
+++ b/patches.fixes/net-add-uevent-socket-member.patch
@@ -0,0 +1,90 @@
+From: Christian Brauner <christian.brauner@ubuntu.com>
+Date: Mon, 19 Mar 2018 13:17:30 +0100
+Subject: net: add uevent socket member
+Patch-mainline: v4.17-rc1
+Git-commit: 94e5e3087a67c765be98592b36d8d187566478d5
+References: bsc#1122982
+
+This commit adds struct uevent_sock to struct net. Since struct uevent_sock
+records the position of the uevent socket in the uevent socket list we can
+trivially remove it from the uevent socket list during cleanup. This speeds
+up the old removal codepath.
+Note, list_del() will hit __list_del_entry_valid() in its call chain which
+will validate that the element is a member of the list. If it isn't it will
+take care that the list is not modified.
+
+Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Acked-by: Michal Kubecek <mkubecek@suse.cz>
+
+---
+ include/net/net_namespace.h | 4 +++-
+ lib/kobject_uevent.c | 17 +++++++----------
+ 2 files changed, 10 insertions(+), 11 deletions(-)
+
+--- a/include/net/net_namespace.h
++++ b/include/net/net_namespace.h
+@@ -38,7 +38,7 @@ struct net_device;
+ struct sock;
+ struct ctl_table_header;
+ struct net_generic;
+-struct sock;
++struct uevent_sock;
+ struct netns_ipvs;
+
+
+@@ -77,6 +77,8 @@ struct net {
+ struct sock *rtnl; /* rtnetlink socket */
+ struct sock *genl_sock;
+
++ struct uevent_sock *uevent_sock; /* uevent socket */
++
+ struct list_head dev_base_head;
+ struct hlist_head *dev_name_head;
+ struct hlist_head *dev_index_head;
+--- a/lib/kobject_uevent.c
++++ b/lib/kobject_uevent.c
+@@ -31,11 +31,13 @@ u64 uevent_seqnum;
+ #ifdef CONFIG_UEVENT_HELPER
+ char uevent_helper[UEVENT_HELPER_PATH_LEN] = CONFIG_UEVENT_HELPER_PATH;
+ #endif
+-#ifdef CONFIG_NET
++
+ struct uevent_sock {
+ struct list_head list;
+ struct sock *sk;
+ };
++
++#ifdef CONFIG_NET
+ static LIST_HEAD(uevent_sock_list);
+ #endif
+
+@@ -438,6 +440,9 @@ static int uevent_net_init(struct net *net)
+ kfree(ue_sk);
+ return -ENODEV;
+ }
++
++ net->uevent_sock = ue_sk;
++
+ mutex_lock(&uevent_sock_mutex);
+ list_add_tail(&ue_sk->list, &uevent_sock_list);
+ mutex_unlock(&uevent_sock_mutex);
+@@ -446,17 +451,9 @@ static int uevent_net_init(struct net *net)
+
+ static void uevent_net_exit(struct net *net)
+ {
+- struct uevent_sock *ue_sk;
++ struct uevent_sock *ue_sk = net->uevent_sock;
+
+ mutex_lock(&uevent_sock_mutex);
+- list_for_each_entry(ue_sk, &uevent_sock_list, list) {
+- if (sock_net(ue_sk->sk) == net)
+- goto found;
+- }
+- mutex_unlock(&uevent_sock_mutex);
+- return;
+-
+-found:
+ list_del(&ue_sk->list);
+ mutex_unlock(&uevent_sock_mutex);
+
diff --git a/series.conf b/series.conf
index e301c1d672..fc5e329edd 100644
--- a/series.conf
+++ b/series.conf
@@ -14611,6 +14611,7 @@
patches.drivers/i40e-Prevent-setting-link-speed-on-I40E_DEV_ID_25G_B.patch
patches.drivers/i40evf-remove-flags-that-are-never-used.patch
patches.drivers/i40e-Fix-the-polling-mechanism-of-GLGEN_RSTAT.DEVSTA.patch
+ patches.fixes/net-add-uevent-socket-member.patch
patches.drivers/cxgb4-Adds-CPL-support-for-Shared-Receive-Queues.patch
patches.drivers/cxgb4-Add-support-to-initialise-read-SRQ-entries.patch
patches.drivers/cxgb4-Add-support-to-query-HW-SRQ-parameters.patch