On 3/9/26 11:54 AM, David Ahern wrote:
On 3/8/26 5:35 PM, Zhu Yanjun wrote:
diff --git a/drivers/infiniband/sw/rxe/rxe_ns.c 
b/drivers/infiniband/sw/rxe/rxe_ns.c
new file mode 100644
index 000000000000..6fe056c81ef3
--- /dev/null
+++ b/drivers/infiniband/sw/rxe/rxe_ns.c
@@ -0,0 +1,136 @@
+// SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB
+/*
+ * Copyright (c) 2016 Mellanox Technologies Ltd. All rights reserved.
+ * Copyright (c) 2015 System Fabric Works, Inc. All rights reserved.

neither of those copyrights are relevant here.



+static void rxe_ns_exit(struct net *net)
+{
+       /* called when the network namespace is removed
+        */
+       struct rxe_ns_sock *ns_sk = net_generic(net, rxe_pernet_id);
+       struct sock *sk;
+
+       sk = rcu_dereference(ns_sk->rxe_sk4);

[  323.527911] =============================
[  323.527915] WARNING: suspicious RCU usage
[  323.527918] 7.0.0-rc1-debug+ #3 Tainted: G        W
[  323.527922] -----------------------------
[  323.527925] drivers/infiniband/sw/rxe/rxe_ns.c:49 suspicious
rcu_dereference_check() usage!
[  323.527929]

+       if (sk) {
+               rcu_assign_pointer(ns_sk->rxe_sk4, NULL);
+               udp_tunnel_sock_release(sk->sk_socket);
+       }
+
+#if IS_ENABLED(CONFIG_IPV6)
+       sk = rcu_dereference(ns_sk->rxe_sk6);

[  323.528243] =============================
[  323.528245] WARNING: suspicious RCU usage
[  323.528248] 7.0.0-rc1-debug+ #3 Tainted: G        W
[  323.528251] -----------------------------
[  323.528253] drivers/infiniband/sw/rxe/rxe_ns.c:56 suspicious
rcu_dereference_check() usage!


you should always run tests with a debug kernel that has kmemleak and
lock debugging enabled.


+#else /* IPV6 */
+
+struct sock *rxe_ns_pernet_sk6(struct net *net)
+{
+       return NULL;
+}
+
+void rxe_ns_pernet_set_sk6(struct net *net, struct sock *sk)
+{
+}

This branch is typically done as an inline in the header file.



Got it. All the above problems are fixed in the latest commit.

Zhu Yanjun

Reply via email to