patch 'event/dlb2: poll HW CQ inflights before mapping queue' has been queued to stable release 21.11.1

Kevin Traynor ktraynor at redhat.com
Tue Mar 1 11:41:38 CET 2022


Hi,

FYI, your patch has been queued to stable release 21.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/06/22. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://github.com/kevintraynor/dpdk-stable

This queued commit can be viewed at:
https://github.com/kevintraynor/dpdk-stable/commit/9a552423fd5d7a226fe55cdf509312c221e03e6a

Thanks.

Kevin

---
>From 9a552423fd5d7a226fe55cdf509312c221e03e6a Mon Sep 17 00:00:00 2001
From: Timothy McDaniel <timothy.mcdaniel at intel.com>
Date: Wed, 16 Feb 2022 13:38:27 -0600
Subject: [PATCH] event/dlb2: poll HW CQ inflights before mapping queue

[ upstream commit f6ed136aaea6b9f237670891df9c0b8a4b97d6d3 ]

When attempting to link a port and queue immediately after unlinking,
the CQ inflights may not all be processed. Poll the h/w register for
outstanding inflights instead of reading once, in case the inflights
are still being processed. Also return EBUSY if the inflight
processing is not completed in a suitable amount of time.

Fixes: 1857f1922ce2 ("event/dlb2: use new implementation of resource file")

Signed-off-by: Timothy McDaniel <timothy.mcdaniel at intel.com>
---
 drivers/event/dlb2/pf/base/dlb2_resource.c | 23 ++++++++++++++++++----
 1 file changed, 19 insertions(+), 4 deletions(-)

diff --git a/drivers/event/dlb2/pf/base/dlb2_resource.c b/drivers/event/dlb2/pf/base/dlb2_resource.c
index 3661b940c3..d4c49c2992 100644
--- a/drivers/event/dlb2/pf/base/dlb2_resource.c
+++ b/drivers/event/dlb2/pf/base/dlb2_resource.c
@@ -2357,4 +2357,6 @@ static bool dlb2_domain_finish_unmap_port(struct dlb2_hw *hw,
 	u32 infl_cnt;
 	int i;
+	const int max_iters = 1000;
+	const int iter_poll_us = 100;
 
 	if (port->num_pending_removals == 0)
@@ -2363,8 +2365,16 @@ static bool dlb2_domain_finish_unmap_port(struct dlb2_hw *hw,
 	/*
 	 * The unmap requires all the CQ's outstanding inflights to be
-	 * completed.
+	 * completed. Poll up to 100ms.
 	 */
-	infl_cnt = DLB2_CSR_RD(hw, DLB2_LSP_CQ_LDB_INFL_CNT(hw->ver,
+	for (i = 0; i < max_iters; i++) {
+		infl_cnt = DLB2_CSR_RD(hw, DLB2_LSP_CQ_LDB_INFL_CNT(hw->ver,
 						       port->id.phys_id));
+
+		if (DLB2_BITS_GET(infl_cnt,
+				  DLB2_LSP_CQ_LDB_INFL_CNT_COUNT) == 0)
+			break;
+		rte_delay_us_sleep(iter_poll_us);
+	}
+
 	if (DLB2_BITS_GET(infl_cnt, DLB2_LSP_CQ_LDB_INFL_CNT_COUNT) > 0)
 		return false;
@@ -5317,4 +5327,5 @@ static void dlb2_log_map_qid(struct dlb2_hw *hw,
  *	    the domain is not configured.
  * EFAULT - Internal error (resp->status not set).
+ * EBUSY  - The requested port has outstanding detach operations.
  */
 int dlb2_hw_map_qid(struct dlb2_hw *hw,
@@ -5357,6 +5368,10 @@ int dlb2_hw_map_qid(struct dlb2_hw *hw,
 	 * slot for this requested mapping.
 	 */
-	if (port->num_pending_removals)
-		dlb2_domain_finish_unmap_port(hw, domain, port);
+	if (port->num_pending_removals) {
+		bool bool_ret;
+		bool_ret = dlb2_domain_finish_unmap_port(hw, domain, port);
+		if (!bool_ret)
+			return -EBUSY;
+	}
 
 	ret = dlb2_verify_map_qid_slot_available(port, queue, resp);
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-03-01 10:41:01.981030878 +0000
+++ 0022-event-dlb2-poll-HW-CQ-inflights-before-mapping-queue.patch	2022-03-01 10:41:01.269244091 +0000
@@ -1 +1 @@
-From f6ed136aaea6b9f237670891df9c0b8a4b97d6d3 Mon Sep 17 00:00:00 2001
+From 9a552423fd5d7a226fe55cdf509312c221e03e6a Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit f6ed136aaea6b9f237670891df9c0b8a4b97d6d3 ]
+
@@ -13 +14,0 @@
-Cc: stable at dpdk.org



More information about the stable mailing list