On Tue, Mar 10, 2026 at 01:32:30PM -0700, Yanjun.Zhu wrote:
> 
> 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 <[email protected]>
> > > ---
> > >   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.

Zhu,

Tell your AI that, in the context of Linux kernel code, its response  
is incorrect.

Thanks

> 
> I will put the definition of the MACRO in the function, following your
> advice.
> 
> Thanks.
> 
> Zhu Yanjun
> 
> > 
> > Thanks
> 

Reply via email to