linux-rdma.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Shai Malin <smalin@marvell.com>
To: <netdev@vger.kernel.org>, <davem@davemloft.net>, <kuba@kernel.org>
Cc: <linux-rdma@vger.kernel.org>, <jgg@ziepe.ca>,
	<aelior@marvell.com>, <smalin@marvell.com>, <malin1024@gmail.com>,
	Michal Kalderon <mkalderon@marvell.com>
Subject: [PATCH net] qed: rdma - don't wait for resources under hw error recovery flow
Date: Mon, 13 Sep 2021 15:14:42 +0300	[thread overview]
Message-ID: <20210913121442.10189-1-smalin@marvell.com> (raw)

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 <mkalderon@marvell.com>
Signed-off-by: Ariel Elior <aelior@marvell.com>
Signed-off-by: Shai Malin <smalin@marvell.com>
---
 drivers/net/ethernet/qlogic/qed/qed_iwarp.c | 7 +++++++
 drivers/net/ethernet/qlogic/qed/qed_roce.c  | 7 +++++++
 2 files changed, 14 insertions(+)

diff --git a/drivers/net/ethernet/qlogic/qed/qed_iwarp.c b/drivers/net/ethernet/qlogic/qed/qed_iwarp.c
index fc8b3e64f153..4967e383c31a 100644
--- a/drivers/net/ethernet/qlogic/qed/qed_iwarp.c
+++ b/drivers/net/ethernet/qlogic/qed/qed_iwarp.c
@@ -1323,6 +1323,13 @@ static int qed_iwarp_wait_for_all_cids(struct qed_hwfn *p_hwfn)
 	int rc;
 	int i;
 
+	/* 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;
+
 	rc = qed_iwarp_wait_cid_map_cleared(p_hwfn,
 					    &p_hwfn->p_rdma_info->tcp_cid_map);
 	if (rc)
diff --git a/drivers/net/ethernet/qlogic/qed/qed_roce.c b/drivers/net/ethernet/qlogic/qed/qed_roce.c
index f16a157bb95a..aff5a2871b8f 100644
--- a/drivers/net/ethernet/qlogic/qed/qed_roce.c
+++ b/drivers/net/ethernet/qlogic/qed/qed_roce.c
@@ -71,6 +71,13 @@ void qed_roce_stop(struct qed_hwfn *p_hwfn)
 	struct qed_bmap *rcid_map = &p_hwfn->p_rdma_info->real_cid_map;
 	int wait_count = 0;
 
+	/* 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;
+
 	/* when destroying a_RoCE QP the control is returned to the user after
 	 * the synchronous part. The asynchronous part may take a little longer.
 	 * We delay for a short while if an async destroy QP is still expected.
-- 
2.22.0


             reply	other threads:[~2021-09-13 12:15 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-13 12:14 Shai Malin [this message]
2021-09-13 14:45 ` Leon Romanovsky
2021-09-14  6:23 Shai Malin
2021-09-14 10:00 ` Leon Romanovsky
2021-09-14 15:40 Shai Malin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210913121442.10189-1-smalin@marvell.com \
    --to=smalin@marvell.com \
    --cc=aelior@marvell.com \
    --cc=davem@davemloft.net \
    --cc=jgg@ziepe.ca \
    --cc=kuba@kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=malin1024@gmail.com \
    --cc=mkalderon@marvell.com \
    --cc=netdev@vger.kernel.org \
    --subject='Re: [PATCH net] qed: rdma - don'\''t wait for resources under hw error recovery flow' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).