netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Karsten Graul <kgraul@linux.ibm.com>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, linux-s390@vger.kernel.org,
	heiko.carstens@de.ibm.com, raspl@linux.ibm.com,
	ubraun@linux.ibm.com
Subject: [PATCH net-next 06/13] net/smc: final part of add link processing as SMC server
Date: Sat,  2 May 2020 14:35:45 +0200	[thread overview]
Message-ID: <20200502123552.17204-7-kgraul@linux.ibm.com> (raw)
In-Reply-To: <20200502123552.17204-1-kgraul@linux.ibm.com>

This patch finalizes the ADD_LINK processing of new links. Send the
CONFIRM_LINK request to the peer, receive the response and set link
state to ACTIVE.

Signed-off-by: Karsten Graul <kgraul@linux.ibm.com>
Reviewed-by: Ursula Braun <ubraun@linux.ibm.com>
---
 net/smc/smc_llc.c | 29 ++++++++++++++++++++++++++++-
 1 file changed, 28 insertions(+), 1 deletion(-)

diff --git a/net/smc/smc_llc.c b/net/smc/smc_llc.c
index e1d61b6b083b..20ce29b88b50 100644
--- a/net/smc/smc_llc.c
+++ b/net/smc/smc_llc.c
@@ -904,6 +904,33 @@ static int smc_llc_srv_rkey_exchange(struct smc_link *link,
 	return rc;
 }
 
+static int smc_llc_srv_conf_link(struct smc_link *link,
+				 struct smc_link *link_new,
+				 enum smc_lgr_type lgr_new_t)
+{
+	struct smc_link_group *lgr = link->lgr;
+	struct smc_llc_qentry *qentry = NULL;
+	int rc;
+
+	/* send CONFIRM LINK request over the RoCE fabric */
+	rc = smc_llc_send_confirm_link(link_new, SMC_LLC_REQ);
+	if (rc)
+		return -ENOLINK;
+	/* receive CONFIRM LINK response over the RoCE fabric */
+	qentry = smc_llc_wait(lgr, link, SMC_LLC_WAIT_FIRST_TIME,
+			      SMC_LLC_CONFIRM_LINK);
+	if (!qentry) {
+		/* send DELETE LINK */
+		smc_llc_send_delete_link(link, link_new->link_id, SMC_LLC_REQ,
+					 false, SMC_LLC_DEL_LOST_PATH);
+		return -ENOLINK;
+	}
+	smc_llc_link_active(link_new);
+	lgr->type = lgr_new_t;
+	smc_llc_flow_qentry_del(&lgr->llc_flow_lcl);
+	return 0;
+}
+
 int smc_llc_srv_add_link(struct smc_link *link)
 {
 	enum smc_lgr_type lgr_new_t = SMC_LGR_SYMMETRIC;
@@ -967,7 +994,7 @@ int smc_llc_srv_add_link(struct smc_link *link)
 	rc = smc_llc_srv_rkey_exchange(link, link_new);
 	if (rc)
 		goto out_err;
-	/* tbd: rc = smc_llc_srv_conf_link(link, link_new, lgr_new_t); */
+	rc = smc_llc_srv_conf_link(link, link_new, lgr_new_t);
 	if (rc)
 		goto out_err;
 	return 0;
-- 
2.17.1


  parent reply	other threads:[~2020-05-02 12:36 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-02 12:35 [PATCH net-next 00/13] net/smc: add and delete link processing Karsten Graul
2020-05-02 12:35 ` [PATCH net-next 01/13] net/smc: first part of add link processing as SMC client Karsten Graul
2020-05-02 23:38   ` David Miller
2020-05-02 12:35 ` [PATCH net-next 02/13] net/smc: rkey processing for a new link " Karsten Graul
2020-05-02 12:35 ` [PATCH net-next 03/13] net/smc: final part of add link processing " Karsten Graul
2020-05-02 12:35 ` [PATCH net-next 04/13] net/smc: first part of add link processing as SMC server Karsten Graul
2020-05-02 12:35 ` [PATCH net-next 05/13] net/smc: rkey processing for a new link " Karsten Graul
2020-05-02 12:35 ` Karsten Graul [this message]
2020-05-02 12:35 ` [PATCH net-next 07/13] net/smc: delete an asymmetric " Karsten Graul
2020-05-02 12:35 ` [PATCH net-next 08/13] net/smc: activate SMC server add link functions Karsten Graul
2020-05-02 12:35 ` [PATCH net-next 09/13] net/smc: llc_del_link_work and use the LLC flow for delete link Karsten Graul
2020-05-02 12:35 ` [PATCH net-next 10/13] net/smc: delete link processing as SMC client Karsten Graul
2020-05-02 12:35 ` [PATCH net-next 11/13] net/smc: delete link processing as SMC server Karsten Graul
2020-05-02 12:35 ` [PATCH net-next 12/13] net/smc: enqueue local LLC messages Karsten Graul
2020-05-02 12:35 ` [PATCH net-next 13/13] net/smc: save state of last sent CDC message Karsten Graul

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=20200502123552.17204-7-kgraul@linux.ibm.com \
    --to=kgraul@linux.ibm.com \
    --cc=davem@davemloft.net \
    --cc=heiko.carstens@de.ibm.com \
    --cc=linux-s390@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=raspl@linux.ibm.com \
    --cc=ubraun@linux.ibm.com \
    /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;
as well as URLs for NNTP newsgroup(s).