diff options
author | Wen Gu <guwen@linux.alibaba.com> | 2024-04-28 14:07:29 +0800 |
---|---|---|
committer | Paolo Abeni <pabeni@redhat.com> | 2024-04-30 13:24:48 +0200 |
commit | 46ac64419ded7bcbe1fb8d0f4df3258384a425c2 (patch) | |
tree | af53434261d25b0ec118a151de9c561b9249657b /net/smc/af_smc.c | |
parent | 784c46f5467c3cd516e518de211e26611da5c0fb (diff) | |
download | linux-46ac64419ded7bcbe1fb8d0f4df3258384a425c2.tar.gz linux-46ac64419ded7bcbe1fb8d0f4df3258384a425c2.tar.bz2 linux-46ac64419ded7bcbe1fb8d0f4df3258384a425c2.zip |
net/smc: introduce loopback-ism for SMC intra-OS shortcut
This introduces a kind of Emulated-ISM device named loopback-ism for
SMCv2.1. The loopback-ism device is currently exclusive for SMC usage,
and aims to provide an SMC shortcut for sockets within the same kernel,
leading to improved intra-OS traffic performance. Configuration of this
feature is managed through the config SMC_LO.
Signed-off-by: Wen Gu <guwen@linux.alibaba.com>
Reviewed-by: Gerd Bayer <gbayer@linux.ibm.com>
Reviewed-by: Wenjia Zhang <wenjia@linux.ibm.com>
Reviewed-and-tested-by: Jan Karcher <jaka@linux.ibm.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Diffstat (limited to 'net/smc/af_smc.c')
-rw-r--r-- | net/smc/af_smc.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/net/smc/af_smc.c b/net/smc/af_smc.c index e8dcd28a554c..47f3bc1470bc 100644 --- a/net/smc/af_smc.c +++ b/net/smc/af_smc.c @@ -53,6 +53,7 @@ #include "smc_stats.h" #include "smc_tracepoint.h" #include "smc_sysctl.h" +#include "smc_loopback.h" static DEFINE_MUTEX(smc_server_lgr_pending); /* serialize link group * creation on server @@ -3555,15 +3556,23 @@ static int __init smc_init(void) goto out_sock; } + rc = smc_loopback_init(); + if (rc) { + pr_err("%s: smc_loopback_init fails with %d\n", __func__, rc); + goto out_ib; + } + rc = tcp_register_ulp(&smc_ulp_ops); if (rc) { pr_err("%s: tcp_ulp_register fails with %d\n", __func__, rc); - goto out_ib; + goto out_lo; } static_branch_enable(&tcp_have_smc); return 0; +out_lo: + smc_loopback_exit(); out_ib: smc_ib_unregister_client(); out_sock: @@ -3601,6 +3610,7 @@ static void __exit smc_exit(void) tcp_unregister_ulp(&smc_ulp_ops); sock_unregister(PF_SMC); smc_core_exit(); + smc_loopback_exit(); smc_ib_unregister_client(); smc_ism_exit(); destroy_workqueue(smc_close_wq); |