public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
From: "Yanjun.Zhu" <yanjun.zhu@linux.dev>
To: Leon Romanovsky <leon@kernel.org>, Zhu Yanjun <yanjun.zhu@linux.dev>
Cc: jgg@ziepe.ca, zyjzyj2000@gmail.com, shuah@kernel.org,
	linux-rdma@vger.kernel.org, linux-kselftest@vger.kernel.org,
	dsahern@kernel.org
Subject: Re: [PATCH v5 3/4] RDMA/rxe: Support RDMA link creation and destruction per net namespace
Date: Tue, 10 Mar 2026 13:32:30 -0700	[thread overview]
Message-ID: <eaf37917-76aa-4869-a37b-5a1acb4ba7ae@linux.dev> (raw)
In-Reply-To: <20260310185744.GK12611@unreal>


On 3/10/26 11:57 AM, Leon Romanovsky wrote:
> On Tue, Mar 10, 2026 at 03:05:17AM +0100, Zhu Yanjun wrote:
>> After introducing dellink handling and per-net namespace management
>> for IPv4 and IPv6 sockets, extend rxe to create and destroy RDMA links
>> within each network namespace.
>>
>> With this change, RDMA links can be instantiated both in init_net and
>> in other network namespaces. The lifecycle of the RDMA link is now tied
>> to the corresponding namespace and is properly cleaned up when the
>> namespace or link is removed.
>>
>> This ensures rxe behaves correctly in multi-namespace environments and
>> keeps socket and RDMA link resources consistent across namespace
>> creation and teardown.
>>
>> Signed-off-by: Zhu Yanjun <yanjun.zhu@linux.dev>
>> ---
>>   drivers/infiniband/sw/rxe/rxe.c     |  38 +++++++-
>>   drivers/infiniband/sw/rxe/rxe_net.c | 145 +++++++++++++++++++++-------
>>   drivers/infiniband/sw/rxe/rxe_net.h |   9 +-
>>   3 files changed, 146 insertions(+), 46 deletions(-)
> <...>
>
>> +#define SK_REF_FOR_TUNNEL	2
> <...>
>
>> +#undef SK_REF_FOR_TUNNEL
> We typically place defines at the beginning of a file and avoid undefining
> them. The undef directive is mainly used when a macro is defined inside a
> function.

Defining macros locally helps clarify the intent behind specific values.

By pairing the #define with a trailing #undef, we gain the descriptive

benefits of the macro while maintaining strict control over its visibility.

I will put the definition of the MACRO in the function, following your 
advice.

Thanks.

Zhu Yanjun

>
> Thanks

  reply	other threads:[~2026-03-10 20:32 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-10  2:05 [PATCH v5 0/4] RDMA/rxe: Add the support that rxe can work in net namespace Zhu Yanjun
2026-03-10  2:05 ` [PATCH v5 1/4] RDMA/nldev: Add dellink function pointer Zhu Yanjun
2026-03-10 15:47   ` David Ahern
2026-03-10 19:01   ` Leon Romanovsky
2026-03-11  1:58     ` Yanjun.Zhu
2026-03-11  8:54       ` Leon Romanovsky
2026-03-11 22:01         ` Yanjun.Zhu
2026-03-11 22:09           ` Yanjun.Zhu
2026-03-12  2:04           ` David Ahern
2026-03-12  3:59             ` Zhu Yanjun
2026-03-12  5:09               ` Zhu Yanjun
2026-03-12 18:04                 ` Yanjun.Zhu
2026-03-10  2:05 ` [PATCH v5 2/4] RDMA/rxe: Add net namespace support for IPv4/IPv6 sockets Zhu Yanjun
2026-03-10 15:48   ` David Ahern
2026-03-10  2:05 ` [PATCH v5 3/4] RDMA/rxe: Support RDMA link creation and destruction per net namespace Zhu Yanjun
2026-03-10 15:48   ` David Ahern
2026-03-10 18:57   ` Leon Romanovsky
2026-03-10 20:32     ` Yanjun.Zhu [this message]
2026-03-11  8:45       ` Leon Romanovsky
2026-03-11 19:08         ` Yanjun.Zhu
2026-03-10  2:05 ` [PATCH v5 4/4] RDMA/rxe: Add testcase for net namespace rxe Zhu Yanjun
2026-03-10 15:49   ` David Ahern
2026-03-10 18:53   ` Leon Romanovsky
2026-03-10 21:01     ` Yanjun.Zhu
2026-03-11  8:51       ` Leon Romanovsky
2026-03-11 22:51         ` 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=eaf37917-76aa-4869-a37b-5a1acb4ba7ae@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=shuah@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox