All of lore.kernel.org
 help / color / mirror / Atom feed
From: "yanjun.zhu" <yanjun.zhu@linux.dev>
To: David Ahern <dsahern@kernel.org>,
	jgg@ziepe.ca, leon@kernel.org, zyjzyj2000@gmail.com,
	linux-rdma@vger.kernel.org, linux-kselftest@vger.kernel.org,
	Zhu Yanjun <yanjun.zhu@linux.dev>
Subject: Re: [PATCH v4 2/4] RDMA/rxe: Add net namespace support for IPv4/IPv6 sockets
Date: Mon, 9 Mar 2026 17:59:01 -0700	[thread overview]
Message-ID: <879742b3-da96-44fd-9cbf-ba471b99f03c@linux.dev> (raw)
In-Reply-To: <f8315319-3dda-4ab2-97b1-7645c3995d3d@kernel.org>

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	other threads:[~2026-03-10  0:59 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-08 23:35 [PATCH v4 0/4] RDMA/rxe: Add the support that rxe can work in net namespace Zhu Yanjun
2026-03-08 23:35 ` [PATCH v4 1/4] RDMA/nldev: Add dellink function pointer Zhu Yanjun
2026-03-08 23:35 ` [PATCH v4 2/4] RDMA/rxe: Add net namespace support for IPv4/IPv6 sockets Zhu Yanjun
2026-03-09 18:54   ` David Ahern
2026-03-10  0:59     ` yanjun.zhu [this message]
2026-03-08 23:35 ` [PATCH v4 3/4] RDMA/rxe: Support RDMA link creation and destruction per net namespace Zhu Yanjun
2026-03-09 18:54   ` David Ahern
2026-03-10  0:57     ` yanjun.zhu
2026-03-08 23:35 ` [PATCH v4 4/4] RDMA/rxe: Add testcase for net namespace rxe Zhu Yanjun
2026-03-08 23:40 ` [PATCH v4 0/4] RDMA/rxe: Add the support that rxe can work in net namespace Zhu Yanjun
2026-03-09 18:55   ` David Ahern
2026-03-10  0:55     ` yanjun.zhu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=879742b3-da96-44fd-9cbf-ba471b99f03c@linux.dev \
    --to=yanjun.zhu@linux.dev \
    --cc=dsahern@kernel.org \
    --cc=jgg@ziepe.ca \
    --cc=leon@kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=zyjzyj2000@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.