From patchwork Tue Jul 30 01:25:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: shaozhengchao X-Patchwork-Id: 13746216 X-Patchwork-Delegate: kuba@kernel.org Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A3C23E573; Tue, 30 Jul 2024 01:26:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.187 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722302812; cv=none; b=V31aCOdX2sHT1WD1Lb3pR5bFFvTPznZ5144gDhB3O1jzxyQyytdMM89/tLcSSVOflIunrNEAFdUMqG+9ngLgEy1ioUv4+7nPNJKMQg1jDk3S8jJuncV0fXKN+Whr9dxrFkMm/aH0twn1PS5rzESB5SzFEIuRWhM5cbSWztFvg1U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722302812; c=relaxed/simple; bh=w/HlD+Uo2oJworvVD1lQNRqBwkR3R/giQTDTJzf0MTo=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=RzGzwIgZWh2VqZcdy/gBpEoyprKSFUdXSR+hxaxYiUpQPf1lMzI9OfyzxaSJ9SVdS4TynD9eGutaj4ob5NdtuS62k5O1IC+FiCNeuW1YyGH4TF8ZV4TOQeMZkP5+g+7c87wa3N7EXeG4RrrJtiJQIogm+Dyf6w4L+3n6C5H64WM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.187 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.88.194]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4WXyB72x0DzyNCM; Tue, 30 Jul 2024 09:21:51 +0800 (CST) Received: from dggpeml500026.china.huawei.com (unknown [7.185.36.106]) by mail.maildlp.com (Postfix) with ESMTPS id 3893F140FA7; Tue, 30 Jul 2024 09:26:48 +0800 (CST) Received: from huawei.com (10.175.101.6) by dggpeml500026.china.huawei.com (7.185.36.106) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Tue, 30 Jul 2024 09:26:47 +0800 From: Zhengchao Shao To: , , , , , CC: , , , , , , , Subject: [PATCH net-next 1/4] net/smc: remove unreferenced header in smc_loopback.h file Date: Tue, 30 Jul 2024 09:25:03 +0800 Message-ID: <20240730012506.3317978-2-shaozhengchao@huawei.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240730012506.3317978-1-shaozhengchao@huawei.com> References: <20240730012506.3317978-1-shaozhengchao@huawei.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To dggpeml500026.china.huawei.com (7.185.36.106) X-Patchwork-Delegate: kuba@kernel.org 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 --- 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 patchwork Tue Jul 30 01:25:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: shaozhengchao X-Patchwork-Id: 13746217 X-Patchwork-Delegate: kuba@kernel.org Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A2988FC08; Tue, 30 Jul 2024 01:26:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.189 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722302813; cv=none; b=BRlyMwhljvgSSO+4u/Ph0sIm24VvOej6Qg7ulwXi40YlFTLSYj3t2emMiJZtfl2U5LjwaqNLPuS3EiEoNtUmuiY7lXaReAT0+ABQaPUrPdgl79Vo2PdQ+aFkD5djIMYI3Qn57v1AyksYJDuY0g+xNAsnwyceBcvaKgYOppXeJIY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722302813; c=relaxed/simple; bh=xqntZRHuA0dVyn1JWE5Rt+Da9H2J5cf1NseRDAXOdsc=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Zmb2mAdfgR5sJM2WbNjORv523Omqt1k8d6iS2Pk7YqR4cyr9FVCw+jleimDOuQJaNhyJyvbXDql5E+hTqO7TJ+o/oMNYvY2S0MBX/L7uPNGegNKBfkyO9Lv4Pj++cmGfWYteIHOZdShSzNrkp7GIoegI/gRo546ovjw+vDAt4Os= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.189 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.88.194]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4WXyBv3KXgzPtDr; Tue, 30 Jul 2024 09:22:31 +0800 (CST) Received: from dggpeml500026.china.huawei.com (unknown [7.185.36.106]) by mail.maildlp.com (Postfix) with ESMTPS id E1222140FA7; Tue, 30 Jul 2024 09:26:48 +0800 (CST) Received: from huawei.com (10.175.101.6) by dggpeml500026.china.huawei.com (7.185.36.106) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Tue, 30 Jul 2024 09:26:48 +0800 From: Zhengchao Shao To: , , , , , CC: , , , , , , , Subject: [PATCH net-next 2/4] net/smc: remove the fallback in __smc_connect Date: Tue, 30 Jul 2024 09:25:04 +0800 Message-ID: <20240730012506.3317978-3-shaozhengchao@huawei.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240730012506.3317978-1-shaozhengchao@huawei.com> References: <20240730012506.3317978-1-shaozhengchao@huawei.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To dggpeml500026.china.huawei.com (7.185.36.106) X-Patchwork-Delegate: kuba@kernel.org 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 --- 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 patchwork Tue Jul 30 01:25:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: shaozhengchao X-Patchwork-Id: 13746218 X-Patchwork-Delegate: kuba@kernel.org Received: from szxga05-in.huawei.com (szxga05-in.huawei.com [45.249.212.191]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EF9D8FC1D; Tue, 30 Jul 2024 01:26:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.191 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722302814; cv=none; b=sCY+zaD9Fo/X4Ri5vsuTve7Jk2CkalxWPDl134uNx3tKnEg5fqfaC0qf+Nr+Ngh6RvEKNggyUTDzkub4VNXsqYXon8SWctr9TUsgOfPy/yAoFYDkSLFYEGPM3/NoVctNy9J9EiQfMm368LIiMoOeJOQhN/DGPoHv47HGakK8CUA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722302814; c=relaxed/simple; bh=iWGSzo43KxDdANSxUzF0CpLwSuh5p6IxhlTs6EuXPY0=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=PS9m5x3oxUKXg6teEw7TFSz/Ej/HFkxe5Jzojs/inNChhelSimQWGTY5AylyAn4I0ewCC9BhRpbCauLW0CyCyOXwxhiq9hK5dpR3sk9z9TNOrXYf3MUcXbG+UAZ7eAr8Hn8tgRCG1b/r3uJu7cbjasi4xg9MeEdCm3vyAwb7v6o= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.191 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.163.17]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4WXyDf0yW7z1HFLb; Tue, 30 Jul 2024 09:24:02 +0800 (CST) Received: from dggpeml500026.china.huawei.com (unknown [7.185.36.106]) by mail.maildlp.com (Postfix) with ESMTPS id 883A61A0188; Tue, 30 Jul 2024 09:26:49 +0800 (CST) Received: from huawei.com (10.175.101.6) by dggpeml500026.china.huawei.com (7.185.36.106) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Tue, 30 Jul 2024 09:26:48 +0800 From: Zhengchao Shao To: , , , , , CC: , , , , , , , Subject: [PATCH net-next 3/4] net/smc: remove redundant code in smc_connect_check_aclc Date: Tue, 30 Jul 2024 09:25:05 +0800 Message-ID: <20240730012506.3317978-4-shaozhengchao@huawei.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240730012506.3317978-1-shaozhengchao@huawei.com> References: <20240730012506.3317978-1-shaozhengchao@huawei.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To dggpeml500026.china.huawei.com (7.185.36.106) X-Patchwork-Delegate: kuba@kernel.org 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 --- 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 @@ static int smc_connect_ism(struct smc_sock *smc, 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 patchwork Tue Jul 30 01:25:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: shaozhengchao X-Patchwork-Id: 13746219 X-Patchwork-Delegate: kuba@kernel.org Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 687D28821; Tue, 30 Jul 2024 01:26:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.188 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722302814; cv=none; b=E6TyiYz4zSOreSLlKcHP9dVa4OFbyWDcaLooIDsA9uVKcdH/yr/kIkizbvt2s7jhS+H8ODwoJfj7nszQrI/zqhYId9/LGlZFbdnLuxCa5pu3GEzGm+qFVWJg5OnjT3U+faxlTNgdWioRUB7UPqW9RBndcQ8RBGGjyhpEFP572s0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722302814; c=relaxed/simple; bh=a+FhVQfrxbo7swIPC/6+TQEKmI4o6icFBkchvBs8GiE=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=dPs6UWC/PvCmYsCBRtaFyxmNW1LMnbx/7oVvwFLBNB/Q9YdwzQb+IrWPNGYaPOr1jUvUzs/DkVMmTRYZT4N0Gq4yZIOz58/DkAQWU1YIABvFR7tvsMCJTgJbmZDc0cE9FDFTo2BedwwgWEexbPc5FaU9eGduqFbeBR3xnZVO39I= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.188 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.163.48]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4WXyGm64d5znbXn; Tue, 30 Jul 2024 09:25:52 +0800 (CST) Received: from dggpeml500026.china.huawei.com (unknown [7.185.36.106]) by mail.maildlp.com (Postfix) with ESMTPS id 325A11800A1; Tue, 30 Jul 2024 09:26:50 +0800 (CST) Received: from huawei.com (10.175.101.6) by dggpeml500026.china.huawei.com (7.185.36.106) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Tue, 30 Jul 2024 09:26:49 +0800 From: Zhengchao Shao To: , , , , , CC: , , , , , , , Subject: [PATCH net-next 4/4] net/smc: remove unused input parameters in smcr_new_buf_create Date: Tue, 30 Jul 2024 09:25:06 +0800 Message-ID: <20240730012506.3317978-5-shaozhengchao@huawei.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240730012506.3317978-1-shaozhengchao@huawei.com> References: <20240730012506.3317978-1-shaozhengchao@huawei.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To dggpeml500026.china.huawei.com (7.185.36.106) X-Patchwork-Delegate: kuba@kernel.org 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 --- 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;