diff mbox series

[net,v2,1/2] net/smc: change function name from smc_find_ism_store_rc to smc_find_device_store_rc

Message ID 20231017124234.99574-2-guangguan.wang@linux.alibaba.com (mailing list archive)
State Changes Requested
Delegated to: Netdev Maintainers
Headers show
Series net/smc: correct the reason code in smc_listen_find_device when fallback | expand

Checks

Context Check Description
netdev/series_format success Posting correctly formatted
netdev/tree_selection success Clearly marked for net
netdev/fixes_present fail Series targets non-next tree, but doesn't contain any Fixes tags
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 1362 this patch: 1362
netdev/cc_maintainers success CCed 12 of 12 maintainers
netdev/build_clang success Errors and warnings before: 1386 this patch: 1386
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 1386 this patch: 1386
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 64 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Guangguan Wang Oct. 17, 2023, 12:42 p.m. UTC
The function smc_find_ism_store_rc is not only used for ism, so it is
reasonable to change the function name to smc_find_device_store_rc.

Signed-off-by: Guangguan Wang <guangguan.wang@linux.alibaba.com>
---
 net/smc/af_smc.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

Comments

Dust Li Oct. 18, 2023, 3:18 a.m. UTC | #1
On Tue, Oct 17, 2023 at 08:42:33PM +0800, Guangguan Wang wrote:
>The function smc_find_ism_store_rc is not only used for ism, so it is
>reasonable to change the function name to smc_find_device_store_rc.
>
>Signed-off-by: Guangguan Wang <guangguan.wang@linux.alibaba.com>

Reviewed-by: Dust Li <dust.li@linux.alibaba.com>

