@@ -1126,31 +1126,16 @@ static void siw_cm_work_handler(struct work_struct *w)
break;
case SIW_CM_WORK_MPATIMEOUT:
+ /*
+ * MPA request timed out:
+ * Hide any partially received private data and signal
+ * timeout
+ */
cep->mpa_timer = NULL;
+ cep->mpa.hdr.params.pd_len = 0;
+ __siw_cep_terminate_upcall(cep, -ETIMEDOUT);
- if (cep->state == SIW_EPSTATE_AWAIT_MPAREP) {
- /*
- * MPA request timed out:
- * Hide any partially received private data and signal
- * timeout
- */
- cep->mpa.hdr.params.pd_len = 0;
-
- if (cep->cm_id)
- siw_cm_upcall(cep, IW_CM_EVENT_CONNECT_REPLY,
- -ETIMEDOUT);
- release_cep = 1;
-
- } else if (cep->state == SIW_EPSTATE_AWAIT_MPAREQ) {
- /*
- * No MPA request received after peer TCP stream setup.
- */
- if (cep->listen_cep) {
- siw_cep_put(cep->listen_cep);
- cep->listen_cep = NULL;
- }
- release_cep = 1;
- }
+ release_cep = 1;
break;
default:
It's easier to have generic logic in just one place. 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 | 31 ++++++++---------------------- 1 file changed, 8 insertions(+), 23 deletions(-)