From 1018825a9539a67aa381ff033a49355eb03bd84d Mon Sep 17 00:00:00 2001 From: Zhengchao Shao Date: Tue, 30 Jul 2024 09:25:03 +0800 Subject: [PATCH 1/4] net/smc: remove unreferenced header in smc_loopback.h file Because linux/err.h is unreferenced in smc_loopback.h file, so remove it. Signed-off-by: Zhengchao Shao Reviewed-by: Simon Horman Reviewed-by: D. Wythe Signed-off-by: David S. Miller --- net/smc/smc_loopback.h | 1 - 1 file changed, 1 deletion(-) diff --git a/net/smc/smc_loopback.h b/net/smc/smc_loopback.h index 6dd4292dae56..04dc6808d2e1 100644 --- a/net/smc/smc_loopback.h +++ b/net/smc/smc_loopback.h @@ -15,7 +15,6 @@ #define _SMC_LOOPBACK_H #include -#include #include #if IS_ENABLED(CONFIG_SMC_LO) From 5a79575711264b98b435e08107c9e5bf129df210 Mon Sep 17 00:00:00 2001 From: Zhengchao Shao Date: Tue, 30 Jul 2024 09:25:04 +0800 Subject: [PATCH 2/4] net/smc: remove the fallback in __smc_connect When the SMC client begins to connect to server, smcd_version is set to SMC_V1 + SMC_V2. If fail to get VLAN ID, only SMC_V2 information is left in smcd_version. And smcd_version will not be changed to 0. Therefore, remove the fallback caused by the failure to get VLAN ID. Signed-off-by: Zhengchao Shao Reviewed-by: Simon Horman Signed-off-by: David S. Miller --- net/smc/af_smc.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/net/smc/af_smc.c b/net/smc/af_smc.c index 73a875573e7a..83f5a1849971 100644 --- a/net/smc/af_smc.c +++ b/net/smc/af_smc.c @@ -1523,10 +1523,6 @@ static int __smc_connect(struct smc_sock *smc) ini->smcd_version &= ~SMC_V1; ini->smcr_version = 0; ini->smc_type_v1 = SMC_TYPE_N; - if (!ini->smcd_version) { - rc = SMC_CLC_DECL_GETVLANERR; - goto fallback; - } } rc = smc_find_proposal_devices(smc, ini); From d37307eaac13f3c5fe912787b5f9facbc574f2cf Mon Sep 17 00:00:00 2001 From: Zhengchao Shao Date: Tue, 30 Jul 2024 09:25:05 +0800 Subject: [PATCH 3/4] net/smc: remove redundant code in smc_connect_check_aclc When the SMC client perform CLC handshake, it will check whether the clc header type is correct in receiving SMC_CLC_ACCEPT packet. The specific invoking path is as follows: __smc_connect smc_connect_clc smc_clc_wait_msg smc_clc_msg_hdr_valid smc_clc_msg_acc_conf_valid Therefore, the smc_connect_check_aclc interface invoked by __smc_connect does not need to check type again. Signed-off-by: Zhengchao Shao Reviewed-by: Simon Horman Signed-off-by: David S. Miller --- net/smc/af_smc.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/net/smc/af_smc.c b/net/smc/af_smc.c index 83f5a1849971..6f82e4d8fda4 100644 --- a/net/smc/af_smc.c +++ b/net/smc/af_smc.c @@ -1466,10 +1466,6 @@ connect_abort: static int smc_connect_check_aclc(struct smc_init_info *ini, struct smc_clc_msg_accept_confirm *aclc) { - if (aclc->hdr.typev1 != SMC_TYPE_R && - aclc->hdr.typev1 != SMC_TYPE_D) - return SMC_CLC_DECL_MODEUNSUPP; - if (aclc->hdr.version >= SMC_V2) { if ((aclc->hdr.typev1 == SMC_TYPE_R && !smcr_indicated(ini->smc_type_v2)) || From 0908503ade5f5fecbdb16c5ce16b2b5ee6107e8d Mon Sep 17 00:00:00 2001 From: Zhengchao Shao Date: Tue, 30 Jul 2024 09:25:06 +0800 Subject: [PATCH 4/4] net/smc: remove unused input parameters in smcr_new_buf_create The input parameter "is_rmb" of the smcr_new_buf_create function has never been used, remove it. Signed-off-by: Zhengchao Shao Reviewed-by: Simon Horman Signed-off-by: David S. Miller --- net/smc/smc_core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/smc/smc_core.c b/net/smc/smc_core.c index 3b95828d9976..71fb334d8234 100644 --- a/net/smc/smc_core.c +++ b/net/smc/smc_core.c @@ -2250,7 +2250,7 @@ int smcr_buf_reg_lgr(struct smc_link *lnk) } static struct smc_buf_desc *smcr_new_buf_create(struct smc_link_group *lgr, - bool is_rmb, int bufsize) + int bufsize) { struct smc_buf_desc *buf_desc; @@ -2398,7 +2398,7 @@ static int __smc_buf_create(struct smc_sock *smc, bool is_smcd, bool is_rmb) if (is_smcd) buf_desc = smcd_new_buf_create(lgr, is_rmb, bufsize); else - buf_desc = smcr_new_buf_create(lgr, is_rmb, bufsize); + buf_desc = smcr_new_buf_create(lgr, bufsize); if (PTR_ERR(buf_desc) == -ENOMEM) break;