Re: [PATCH net-next] net/smc: add full IPv6 support for SMC

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Oct 16, 2025 at 02:35:39PM +0100, Simon Horman wrote:
> On Thu, Oct 16, 2025 at 01:45:41PM +0800, D. Wythe wrote:
> > The current SMC implementation is IPv4-centric. While it contains a
> > workaround for IPv4-mapped IPv6 addresses, it lacks a functional path
> > for native IPv6, preventing its use in modern dual-stack or IPv6-only
> > networks.
> > 
> > This patch introduces full, native IPv6 support by refactoring the
> > address handling mechanism to be IP-version agnostic, which is
> > achieved by:
> > 
> > - Introducing a generic `struct smc_ipaddr` to abstract IP addresses.
> > - Implementing an IPv6-specific route lookup function.
> > - Extend GID matching logic for both IPv4 and IPv6 addresses
> > 
> > With these changes, SMC can now discover RDMA devices and establish
> > connections over both native IPv4 and IPv6 networks.
> > 
> > Signed-off-by: D. Wythe <alibuda@xxxxxxxxxxxxxxxxx>
> > ---
> >  net/smc/af_smc.c   |  35 +++++++----
> >  net/smc/smc_core.h |  40 ++++++++++++-
> >  net/smc/smc_ib.c   | 143 ++++++++++++++++++++++++++++++++++++++-------
> >  net/smc/smc_ib.h   |   9 +++
> >  net/smc/smc_llc.c  |   6 +-
> >  5 files changed, 193 insertions(+), 40 deletions(-)
> > 
> > diff --git a/net/smc/af_smc.c b/net/smc/af_smc.c
> > index 77b99e8ef35a..cbff0b29ad5b 100644
> > --- a/net/smc/af_smc.c
> > +++ b/net/smc/af_smc.c
> > @@ -1132,12 +1132,9 @@ static int smc_find_proposal_devices(struct smc_sock *smc,
> >  
> >  	/* check if there is an rdma v2 device available */
> >  	ini->check_smcrv2 = true;
> > -	ini->smcrv2.saddr = smc->clcsock->sk->sk_rcv_saddr;
> > +
> > +	smc_ipaddr_from(&ini->smcrv2.saddr, smc->clcsock->sk, sk_rcv_saddr, sk_v6_rcv_saddr);
> 
> Hi,
> 
> Unfortunately this introduces a compilation error when CONFIG_IPV6=n.
> 
> In file included from smc_wr.h:20,
>                  from smc_llc.h:16,
>                  from af_smc.c:47:
> af_smc.c: In function ‘smc_find_proposal_devices’:
> /home/horms/projects/linux/linux/include/net/sock.h:388:37: error: ‘struct sock_common’ has no member named ‘skc_v6_rcv_saddr’; did you mean ‘skc_rcv_saddr’?
>   388 | #define sk_v6_rcv_saddr __sk_common.skc_v6_rcv_saddr
>       |                                     ^~~~~~~~~~~~~~~~
> smc_core.h:639:51: note: in definition of macro ‘smc_ipaddr_from’
>   639 |                         __ipaddr->addr_v6 = __sk->_v6_member;   \
>       |                                                   ^~~~~~~~~~
> af_smc.c:1136:77: note: in expansion of macro ‘sk_v6_rcv_saddr’
>  1136 |         smc_ipaddr_from(&ini->smcrv2.saddr, smc->clcsock->sk, sk_rcv_saddr, sk_v6_rcv_saddr);


Thanks for the report, that's my bad... I will fix it in the next version.

D. Wythe




[Index of Archives]     [Linux Kernel Discussion]     [TCP Instrumentation]     [Netfilter]     [Berkeley Packet Filter]     [Ethernet Bridging]     [Linux Wireless Networking]     [Openconnect]     [Linux WPAN Networking]     [Linux Host AP]     [Linux WPAN Networking]     [Linux Bluetooth Networking]     [Linux ATH6KL Networking]     [Linux Networking Users]     [XDP Newbies]     [Linux Coverity]     [VLAN]     [Git]     [IETF Annouce]     [Linux Assembly]     [Security]     [Bugtraq]     [Yosemite Information]     [MIPS Linux]     [ARM Linux Kernel]     [ARM Linux]     [Linux Virtualization]     [Linux IDE]     [Linux RAID]     [Linux SCSI]     [Squid]
  Powered by Linux