patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Kevin Traynor <ktraynor@redhat.com>
To: Timothy McDaniel <timothy.mcdaniel@intel.com>
Cc: dpdk stable <stable@dpdk.org>
Subject: patch 'event/dlb2: rework queue drain handling' has been queued to stable release 21.11.2
Date: Fri, 24 Jun 2022 16:01:26 +0100	[thread overview]
Message-ID: <20220624150148.1855580-18-ktraynor@redhat.com> (raw)
In-Reply-To: <20220624150148.1855580-1-ktraynor@redhat.com>

Hi,

FYI, your patch has been queued to stable release 21.11.2

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 06/27/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/7c0439f319503ced6777f3e0d2da213ead816b79

Thanks.

Kevin

---
From 7c0439f319503ced6777f3e0d2da213ead816b79 Mon Sep 17 00:00:00 2001
From: Timothy McDaniel <timothy.mcdaniel@intel.com>
Date: Mon, 6 Jun 2022 10:55:17 -0500
Subject: [PATCH] event/dlb2: rework queue drain handling

[ upstream commit 82a710bccb209f7b5b0309f687741102f093234f ]

Previously, anything that prevented the CQs from being drained
would hang the PMD for an unacceptably long time. This commit updates
the drain logic to be resource and time based, thus eliminating
the potential for a long hang when draining the queues in preparation
for a reset.

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

Signed-off-by: Timothy McDaniel <timothy.mcdaniel@intel.com>
---
 drivers/event/dlb2/pf/base/dlb2_hw_types.h |  2 +-
 drivers/event/dlb2/pf/base/dlb2_resource.c | 45 +++++++++++++++++-----
 2 files changed, 37 insertions(+), 10 deletions(-)

diff --git a/drivers/event/dlb2/pf/base/dlb2_hw_types.h b/drivers/event/dlb2/pf/base/dlb2_hw_types.h
index 6b8fee3416..9511521e67 100644
--- a/drivers/event/dlb2/pf/base/dlb2_hw_types.h
+++ b/drivers/event/dlb2/pf/base/dlb2_hw_types.h
@@ -28,5 +28,5 @@
 #define DLB2_MAX_NUM_SEQUENCE_NUMBER_MODES	5
 #define DLB2_MAX_CQ_COMP_CHECK_LOOPS		409600
-#define DLB2_MAX_QID_EMPTY_CHECK_LOOPS		(32 * 64 * 1024 * (800 / 30))
+#define DLB2_MAX_QID_EMPTY_CHECK_LOOPS		(4 * DLB2_MAX_NUM_LDB_CREDITS)
 
 #define DLB2_FUNC_BAR				0
diff --git a/drivers/event/dlb2/pf/base/dlb2_resource.c b/drivers/event/dlb2/pf/base/dlb2_resource.c
index d4c49c2992..8c57bdfff7 100644
--- a/drivers/event/dlb2/pf/base/dlb2_resource.c
+++ b/drivers/event/dlb2/pf/base/dlb2_resource.c
@@ -1058,5 +1058,5 @@ static u32 dlb2_dir_cq_token_count(struct dlb2_hw *hw,
 }
 
