Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp4137486pxb; Mon, 27 Sep 2021 10:08:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw2XEPD6cLbTyC85oK86qRfhUVFJNAIY0J3lJhjlR9BGs/RxZleXl0yk0Oc3uClGX+yvqQY X-Received: by 2002:a63:4464:: with SMTP id t36mr672294pgk.4.1632762531792; Mon, 27 Sep 2021 10:08:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632762531; cv=none; d=google.com; s=arc-20160816; b=JHpOyeCzR+dGvmYhdHXY+9mC3yscFy5Ady68RZSfmi9nYDYTkit98UsEGMbrxFOszP jMZNFo4rv4wyJvaGIA3hKES5qfGog62Z0yR9O6S75Esn1bTzu5h61qE1HTRZ6wsiWVB1 bL00VR0aMMqIXTugUhnzTlT63Denh9fsHvV1RyMETMCuHa8ECgwOU8+JF5fFWsMoJDp6 kD7F5g3kLGgD3eOYtzrPhRFZt6HhMjh7kFiMl8Jk6npiPT/CCHxbxxar6YjpZiPiGWwx sK6KQpWhAK8dFF8j/eUhuc5Um5a3nz6Mr0O4dwf0QBUKJtdas+fccPPzZPqhgkF2wisv wg8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Phi/qlQACckL3ce9CKwEVZ0H/md0z5oKxp6Xi3TQAdo=; b=X3+DJZ18vf/VdP8z/zOfHhK4ls4swQflDY7SwyXGIp1rn7QBMwoXa0cz5/dxP8/q7R IwNSCpRpYxQfFm3sViR7KZ/7AJWwuickQihXSdLKzeWsFqFWHJIukdrgq+xtjphrb/cz LgfDn1rRtq+mOwZKpnWqJvpAos9OKEq04EKuZTwDPwvuGQkHIv21I7eLqsr9zXmX0/x8 8wdh6B5Dh6gUDrHlSY6mVAJA8/u4NCD8wG4r25dROodmpnw1Daua7Zy3wrY8yvvTs74c DhF9MBqLSZ3XrJ7Fbz97iSfkHkQF5j4ApANb5O/ixzkKgZ5NIIFhdwgyiuIqx4oOVsSy gCjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=vuvbKcfh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y1si21026317pfm.136.2021.09.27.10.08.38; Mon, 27 Sep 2021 10:08:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=vuvbKcfh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236331AbhI0RJd (ORCPT + 99 others); Mon, 27 Sep 2021 13:09:33 -0400 Received: from mail.kernel.org ([198.145.29.99]:46130 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236037AbhI0RIO (ORCPT ); Mon, 27 Sep 2021 13:08:14 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 51BF4611C3; Mon, 27 Sep 2021 17:06:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1632762390; bh=S57IW9XmSMDd9bCtpUv5DsztSvjqjiQqbyJLha77QWk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vuvbKcfhMY+KiPJuhZHsWs3cBdiFetKWpYh7ppRYadJRZY52ZhlhDWIsqcRvi0TdB oZkhsItwfj+lhycj6bRg2zpJRjgb3h7g4p8V7SRoG8zKI6DxkdrfgVDgdEMyMVpEMG lZP4UG0cYIFg6dcfoVP2ASdPNQQ1MoZL1UrnaG+I= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Michal Kalderon , Ariel Elior , Shai Malin , "David S. Miller" , Sasha Levin Subject: [PATCH 5.4 31/68] qed: rdma - dont wait for resources under hw error recovery flow Date: Mon, 27 Sep 2021 19:02:27 +0200 Message-Id: <20210927170221.050930152@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210927170219.901812470@linuxfoundation.org> References: <20210927170219.901812470@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Shai Malin [ Upstream commit 1ea7812326004afd2803cc968a4776ae5120a597 ] If the HW device is during recovery, the HW resources will never return, hence we shouldn't wait for the CID (HW context ID) bitmaps to clear. This fix speeds up the error recovery flow. Fixes: 64515dc899df ("qed: Add infrastructure for error detection and recovery") Signed-off-by: Michal Kalderon Signed-off-by: Ariel Elior Signed-off-by: Shai Malin Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/qlogic/qed/qed_iwarp.c | 8 ++++++++ drivers/net/ethernet/qlogic/qed/qed_roce.c | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/drivers/net/ethernet/qlogic/qed/qed_iwarp.c b/drivers/net/ethernet/qlogic/qed/qed_iwarp.c index 9adbaccd0c5e..934740d60470 100644 --- a/drivers/net/ethernet/qlogic/qed/qed_iwarp.c +++ b/drivers/net/ethernet/qlogic/qed/qed_iwarp.c @@ -1307,6 +1307,14 @@ qed_iwarp_wait_cid_map_cleared(struct qed_hwfn *p_hwfn, struct qed_bmap *bmap) prev_weight = weight; while (weight) { + /* If the HW device is during recovery, all resources are + * immediately reset without receiving a per-cid indication + * from HW. In this case we don't expect the cid_map to be + * cleared. + */ + if (p_hwfn->cdev->recov_in_prog) + return 0; + msleep(QED_IWARP_MAX_CID_CLEAN_TIME); weight = bitmap_weight(bmap->bitmap, bmap->max_count); diff --git a/drivers/net/ethernet/qlogic/qed/qed_roce.c b/drivers/net/ethernet/qlogic/qed/qed_roce.c index 83817bb50e9f..6e6563b51d68 100644 --- a/drivers/net/ethernet/qlogic/qed/qed_roce.c +++ b/drivers/net/ethernet/qlogic/qed/qed_roce.c @@ -107,6 +107,14 @@ void qed_roce_stop(struct qed_hwfn *p_hwfn) * Beyond the added delay we clear the bitmap anyway. */ while (bitmap_weight(rcid_map->bitmap, rcid_map->max_count)) { + /* If the HW device is during recovery, all resources are + * immediately reset without receiving a per-cid indication + * from HW. In this case we don't expect the cid bitmap to be + * cleared. + */ + if (p_hwfn->cdev->recov_in_prog) + return; + msleep(100); if (wait_count++ > 20) { DP_NOTICE(p_hwfn, "cid bitmap wait timed out\n"); -- 2.33.0