Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp4142094pxb; Mon, 27 Sep 2021 10:14:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyXCTy6VlzHMMxH/C/abX4ecyfQfaRowZv91lx7G7xfLeeiUf8t4q4RFXrwabv5m4eJULvw X-Received: by 2002:a17:90b:3108:: with SMTP id gc8mr178346pjb.63.1632762851615; Mon, 27 Sep 2021 10:14:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632762851; cv=none; d=google.com; s=arc-20160816; b=Ahol5IzbKDd5pF9AyaKUkBha79c2gOwA9Z2qrTMnG0m1FWleFQhNucCzDMjC0Sfupp jcerO2tgtgQhzihzo8dwnTA+ObJs+p7R25fUAGUBPA6YzkyqHIrQzvc5PqY8kWXg/aPS Uu3DoIfXfiuk+QlY0pHRE63WdoqD1EEyvB7llZvbClXonq/04IMxx9HuZXh5PHyWJBc9 u7hKli/DagsDuB0m92Mn9lAQlh22qC4O7s+LXUmQY6KLYEtsXeQaapsaYhknvnA5zswo h2G4TuxCHcMlfQ354nnf5YhpMz4Tum4JhXmhyN6o5SjfyD+kMWSMwWaopHaqOvFbHCRu nyOQ== 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=mdIZi5l7gQQOZXWxP44opqU0Vg52t0ViyFpoVCSp/3M=; b=DKuYUfvwZ5L5ayVo6Lzjq2xlfeNjjkSsyMLITTzgY/DgBsJ48KBqiThno+10LXp1vn wWPzF814BLyWGZj4t5SJRdE5sSycRowmtLv+4jW8EBbZHVVhHSJSbsR2qa40WH0dRTvH CVtDXGQ7mzGY9k2OuAdp8vP4lSHOvLGxMrSHcLL/5pVPIQ6eCi3+ss7q6hXy+Hqx2VyA fKwsq7auI6iKjDwNqws7mD5JOjxfn5z/Ay33kmabmLeg5beYQJ8OMqAJDednYi2PDw4Z Mr8DP5YzXWwwYp6ZZcnYtIusvHU4xNXAlRMmMP1CtNg7zOaiGG/gqTY62rYmt3Bi6TIY Phdw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=S75hrmmo; 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 a26si22329955pfh.341.2021.09.27.10.13.59; Mon, 27 Sep 2021 10:14:11 -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=S75hrmmo; 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 S235555AbhI0ROm (ORCPT + 99 others); Mon, 27 Sep 2021 13:14:42 -0400 Received: from mail.kernel.org ([198.145.29.99]:54388 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236364AbhI0RME (ORCPT ); Mon, 27 Sep 2021 13:12:04 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id C793161264; Mon, 27 Sep 2021 17:08:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1632762512; bh=RSZkiJ2yqzaRdXX9rL57ZA7zNS/yRoj+t1rLaJ5pFUc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=S75hrmmoYl1I9DVH1h5fbt/mxFRvsSAtvRRbqfEbQi4z8+WO1CTMm01WG8Y0aqqVn p48a25rSaVS0haV+lhaHnDTkINITv5x3olrw77OLpyRf/THZ3h9htp8eK5ixWzyQ/G QxrskE0C6CGEa5CWQa94f/DRdcAgLhp7IANge4fs= 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.10 050/103] qed: rdma - dont wait for resources under hw error recovery flow Date: Mon, 27 Sep 2021 19:02:22 +0200 Message-Id: <20210927170227.485895652@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210927170225.702078779@linuxfoundation.org> References: <20210927170225.702078779@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 a99861124630..68fbe536a1f3 100644 --- a/drivers/net/ethernet/qlogic/qed/qed_iwarp.c +++ b/drivers/net/ethernet/qlogic/qed/qed_iwarp.c @@ -1297,6 +1297,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 f16a157bb95a..cf5baa5e59bc 100644 --- a/drivers/net/ethernet/qlogic/qed/qed_roce.c +++ b/drivers/net/ethernet/qlogic/qed/qed_roce.c @@ -77,6 +77,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