From patchwork Wed Jun 15 15:26:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Metzmacher X-Patchwork-Id: 12882580 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B61EACCA480 for ; Wed, 15 Jun 2022 15:29:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348439AbiFOP3i (ORCPT ); Wed, 15 Jun 2022 11:29:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48124 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1355712AbiFOP2l (ORCPT ); Wed, 15 Jun 2022 11:28:41 -0400 Received: from hr2.samba.org (hr2.samba.org [IPv6:2a01:4f8:192:486::2:0]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AE78D4338E for ; Wed, 15 Jun 2022 08:27:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=samba.org; s=42; h=Message-Id:Date:Cc:To:From; bh=K1YBsWTlv3dUju28IUgerHcp1VUDHyN7zkNFBdM0XsI=; b=fsyaotPoeJqLxjPLN6gyv9UhVp z0mFvHDoQkVM1Amu77pVTtk9Sq7RtG0FNdUfEyR9gwM2HVKAdLrFYt05g5+Bm1L6OrHZmxA/46I72 5whVAJdbC03ofFKV7D+tbp62YxmLNLqwbIbrLdMzB1dLgAwLMbqZmNNiL/l4hNAxKLYTZnH1bQ+9c yFexL7mc/AQhMZnRq2+kDXEQ1Zf7DHfbALxSWhPIbZr3P6ZcPPzFIRUBeW2vPFhahp2HtM7GJHU0z DqTZphSdAzKx6mN+eByDK3dWj7D7ZbSgEOldHGkW5Sx3HD4cNXL1DxDrxInI7yb5Q2IR/mm+cTsUv hLSX1zqD17og4ZW9IoDvtmz2kJYra0QOUGvArQJ7LyjNFZn/5iKRZrPw9LRBAX4+Nxgj2flQ8lP7d 0dNokVcaHZmg9oVrLhQNFG383rmrffeVK0M7QwGoAixJMIn1SxpBNLZeyOWK2LHpu3OkdYPxuaAbP fFTFRCfzsI0WqmZxz+mBbMmQ; Received: from [127.0.0.2] (localhost [127.0.0.1]) by hr2.samba.org with esmtpsa (TLS1.3:ECDHE_SECP256R1__ECDSA_SECP256R1_SHA256__CHACHA20_POLY1305:256) (Exim) id 1o1Uvu-005ruG-FQ; Wed, 15 Jun 2022 15:27:50 +0000 From: Stefan Metzmacher To: Bernard Metzler , linux-rdma@vger.kernel.org Cc: Stefan Metzmacher Subject: [PATCH v2 07/14] rdma/siw: handle SIW_EPSTATE_CONNECTING in __siw_cep_terminate_upcall() Date: Wed, 15 Jun 2022 17:26:45 +0200 Message-Id: <4afcaaa2ba7bfe248f12030bd9168c70bbeb0fb2.1655305567.git.metze@samba.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org The final patch will implement a non-blocking connect, which means SIW_CM_WORK_MPATIMEOUT can also happen during SIW_EPSTATE_CONNECTING. Fixes: 6c52fdc244b5 ("rdma/siw: connection management") Signed-off-by: Stefan Metzmacher Cc: Bernard Metzler Cc: linux-rdma@vger.kernel.org --- drivers/infiniband/sw/siw/siw_cm.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/infiniband/sw/siw/siw_cm.c b/drivers/infiniband/sw/siw/siw_cm.c index 56c484f85160..80e1d5b274e7 100644 --- a/drivers/infiniband/sw/siw/siw_cm.c +++ b/drivers/infiniband/sw/siw/siw_cm.c @@ -125,6 +125,14 @@ static void __siw_cep_terminate_upcall(struct siw_cep *cep, } switch (cep->state) { + case SIW_EPSTATE_CONNECTING: + /* + * The TCP connect got rejected or timed out. + */ + siw_cm_upcall(cep, IW_CM_EVENT_CONNECT_REPLY, + reply_status); + break; + case SIW_EPSTATE_AWAIT_MPAREP: /* * MPA reply not received, but connection drop, @@ -164,7 +172,6 @@ static void __siw_cep_terminate_upcall(struct siw_cep *cep, case SIW_EPSTATE_IDLE: case SIW_EPSTATE_LISTENING: - case SIW_EPSTATE_CONNECTING: case SIW_EPSTATE_CLOSED: default: /*