Skip to contentSkip to conversation

qed: rdma - don't wait for resources under hw error recovery flow

PATCH Applied Shai Malin 2 participants 2 messages Sep 22, 2021

Subsystems (4)
lore
Share & tools
lore

Shai Malin

author
#0 lore raw

PATCH v3 1/1 qed: rdma - don't wait for resources under hw error recovery flow

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")

---
Changes since v1:
- Fix race condition (thanks to Leon Romanovsky).

Changes since v2:
- Comment fix.

---
 drivers/net/ethernet/qlogic/qed/qed_iwarp.c | 8 ++++++++
 drivers/net/ethernet/qlogic/qed/qed_roce.c  | 8 ++++++++
 2 files changed, 16 insertions(+)
drivers/net/ethernet/qlogic/qed/qed_iwarp.c +8 -0
index fc8b3e64f153..186d0048a9d1 100644
@@ -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);
drivers/net/ethernet/qlogic/qed/qed_roce.c +8 -0
index f16a157bb95a..cf5baa5e59bc 100644
@@ -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");
Signature · 1 line
2.27.0
#1 lore raw
This patch was applied to netdev/net.git (refs/heads/master):

Hello:

This patch was applied to netdev/net.git (refs/heads/master):

Quoted 10 lines · On Wed, 22 Sep 2021 13:53:26 +0300 you wrote:

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")

[...]

Here is the summary with links:
- [net,v3] qed: rdma - don't wait for resources under hw error recovery flow

    https://git.kernel.org/netdev/net/c/1ea781232600

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html