-static void dlb2_drain_dir_cq(struct dlb2_hw *hw,
+static int dlb2_drain_dir_cq(struct dlb2_hw *hw,
 			      struct dlb2_dir_pq_pair *port)
 {
@@ -1090,4 +1090,6 @@ static void dlb2_drain_dir_cq(struct dlb2_hw *hw,
 		os_unmap_producer_port(hw, pp_addr);
 	}
+
+	return cnt;
 }
 
@@ -1108,4 +1110,5 @@ static int dlb2_domain_drain_dir_cqs(struct dlb2_hw *hw,
 	struct dlb2_list_entry *iter;
 	struct dlb2_dir_pq_pair *port;
+	int drain_cnt = 0;
 	RTE_SET_USED(iter);
 
@@ -1121,5 +1124,5 @@ static int dlb2_domain_drain_dir_cqs(struct dlb2_hw *hw,
 			dlb2_dir_port_cq_disable(hw, port);
 
-		dlb2_drain_dir_cq(hw, port);
+		drain_cnt = dlb2_drain_dir_cq(hw, port);
 
 		if (toggle_port)
@@ -1127,5 +1130,5 @@ static int dlb2_domain_drain_dir_cqs(struct dlb2_hw *hw,
 	}
 
-	return 0;
+	return drain_cnt;
 }
 
@@ -1171,8 +1174,18 @@ static int dlb2_domain_drain_dir_queues(struct dlb2_hw *hw,
 
 	for (i = 0; i < DLB2_MAX_QID_EMPTY_CHECK_LOOPS; i++) {
-		dlb2_domain_drain_dir_cqs(hw, domain, true);
+		int drain_cnt;
+
+		drain_cnt = dlb2_domain_drain_dir_cqs(hw, domain, false);
 
 		if (dlb2_domain_dir_queues_empty(hw, domain))
 			break;
+
+		/*
+		 * Allow time for DLB to schedule QEs before draining
+		 * the CQs again.
+		 */
+		if (!drain_cnt)
+			rte_delay_us(1);
+
 	}
 
@@ -1250,5 +1263,5 @@ static u32 dlb2_ldb_cq_token_count(struct dlb2_hw *hw,
 }
 
-static void dlb2_drain_ldb_cq(struct dlb2_hw *hw, struct dlb2_ldb_port *port)
+static int dlb2_drain_ldb_cq(struct dlb2_hw *hw, struct dlb2_ldb_port *port)
 {
 	u32 infl_cnt, tkn_cnt;
@@ -1290,7 +1303,9 @@ static void dlb2_drain_ldb_cq(struct dlb2_hw *hw, struct dlb2_ldb_port *port)
 		os_unmap_producer_port(hw, pp_addr);
 	}
+
+	return tkn_cnt;
 }
 
-static void dlb2_domain_drain_ldb_cqs(struct dlb2_hw *hw,
+static int dlb2_domain_drain_ldb_cqs(struct dlb2_hw *hw,
 				      struct dlb2_hw_domain *domain,
 				      bool toggle_port)
@@ -1298,4 +1313,5 @@ static void dlb2_domain_drain_ldb_cqs(struct dlb2_hw *hw,
 	struct dlb2_list_entry *iter;
 	struct dlb2_ldb_port *port;
+	int drain_cnt = 0;
 	int i;
 	RTE_SET_USED(iter);
@@ -1303,5 +1319,5 @@ static void dlb2_domain_drain_ldb_cqs(struct dlb2_hw *hw,
 	/* If the domain hasn't been started, there's no traffic to drain */
 	if (!domain->started)
-		return;
+		return 0;
 
 	for (i = 0; i < DLB2_NUM_COS_DOMAINS; i++) {
@@ -1310,5 +1326,5 @@ static void dlb2_domain_drain_ldb_cqs(struct dlb2_hw *hw,
 				dlb2_ldb_port_cq_disable(hw, port);
 
-			dlb2_drain_ldb_cq(hw, port);
+			drain_cnt = dlb2_drain_ldb_cq(hw, port);
 
 			if (toggle_port)
@@ -1316,4 +1332,6 @@ static void dlb2_domain_drain_ldb_cqs(struct dlb2_hw *hw,
 		}
 	}
+
+	return drain_cnt;
 }
 
@@ -1376,8 +1394,17 @@ static int dlb2_domain_drain_mapped_queues(struct dlb2_hw *hw,
 
 	for (i = 0; i < DLB2_MAX_QID_EMPTY_CHECK_LOOPS; i++) {
-		dlb2_domain_drain_ldb_cqs(hw, domain, true);
+		int drain_cnt;
+
+		drain_cnt = dlb2_domain_drain_ldb_cqs(hw, domain, false);
 
 		if (dlb2_domain_mapped_queues_empty(hw, domain))
 			break;
+
+		/*
+		 * Allow time for DLB to schedule QEs before draining
+		 * the CQs again.
+		 */
+		if (!drain_cnt)
+			rte_delay_us(1);
 	}
 
-- 
2.34.3

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-06-24 15:51:09.576609319 +0100
+++ 0023-event-dlb2-rework-queue-drain-handling.patch	2022-06-24 15:51:08.889984130 +0100
@@ -1 +1 @@
-From 82a710bccb209f7b5b0309f687741102f093234f Mon Sep 17 00:00:00 2001
+From 7c0439f319503ced6777f3e0d2da213ead816b79 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 82a710bccb209f7b5b0309f687741102f093234f ]
+
@@ -13 +14,0 @@
-Cc: stable@dpdk.org


  parent reply	other threads:[~2022-06-24 15:02 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-24 15:01 patch 'trace: fix init with long file prefix' " Kevin Traynor
2022-06-24 15:01 ` patch 'test: drop reference to removed tests' " Kevin Traynor
2022-06-24 15:01 ` patch 'sched: remove unnecessary floating point' " Kevin Traynor
2022-06-24 15:01 ` patch 'eal/x86: drop export of internal alignment macro' " Kevin Traynor
2022-06-24 16:42   ` Kevin Traynor
2022-06-24 15:01 ` patch 'baseband/acc100: update companion PF configure function' " Kevin Traynor
2022-06-24 15:01 ` patch 'baseband/acc100: add protection for some negative scenario' " Kevin Traynor
2022-06-24 15:01 ` patch 'ipsec: fix NAT-T ports and length' " Kevin Traynor
2022-06-24 15:01 ` patch 'examples/ipsec-secgw: fix NAT-T header fields' " Kevin Traynor
2022-06-24 15:01 ` patch 'net/iavf: fix NAT-T payload length' " Kevin Traynor
2022-06-24 15:01 ` patch 'examples/ipsec-secgw: fix ESN setting' " Kevin Traynor
2022-06-24 15:01 ` patch 'common/cpt: fix build with GCC 12' " Kevin Traynor
2022-06-24 15:01 ` patch 'crypto/cnxk: " Kevin Traynor
2022-06-24 15:01 ` patch 'test/ipsec: " Kevin Traynor
2022-06-24 15:01 ` patch 'crypto/scheduler: fix queue pair in scheduler failover' " Kevin Traynor
2022-06-24 15:01 ` patch 'test/crypto: fix cipher offset for ZUC' " Kevin Traynor
2022-06-24 15:01 ` patch 'test/ipsec: fix performance test' " Kevin Traynor
2022-06-24 15:01 ` patch 'event/octeontx: fix SSO fast path' " Kevin Traynor
2022-06-24 15:01 ` Kevin Traynor [this message]
2022-06-24 15:01 ` patch 'event/dlb2: fix check of QID in-flight' " Kevin Traynor
2022-06-24 15:01 ` patch 'event/cnxk: fix QoS parameter handling' " Kevin Traynor
2022-06-24 15:01 ` patch 'event/cnxk: fix Tx adapter enqueue return for CN10K' " Kevin Traynor
2022-06-24 15:01 ` patch 'event/dlb2: fix advertized capabilities' " Kevin Traynor
2022-06-24 15:01 ` patch 'eventdev/eth_tx: fix adapter creation' " Kevin Traynor
2022-06-24 15:01 ` patch 'net/bonding: fix RSS inconsistency between ports' " Kevin Traynor
2022-06-24 15:01 ` patch 'test/bonding: fix RSS test when disable RSS' " Kevin Traynor
2022-06-24 15:01 ` patch 'net/hns3: fix an unreasonable memset' " Kevin Traynor
2022-06-24 15:01 ` patch 'net/hns3: remove duplicate definition' " Kevin Traynor
2022-06-24 15:01 ` patch 'net/hns3: fix code check warning' " Kevin Traynor
2022-06-24 15:01 ` patch 'net/hns3: fix return value for unsupported tuple' " Kevin Traynor
2022-06-24 15:01 ` patch 'net/hns3: fix crash from secondary process' " Kevin Traynor
2022-06-24 15:01 ` patch 'net/hns3: fix TM capability' " Kevin Traynor
2022-06-24 15:01 ` patch 'app/testpmd: add help messages for multi-process' " Kevin Traynor
2022-06-24 15:01 ` patch 'app/testpmd: fix bonding slave devices not released' " Kevin Traynor
2022-06-24 15:01 ` patch 'net/txgbe: fix register polling' " Kevin Traynor
2022-06-24 15:01 ` patch 'net/ngbe: add more packet statistics' " Kevin Traynor
2022-06-24 15:01 ` patch 'app/testpmd: revert MAC update in checksum forwarding' " Kevin Traynor
2022-06-24 15:01 ` patch 'vhost: fix missing enqueue pseudo-header calculation' " Kevin Traynor
2022-06-24 15:01 ` patch 'vhost/crypto: fix build with GCC 12' " Kevin Traynor
2022-06-24 15:01 ` patch 'vhost/crypto: fix descriptor processing' " Kevin Traynor
2022-06-24 15:01 ` patch 'net/virtio: unmap PCI device in secondary process' " Kevin Traynor

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=20220624150148.1855580-18-ktraynor@redhat.com \
    --to=ktraynor@redhat.com \
    --cc=stable@dpdk.org \
    --cc=timothy.mcdaniel@intel.com \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).