lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <21ff0148-9410-b399-d027-67c8ebc36c89@linux.ibm.com>
Date:   Wed, 8 Feb 2023 00:22:22 +0100
From:   Wenjia Zhang <wenjia@...ux.ibm.com>
To:     "D. Wythe" <alibuda@...ux.alibaba.com>, kgraul@...ux.ibm.com,
        jaka@...ux.ibm.com
Cc:     kuba@...nel.org, davem@...emloft.net, netdev@...r.kernel.org,
        linux-s390@...r.kernel.org, linux-rdma@...r.kernel.org
Subject: Re: [net-next 2/2] net/smc: make SMC_LLC_FLOW_RKEY run concurrently



On 07.02.23 08:36, D. Wythe wrote:
> From: "D. Wythe" <alibuda@...ux.alibaba.com>
> 
> Once confirm/delete rkey response can be multiplex delivered,
> We can allow parallel execution of start (remote) or
> initialization (local) a SMC_LLC_FLOW_RKEY flow.
> 
> This patch will count the flows executed in parallel, and only when
> the count reaches zero will the current flow type be removed.
> 
> Signed-off-by: D. Wythe <alibuda@...ux.alibaba.com>
> ---
>   net/smc/smc_core.h |  1 +
>   net/smc/smc_llc.c  | 89 ++++++++++++++++++++++++++++++++++++++++++------------
>   net/smc/smc_llc.h  |  6 ++++
>   3 files changed, 77 insertions(+), 19 deletions(-)
> 

[...]
>   /* start a new local llc flow, wait till current flow finished */
> @@ -289,6 +300,7 @@ int smc_llc_flow_initiate(struct smc_link_group *lgr,
>   			  enum smc_llc_flowtype type)
>   {
>   	enum smc_llc_flowtype allowed_remote = SMC_LLC_FLOW_NONE;
> +	bool accept = false;
>   	int rc;
>   
>   	/* all flows except confirm_rkey and delete_rkey are exclusive,
> @@ -300,10 +312,39 @@ int smc_llc_flow_initiate(struct smc_link_group *lgr,
>   	if (list_empty(&lgr->list))
>   		return -ENODEV;
>   	spin_lock_bh(&lgr->llc_flow_lock);
> -	if (lgr->llc_flow_lcl.type == SMC_LLC_FLOW_NONE &&
> -	    (lgr->llc_flow_rmt.type == SMC_LLC_FLOW_NONE ||
> -	     lgr->llc_flow_rmt.type == allowed_remote)) {
> -		lgr->llc_flow_lcl.type = type;
> +
> +	/* Flow is initialized only if the following conditions are met:
> +	 * incoming flow	local flow		remote flow
> +	 * exclusive		NONE			NONE
> +	 * SMC_LLC_FLOW_RKEY	SMC_LLC_FLOW_RKEY	SMC_LLC_FLOW_RKEY
> +	 * SMC_LLC_FLOW_RKEY	NONE			SMC_LLC_FLOW_RKEY
> +	 * SMC_LLC_FLOW_RKEY	SMC_LLC_FLOW_RKEY	NONE
> +	 */
> +	switch (type) {
> +	case SMC_LLC_FLOW_RKEY:
> +		if (!SMC_IS_PARALLEL_FLOW(lgr->llc_flow_lcl.type))
> +			break;
> +		if (!SMC_IS_PARALLEL_FLOW(lgr->llc_flow_rmt.type))
> +			break;
> +		/* accepted */
> +		accept = true;
> +		break;
> +	default:
> +		if (!SMC_IS_NONE_FLOW(lgr->llc_flow_lcl.type))
> +			break;
> +		if (!SMC_IS_NONE_FLOW(lgr->llc_flow_rmt.type))
> +			break;
> +		/* accepted */
> +		accept = true;
> +		break;
> +	}
> +	if (accept) {
> +		if (SMC_IS_NONE_FLOW(lgr->llc_flow_lcl.type)) {
> +			lgr->llc_flow_lcl.type = type;
> +			refcount_set(&lgr->llc_flow_lcl.parallel_refcnt, 1);
> +		} else {
> +			refcount_inc(&lgr->llc_flow_lcl.parallel_refcnt);
> +		}
>   		spin_unlock_bh(&lgr->llc_flow_lock);
>   		return 0;
>   	}

I like this.

[...]

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