net/smc: fix smc clc failed issue when netdevice not in init_net
authorAlbert Huang <huangjie.albert@bytedance.com>
Wed, 11 Oct 2023 07:48:51 +0000 (15:48 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 25 Oct 2023 10:03:13 +0000 (12:03 +0200)
commita7f5558ec2db28d7b7180b02c1863cd9e4c8ffdf
tree8f261a409373ae119f528068d02ec6f86c82909e
parent2efcdbef13c9e0f73c8cecb84cbe387eb8e4b453
net/smc: fix smc clc failed issue when netdevice not in init_net

[ Upstream commit c68681ae46eaaa1640b52fe366d21a93b2185df5 ]

If the netdevice is within a container and communicates externally
through network technologies such as VxLAN, we won't be able to find
routing information in the init_net namespace. To address this issue,
we need to add a struct net parameter to the smc_ib_find_route function.
This allow us to locate the routing information within the corresponding
net namespace, ensuring the correct completion of the SMC CLC interaction.

Fixes: e5c4744cfb59 ("net/smc: add SMC-Rv2 connection establishment")
Signed-off-by: Albert Huang <huangjie.albert@bytedance.com>
Reviewed-by: Dust Li <dust.li@linux.alibaba.com>
Reviewed-by: Wenjia Zhang <wenjia@linux.ibm.com>
Link: https://lore.kernel.org/r/20231011074851.95280-1-huangjie.albert@bytedance.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/smc/af_smc.c
net/smc/smc_ib.c
net/smc/smc_ib.h