All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefan Metzmacher <metze@samba.org>
To: Bernard Metzler <bmt@zurich.ibm.com>, linux-rdma@vger.kernel.org
Cc: Stefan Metzmacher <metze@samba.org>
Subject: [PATCH 4/7] rdma/siw: use error and out logic at the end of siw_connect()
Date: Wed, 15 Jun 2022 10:40:04 +0200	[thread overview]
Message-ID: <954c86484412d79ce9116e67fdf0efb94add67ba.1655248086.git.metze@samba.org> (raw)
In-Reply-To: <cover.1655248086.git.metze@samba.org>

This will make the following changes easier.

Fixes: 6c52fdc244b5 ("rdma/siw: connection management")
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Cc: Bernard Metzler <bmt@zurich.ibm.com>
Cc: linux-rdma@vger.kernel.org
---
 drivers/infiniband/sw/siw/siw_cm.c | 19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)

diff --git a/drivers/infiniband/sw/siw/siw_cm.c b/drivers/infiniband/sw/siw/siw_cm.c
index 0e53219d29de..b19a2b777814 100644
--- a/drivers/infiniband/sw/siw/siw_cm.c
+++ b/drivers/infiniband/sw/siw/siw_cm.c
@@ -1489,14 +1489,19 @@ int siw_connect(struct iw_cm_id *id, struct iw_cm_conn_param *params)
 		cep->mpa.pdata = NULL;
 	}
 
-	if (rv >= 0) {
-		rv = siw_cm_queue_work(cep, SIW_CM_WORK_MPATIMEOUT);
-		if (!rv) {
-			siw_dbg_cep(cep, "[QP %u]: exit\n", qp_id(qp));
-			siw_cep_set_free(cep);
-			return 0;
-		}
+	if (rv < 0) {
+		goto error;
+	}
+
+	rv = siw_cm_queue_work(cep, SIW_CM_WORK_MPATIMEOUT);
+	if (rv != 0) {
+		goto error;
 	}
+
+	siw_dbg_cep(cep, "[QP %u]: exit\n", qp_id(qp));
+	siw_cep_set_free(cep);
+	return 0;
+
 error:
 	siw_dbg(id->device, "failed: %d\n", rv);
 
-- 
2.34.1


  parent reply	other threads:[~2022-06-15  8:41 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-15  8:40 [PATCH 0/7] rdma/siw: implement non-blocking connect Stefan Metzmacher
2022-06-15  8:40 ` [PATCH 1/7] rdma/siw: make use of kernel_{bind,connect,listen}() Stefan Metzmacher
2022-06-15  8:40 ` [PATCH 2/7] rdma/siw: let siw_connect() set AWAIT_MPAREP before siw_send_mpareqrep() Stefan Metzmacher
2022-06-15  8:40 ` [PATCH 3/7] rdma/siw: create a temporary copy of private data Stefan Metzmacher
2022-06-15  8:40 ` Stefan Metzmacher [this message]
2022-06-15  8:40 ` [PATCH 5/7] rdma/siw: start mpa timer before calling siw_send_mpareqrep() Stefan Metzmacher
2022-06-15 10:08   ` Cheng Xu
2022-06-15 10:34     ` Stefan Metzmacher
2022-06-15  8:40 ` [PATCH 6/7] rdma/siw: call the blocking kernel_bindconnect() just before siw_send_mpareqrep() Stefan Metzmacher
2022-06-15  8:40 ` [PATCH 7/7] rdma/siw: implement non-blocking connect Stefan Metzmacher
2022-06-15  9:56   ` Cheng Xu
2022-06-15 10:14     ` Cheng Xu
2022-06-15 15:26 ` [PATCH v2 00/14] " Stefan Metzmacher
2022-06-15 15:26   ` [PATCH v2 01/14] rdma/siw: remove superfluous siw_cep_put() from siw_connect() error path Stefan Metzmacher
2022-06-15 15:26   ` [PATCH v2 02/14] rdma/siw: make siw_cm_upcall() a noop without valid 'id' Stefan Metzmacher
2022-06-15 15:26   ` [PATCH v2 03/14] rdma/siw: split out a __siw_cep_terminate_upcall() function Stefan Metzmacher
2022-06-15 15:26   ` [PATCH v2 04/14] rdma/siw: use __siw_cep_terminate_upcall() for indirect SIW_CM_WORK_CLOSE_LLP Stefan Metzmacher
2022-06-15 15:26   ` [PATCH v2 05/14] rdma/siw: use __siw_cep_terminate_upcall() for SIW_CM_WORK_PEER_CLOSE Stefan Metzmacher
2022-06-15 15:26   ` [PATCH v2 06/14] rdma/siw: use __siw_cep_terminate_upcall() for SIW_CM_WORK_MPATIMEOUT Stefan Metzmacher
2022-06-15 15:26   ` [PATCH v2 07/14] rdma/siw: handle SIW_EPSTATE_CONNECTING in __siw_cep_terminate_upcall() Stefan Metzmacher
2022-06-15 15:26   ` [PATCH v2 08/14] rdma/siw: make use of kernel_{bind,connect,listen}() Stefan Metzmacher
2022-06-15 15:26   ` [PATCH v2 09/14] rdma/siw: let siw_connect() set AWAIT_MPAREP before siw_send_mpareqrep() Stefan Metzmacher
2022-06-15 15:26   ` [PATCH v2 10/14] rdma/siw: create a temporary copy of private data Stefan Metzmacher
2022-06-15 15:26   ` [PATCH v2 11/14] rdma/siw: use error and out logic at the end of siw_connect() Stefan Metzmacher
2022-06-15 15:26   ` [PATCH v2 12/14] rdma/siw: start mpa timer before calling siw_send_mpareqrep() Stefan Metzmacher
2022-06-15 15:26   ` [PATCH v2 13/14] rdma/siw: call the blocking kernel_bindconnect() just before siw_send_mpareqrep() Stefan Metzmacher
2022-06-15 15:26   ` [PATCH v2 14/14] rdma/siw: implement non-blocking connect Stefan Metzmacher

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=954c86484412d79ce9116e67fdf0efb94add67ba.1655248086.git.metze@samba.org \
    --to=metze@samba.org \
    --cc=bmt@zurich.ibm.com \
    --cc=linux-rdma@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 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.