All of lore.kernel.org
 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/10] net/smc: reduce smc_listen_decline() calls
Date: Thu, 10 Sep 2020 18:48:25 +0200	[thread overview]
Message-ID: <20200910164829.65426-7-kgraul@linux.ibm.com> (raw)
In-Reply-To: <20200910164829.65426-1-kgraul@linux.ibm.com>

From: Ursula Braun <ubraun@linux.ibm.com>

smc_listen_work() contains already an smc_listen_decline() exit.
Use this exit for smc_listen_rdma_finish() problems as well.

Signed-off-by: Ursula Braun <ubraun@linux.ibm.com>
Signed-off-by: Karsten Graul <kgraul@linux.ibm.com>
---
 net/smc/af_smc.c | 22 ++++++----------------
 1 file changed, 6 insertions(+), 16 deletions(-)

diff --git a/net/smc/af_smc.c b/net/smc/af_smc.c
index f27a596b2624..9f3e148c60c5 100644
--- a/net/smc/af_smc.c
+++ b/net/smc/af_smc.c
@@ -1233,27 +1233,17 @@ static int smc_listen_rdma_finish(struct smc_sock *new_smc,
 	if (local_first)
 		smc_link_save_peer_info(link, cclc);
 
-	if (smc_rmb_rtoken_handling(&new_smc->conn, link, cclc)) {
-		reason_code = SMC_CLC_DECL_ERR_RTOK;
-		goto decline;
-	}
+	if (smc_rmb_rtoken_handling(&new_smc->conn, link, cclc))
+		return SMC_CLC_DECL_ERR_RTOK;
 
 	if (local_first) {
-		if (smc_ib_ready_link(link)) {
-			reason_code = SMC_CLC_DECL_ERR_RDYLNK;
-			goto decline;
-		}
+		if (smc_ib_ready_link(link))
+			return SMC_CLC_DECL_ERR_RDYLNK;
 		/* QP confirmation over RoCE fabric */
 		smc_llc_flow_initiate(link->lgr, SMC_LLC_FLOW_ADD_LINK);
 		reason_code = smcr_serv_conf_first_link(new_smc);
 		smc_llc_flow_stop(link->lgr, &link->lgr->llc_flow_lcl);
-		if (reason_code)
-			goto decline;
 	}
-	return 0;
-
-decline:
-	smc_listen_decline(new_smc, reason_code, local_first);
 	return reason_code;
 }
 
@@ -1382,9 +1372,9 @@ static void smc_listen_work(struct work_struct *work)
 	if (!ism_supported) {
 		rc = smc_listen_rdma_finish(new_smc, &cclc,
 					    ini.first_contact_local);
-		mutex_unlock(&smc_server_lgr_pending);
 		if (rc)
-			return;
+			goto out_unlock;
+		mutex_unlock(&smc_server_lgr_pending);
 	}
 	smc_conn_save_peer_info(new_smc, &cclc);
 	smc_listen_out_connected(new_smc);
-- 
2.17.1


  parent reply	other threads:[~2020-09-10 16:51 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-10 16:48 [PATCH net-next 00/10] net/smc: updates 2020-09-10 Karsten Graul
2020-09-10 16:48 ` [PATCH net-next 01/10] net/smc: reduce active tcp_listen workers Karsten Graul
2020-09-10 16:48 ` [PATCH net-next 02/10] net/smc: introduce better field names Karsten Graul
2020-09-10 16:48 ` [PATCH net-next 03/10] net/smc: dynamic allocation of CLC proposal buffer Karsten Graul
2020-09-10 16:48 ` [PATCH net-next 04/10] net/smc: common routine for CLC accept and confirm Karsten Graul
2020-09-10 16:48 ` [PATCH net-next 05/10] net/smc: improve server ISM device determination Karsten Graul
2020-09-10 16:48 ` Karsten Graul [this message]
2020-09-10 16:48 ` [PATCH net-next 07/10] net/smc: immediate freeing in smc_lgr_cleanup_early() Karsten Graul
2020-09-10 16:48 ` [PATCH net-next 08/10] s390/net: add SMC config as one of the defaults of CCWGROUP Karsten Graul
2020-09-10 16:48 ` [PATCH net-next 09/10] net/smc: use the retry mechanism for netlink messages Karsten Graul
2020-09-10 16:48 ` [PATCH net-next 10/10] net/smc: use separate work queues for different worker types Karsten Graul
2020-09-10 22:24 ` [PATCH net-next 00/10] net/smc: updates 2020-09-10 David Miller

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=20200910164829.65426-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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.