>---
> net/smc/af_smc.c | 16 ++++++++--------
> 1 file changed, 8 insertions(+), 8 deletions(-)
>
>diff --git a/net/smc/af_smc.c b/net/smc/af_smc.c
>index 35ddebae8894..b3a67a168495 100644
>--- a/net/smc/af_smc.c
>+++ b/net/smc/af_smc.c
>@@ -2122,7 +2122,7 @@ static void smc_check_ism_v2_match(struct smc_init_info *ini,
> 	}
> }
> 
>-static void smc_find_ism_store_rc(u32 rc, struct smc_init_info *ini)
>+static void smc_find_device_store_rc(u32 rc, struct smc_init_info *ini)
> {
> 	if (!ini->rc)
> 		ini->rc = rc;
>@@ -2164,7 +2164,7 @@ static void smc_find_ism_v2_device_serv(struct smc_sock *new_smc,
> 	mutex_unlock(&smcd_dev_list.mutex);
> 
> 	if (!ini->ism_dev[0]) {
>-		smc_find_ism_store_rc(SMC_CLC_DECL_NOSMCD2DEV, ini);
>+		smc_find_device_store_rc(SMC_CLC_DECL_NOSMCD2DEV, ini);
> 		goto not_found;
> 	}
> 
>@@ -2181,7 +2181,7 @@ static void smc_find_ism_v2_device_serv(struct smc_sock *new_smc,
> 		ini->ism_selected = i;
> 		rc = smc_listen_ism_init(new_smc, ini);
> 		if (rc) {
>-			smc_find_ism_store_rc(rc, ini);
>+			smc_find_device_store_rc(rc, ini);
> 			/* try next active ISM device */
> 			continue;
> 		}
>@@ -2218,7 +2218,7 @@ static void smc_find_ism_v1_device_serv(struct smc_sock *new_smc,
> 		return;		/* V1 ISM device found */
> 
> not_found:
>-	smc_find_ism_store_rc(rc, ini);
>+	smc_find_device_store_rc(rc, ini);
> 	ini->smcd_version &= ~SMC_V1;
> 	ini->ism_dev[0] = NULL;
> 	ini->is_smcd = false;
>@@ -2268,7 +2268,7 @@ static void smc_find_rdma_v2_device_serv(struct smc_sock *new_smc,
> 	ini->smcrv2.daddr = smc_ib_gid_to_ipv4(smc_v2_ext->roce);
> 	rc = smc_find_rdma_device(new_smc, ini);
> 	if (rc) {
>-		smc_find_ism_store_rc(rc, ini);
>+		smc_find_device_store_rc(rc, ini);
> 		goto not_found;
> 	}
> 	if (!ini->smcrv2.uses_gateway)
>@@ -2285,7 +2285,7 @@ static void smc_find_rdma_v2_device_serv(struct smc_sock *new_smc,
> 	if (!rc)
> 		return;
> 	ini->smcr_version = smcr_version;
>-	smc_find_ism_store_rc(rc, ini);
>+	smc_find_device_store_rc(rc, ini);
> 
> not_found:
> 	ini->smcr_version &= ~SMC_V2;
>@@ -2332,7 +2332,7 @@ static int smc_listen_find_device(struct smc_sock *new_smc,
> 	/* check for matching IP prefix and subnet length (V1) */
> 	prfx_rc = smc_listen_prfx_check(new_smc, pclc);
> 	if (prfx_rc)
>-		smc_find_ism_store_rc(prfx_rc, ini);
>+		smc_find_device_store_rc(prfx_rc, ini);
> 
> 	/* get vlan id from IP device */
> 	if (smc_vlan_by_tcpsk(new_smc->clcsock, ini))
>@@ -2359,7 +2359,7 @@ static int smc_listen_find_device(struct smc_sock *new_smc,
> 		int rc;
> 
> 		rc = smc_find_rdma_v1_device_serv(new_smc, pclc, ini);
>-		smc_find_ism_store_rc(rc, ini);
>+		smc_find_device_store_rc(rc, ini);
> 		return (!rc) ? 0 : ini->rc;
> 	}
> 	return prfx_rc;
>-- 
>2.24.3 (Apple Git-128)
Wenjia Zhang Oct. 18, 2023, 7:44 p.m. UTC | #2
On 17.10.23 14:42, Guangguan Wang wrote:
> The function smc_find_ism_store_rc is not only used for ism, so it is
> reasonable to change the function name to smc_find_device_store_rc.
> 
> Signed-off-by: Guangguan Wang <guangguan.wang@linux.alibaba.com>

Reviewed-by: Wenjia Zhang <wenjia@linux.ibm.com>
Wenjia Zhang Oct. 18, 2023, 7:47 p.m. UTC | #3
On 17.10.23 14:42, Guangguan Wang wrote:
> The function smc_find_ism_store_rc is not only used for ism, so it is
> reasonable to change the function name to smc_find_device_store_rc.
> 
> Signed-off-by: Guangguan Wang <guangguan.wang@linux.alibaba.com>
> ---

same as the patch [2/2], please see the comment from Jakub

>   net/smc/af_smc.c | 16 ++++++++--------
>   1 file changed, 8 insertions(+), 8 deletions(-)
> 
> diff --git a/net/smc/af_smc.c b/net/smc/af_smc.c
> index 35ddebae8894..b3a67a168495 100644
> --- a/net/smc/af_smc.c
> +++ b/net/smc/af_smc.c
> @@ -2122,7 +2122,7 @@ static void smc_check_ism_v2_match(struct smc_init_info *ini,
>   	}
>   }
>   
> -static void smc_find_ism_store_rc(u32 rc, struct smc_init_info *ini)
> +static void smc_find_device_store_rc(u32 rc, struct smc_init_info *ini)
>   {
>   	if (!ini->rc)
>   		ini->rc = rc;
> @@ -2164,7 +2164,7 @@ static void smc_find_ism_v2_device_serv(struct smc_sock *new_smc,
>   	mutex_unlock(&smcd_dev_list.mutex);
>   
>   	if (!ini->ism_dev[0]) {
> -		smc_find_ism_store_rc(SMC_CLC_DECL_NOSMCD2DEV, ini);
> +		smc_find_device_store_rc(SMC_CLC_DECL_NOSMCD2DEV, ini);
>   		goto not_found;
>   	}
>   
> @@ -2181,7 +2181,7 @@ static void smc_find_ism_v2_device_serv(struct smc_sock *new_smc,
>   		ini->ism_selected = i;
>   		rc = smc_listen_ism_init(new_smc, ini);
>   		if (rc) {
> -			smc_find_ism_store_rc(rc, ini);
> +			smc_find_device_store_rc(rc, ini);
>   			/* try next active ISM device */
>   			continue;
>   		}
> @@ -2218,7 +2218,7 @@ static void smc_find_ism_v1_device_serv(struct smc_sock *new_smc,
>   		return;		/* V1 ISM device found */
>   
>   not_found:
> -	smc_find_ism_store_rc(rc, ini);
> +	smc_find_device_store_rc(rc, ini);
>   	ini->smcd_version &= ~SMC_V1;
>   	ini->ism_dev[0] = NULL;
>   	ini->is_smcd = false;
> @@ -2268,7 +2268,7 @@ static void smc_find_rdma_v2_device_serv(struct smc_sock *new_smc,
>   	ini->smcrv2.daddr = smc_ib_gid_to_ipv4(smc_v2_ext->roce);
>   	rc = smc_find_rdma_device(new_smc, ini);
>   	if (rc) {
> -		smc_find_ism_store_rc(rc, ini);
> +		smc_find_device_store_rc(rc, ini);
>   		goto not_found;
>   	}
>   	if (!ini->smcrv2.uses_gateway)
> @@ -2285,7 +2285,7 @@ static void smc_find_rdma_v2_device_serv(struct smc_sock *new_smc,
>   	if (!rc)
>   		return;
>   	ini->smcr_version = smcr_version;
> -	smc_find_ism_store_rc(rc, ini);
> +	smc_find_device_store_rc(rc, ini);
>   
>   not_found:
>   	ini->smcr_version &= ~SMC_V2;
> @@ -2332,7 +2332,7 @@ static int smc_listen_find_device(struct smc_sock *new_smc,
>   	/* check for matching IP prefix and subnet length (V1) */
>   	prfx_rc = smc_listen_prfx_check(new_smc, pclc);
>   	if (prfx_rc)
> -		smc_find_ism_store_rc(prfx_rc, ini);
> +		smc_find_device_store_rc(prfx_rc, ini);
>   
>   	/* get vlan id from IP device */
>   	if (smc_vlan_by_tcpsk(new_smc->clcsock, ini))
> @@ -2359,7 +2359,7 @@ static int smc_listen_find_device(struct smc_sock *new_smc,
>   		int rc;
>   
>   		rc = smc_find_rdma_v1_device_serv(new_smc, pclc, ini);
> -		smc_find_ism_store_rc(rc, ini);
> +		smc_find_device_store_rc(rc, ini);
>   		return (!rc) ? 0 : ini->rc;
>   	}
>   	return prfx_rc;
diff mbox series

Patch

diff --git a/net/smc/af_smc.c b/net/smc/af_smc.c
index 35ddebae8894..b3a67a168495 100644
--- a/net/smc/af_smc.c
+++ b/net/smc/af_smc.c
@@ -2122,7 +2122,7 @@  static void smc_check_ism_v2_match(struct smc_init_info *ini,
 	}
 }
 
-static void smc_find_ism_store_rc(u32 rc, struct smc_init_info *ini)
+static void smc_find_device_store_rc(u32 rc, struct smc_init_info *ini)
 {
 	if (!ini->rc)
 		ini->rc = rc;
@@ -2164,7 +2164,7 @@  static void smc_find_ism_v2_device_serv(struct smc_sock *new_smc,
 	mutex_unlock(&smcd_dev_list.mutex);
 
 	if (!ini->ism_dev[0]) {
-		smc_find_ism_store_rc(SMC_CLC_DECL_NOSMCD2DEV, ini);
+		smc_find_device_store_rc(SMC_CLC_DECL_NOSMCD2DEV, ini);
 		goto not_found;
 	}
 
@@ -2181,7 +2181,7 @@  static void smc_find_ism_v2_device_serv(struct smc_sock *new_smc,
 		ini->ism_selected = i;
 		rc = smc_listen_ism_init(new_smc, ini);
 		if (rc) {
-			smc_find_ism_store_rc(rc, ini);
+			smc_find_device_store_rc(rc, ini);
 			/* try next active ISM device */
 			continue;
 		}
@@ -2218,7 +2218,7 @@  static void smc_find_ism_v1_device_serv(struct smc_sock *new_smc,
 		return;		/* V1 ISM device found */
 
 not_found:
-	smc_find_ism_store_rc(rc, ini);
+	smc_find_device_store_rc(rc, ini);
 	ini->smcd_version &= ~SMC_V1;
 	ini->ism_dev[0] = NULL;
 	ini->is_smcd = false;
@@ -2268,7 +2268,7 @@  static void smc_find_rdma_v2_device_serv(struct smc_sock *new_smc,
 	ini->smcrv2.daddr = smc_ib_gid_to_ipv4(smc_v2_ext->roce);
 	rc = smc_find_rdma_device(new_smc, ini);
 	if (rc) {
-		smc_find_ism_store_rc(rc, ini);
+		smc_find_device_store_rc(rc, ini);
 		goto not_found;
 	}
 	if (!ini->smcrv2.uses_gateway)
@@ -2285,7 +2285,7 @@  static void smc_find_rdma_v2_device_serv(struct smc_sock *new_smc,
 	if (!rc)
 		return;
 	ini->smcr_version = smcr_version;
-	smc_find_ism_store_rc(rc, ini);
+	smc_find_device_store_rc(rc, ini);
 
 not_found:
 	ini->smcr_version &= ~SMC_V2;
@@ -2332,7 +2332,7 @@  static int smc_listen_find_device(struct smc_sock *new_smc,
 	/* check for matching IP prefix and subnet length (V1) */
 	prfx_rc = smc_listen_prfx_check(new_smc, pclc);
 	if (prfx_rc)
-		smc_find_ism_store_rc(prfx_rc, ini);
+		smc_find_device_store_rc(prfx_rc, ini);
 
 	/* get vlan id from IP device */
 	if (smc_vlan_by_tcpsk(new_smc->clcsock, ini))
@@ -2359,7 +2359,7 @@  static int smc_listen_find_device(struct smc_sock *new_smc,
 		int rc;
 
 		rc = smc_find_rdma_v1_device_serv(new_smc, pclc, ini);
-		smc_find_ism_store_rc(rc, ini);
+		smc_find_device_store_rc(rc, ini);
 		return (!rc) ? 0 : ini->rc;
 	}
 	return prfx_rc;