From patchwork Mon Apr 4 08:58:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leon Romanovsky X-Patchwork-Id: 12800021 X-Patchwork-Delegate: jgg@ziepe.ca 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 0A740C433EF for ; Mon, 4 Apr 2022 08:58:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343612AbiDDJAQ (ORCPT ); Mon, 4 Apr 2022 05:00:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43508 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245362AbiDDJAO (ORCPT ); Mon, 4 Apr 2022 05:00:14 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 82B4C3BA5D for ; Mon, 4 Apr 2022 01:58:19 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 1F2CD6140C for ; Mon, 4 Apr 2022 08:58:19 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0FD57C34110; Mon, 4 Apr 2022 08:58:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1649062698; bh=Y6gLhe52+PxEjLMtlOIxTBfTt73M1h9sp3Hw+NQYlJo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FgE42Dv2Ovzql7993l3jVCccqJUJmb8yCkLUHqGvzdSTAbbF7WbuEAr0u7fe8QlRy bou1Htl8lU+kotvbYuEOpny9En+yN58wm3n8KzblYWb/8K6tvgyPnwQmcwVoblZweR WrePEJ1sowf/B9Cv6FKp2pCFqPISVEY7Y4ZfnPfh1g8xHGtkT3U1a8wfC99va3XSQ6 RZ0v5vnSs3oo/0QyXUZRh33E4JwFFdIwTOrx4KTMOKTqrSylWuoXEUhVtnde6oBFRc pZYyTs+JiQz5WQDlJ+JN+YAMpvcE4TKcjryZaM6ftvN7dSzhm6KfSEgcmOgV+ZKGIg LyYIO1P3AVjrw== From: Leon Romanovsky To: Jason Gunthorpe Cc: Mark Zhang , Aharon Landau , linux-rdma@vger.kernel.org, Maor Gottlieb , Shay Drory Subject: [PATCH rdma-rc v1 3/3] IB/cm: Cancel mad on the DREQ event when the state is MRA_REP_RCVD Date: Mon, 4 Apr 2022 11:58:05 +0300 Message-Id: <75261c00c1d82128b1d981af9ff46e994186e621.1649062436.git.leonro@nvidia.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org From: Mark Zhang On the passive side when the disconnectReq event comes, if the current state is MRA_REP_RCVD, it needs to cancel the MAD before enter the DREQ_RCVD and TIMEWAIT state, otherwise the destroy_id may block until this mad will reach timeout. Fixes: a977049dacde ("[PATCH] IB: Add the kernel CM implementation") Signed-off-by: Mark Zhang Reviewed-by: Maor Gottlieb Signed-off-by: Leon Romanovsky --- drivers/infiniband/core/cm.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/infiniband/core/cm.c b/drivers/infiniband/core/cm.c index 35f0d5e7533d..1c107d6d03b9 100644 --- a/drivers/infiniband/core/cm.c +++ b/drivers/infiniband/core/cm.c @@ -2824,6 +2824,7 @@ static int cm_dreq_handler(struct cm_work *work) switch (cm_id_priv->id.state) { case IB_CM_REP_SENT: case IB_CM_DREQ_SENT: + case IB_CM_MRA_REP_RCVD: ib_cancel_mad(cm_id_priv->msg); break; case IB_CM_ESTABLISHED: @@ -2831,8 +2832,6 @@ static int cm_dreq_handler(struct cm_work *work) cm_id_priv->id.lap_state == IB_CM_MRA_LAP_RCVD) ib_cancel_mad(cm_id_priv->msg); break; - case IB_CM_MRA_REP_RCVD: - break; case IB_CM_TIMEWAIT: atomic_long_inc(&work->port->counters[CM_RECV_DUPLICATES] [CM_DREQ_COUNTER]);