It's easier to have generic logic in just one place. Fixes: 6c52fdc244b5 ("rdma/siw: connection management") Signed-off-by: Stefan Metzmacher <metze@xxxxxxxxx> Cc: Bernard Metzler <bmt@xxxxxxxxxxxxxx> Cc: linux-rdma@xxxxxxxxxxxxxxx --- drivers/infiniband/sw/siw/siw_cm.c | 31 ++++++++---------------------- 1 file changed, 8 insertions(+), 23 deletions(-) diff --git a/drivers/infiniband/sw/siw/siw_cm.c b/drivers/infiniband/sw/siw/siw_cm.c index 5338be450285..d03c7a66c6d1 100644 --- a/drivers/infiniband/sw/siw/siw_cm.c +++ b/drivers/infiniband/sw/siw/siw_cm.c @@ -1127,31 +1127,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: -- 2.25.1