From: Wenjia Zhang <wenjia@linux.ibm.com>
To: "D. Wythe" <alibuda@linux.alibaba.com>,
kgraul@linux.ibm.com, jaka@linux.ibm.com
Cc: kuba@kernel.org, davem@davemloft.net, netdev@vger.kernel.org,
linux-s390@vger.kernel.org, linux-rdma@vger.kernel.org
Subject: Re: [net-next 2/2] net/smc: make SMC_LLC_FLOW_RKEY run concurrently
Date: Wed, 8 Feb 2023 00:22:22 +0100 [thread overview]
Message-ID: <21ff0148-9410-b399-d027-67c8ebc36c89@linux.ibm.com> (raw)
In-Reply-To: <1675755374-107598-3-git-send-email-alibuda@linux.alibaba.com>
On 07.02.23 08:36, D. Wythe wrote:
> From: "D. Wythe" <alibuda@linux.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@linux.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.
[...]
next prev parent reply other threads:[~2023-02-07 23:22 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-07 7:36 [net-next 0/2] Deliver confirm/delete rkey message in parallel D. Wythe
2023-02-07 7:36 ` [net-next 1/2] net/smc: allow confirm/delete rkey response deliver multiplex D. Wythe
2023-02-07 23:15 ` Wenjia Zhang
2023-02-08 2:58 ` D. Wythe
2023-02-07 7:36 ` [net-next 2/2] net/smc: make SMC_LLC_FLOW_RKEY run concurrently D. Wythe
2023-02-07 23:22 ` Wenjia Zhang [this message]
2023-02-07 23:29 ` [net-next 0/2] Deliver confirm/delete rkey message in parallel Wenjia Zhang
2023-02-08 3:04 ` D. Wythe
2023-02-08 3:09 ` D. Wythe
2023-02-21 18:41 ` Wenjia Zhang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=21ff0148-9410-b399-d027-67c8ebc36c89@linux.ibm.com \
--to=wenjia@linux.ibm.com \
--cc=alibuda@linux.alibaba.com \
--cc=davem@davemloft.net \
--cc=jaka@linux.ibm.com \
--cc=kgraul@linux.ibm.com \
--cc=kuba@kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox