[dpdk-stable] patch 'event/sw: fix cq index check for unlink usecases' has been queued to stable release 18.08.1

Kevin Traynor ktraynor at redhat.com
Wed Nov 21 17:47:19 CET 2018


Hi,

FYI, your patch has been queued to stable release 18.08.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 11/27/18. 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. If the code is different (ie: not only metadata diffs), due for example to
a change in context or macro names, please double check it.

Thanks.

Kevin Traynor

---
>From abfcdd719dbdcb30dc5e790ab4c576387cec6bed Mon Sep 17 00:00:00 2001
From: Harry van Haaren <harry.van.haaren at intel.com>
Date: Fri, 21 Sep 2018 11:25:10 +0100
Subject: [PATCH] event/sw: fix cq index check for unlink usecases

[ upstream commit 733fc6ca0b48e4bdf2717a8723243f93a3864bb4 ]

This commit fixes the cq index checks when unlinking
ports/queues while the scheduler core is running.
Previously, the == comparison could be "skipped" if
in particular corner cases. With the check being changed
to >= this is resolved as the cq idx gets reset to zero.

Bugzilla ID: 60
Fixes: 617995dfc5b2 ("event/sw: add scheduling logic")

Suggested-by: Matias Elo <matias.elo at nokia.com>
Signed-off-by: Harry van Haaren <harry.van.haaren at intel.com>
---
 drivers/event/sw/sw_evdev_scheduler.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/drivers/event/sw/sw_evdev_scheduler.c b/drivers/event/sw/sw_evdev_scheduler.c
index e3a41e02f..fb5d44630 100644
--- a/drivers/event/sw/sw_evdev_scheduler.c
+++ b/drivers/event/sw/sw_evdev_scheduler.c
@@ -52,7 +52,9 @@ sw_schedule_atomic_to_cq(struct sw_evdev *sw, struct sw_qid * const qid,
 
 		if (cq < 0) {
-			uint32_t cq_idx = qid->cq_next_tx++;
-			if (qid->cq_next_tx == qid->cq_num_mapped_cqs)
+			uint32_t cq_idx;
+			if (qid->cq_next_tx >= qid->cq_num_mapped_cqs)
 				qid->cq_next_tx = 0;
+			cq_idx = qid->cq_next_tx++;
+
 			cq = qid->cq_map[cq_idx];
 
@@ -141,7 +143,8 @@ sw_schedule_parallel_to_cq(struct sw_evdev *sw, struct sw_qid * const qid,
 			if (++cq_check_count > qid->cq_num_mapped_cqs)
 				goto exit;
-			cq = qid->cq_map[cq_idx];
-			if (++cq_idx == qid->cq_num_mapped_cqs)
+			if (cq_idx >= qid->cq_num_mapped_cqs)
 				cq_idx = 0;
+			cq = qid->cq_map[cq_idx++];
+
 		} while (rte_event_ring_free_count(
 				sw->ports[cq].cq_worker_ring) == 0 ||
@@ -221,5 +224,5 @@ sw_schedule_qid_to_cq(struct sw_evdev *sw)
 
 		/* zero mapped CQs indicates directed */
-		if (iq_num >= SW_IQS_MAX)
+		if (iq_num >= SW_IQS_MAX || qid->cq_num_mapped_cqs == 0)
 			continue;
 
-- 
2.19.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2018-11-21 16:44:31.094573122 +0000
+++ 0005-event-sw-fix-cq-index-check-for-unlink-usecases.patch	2018-11-21 16:44:30.000000000 +0000
@@ -1,8 +1,10 @@
-From 733fc6ca0b48e4bdf2717a8723243f93a3864bb4 Mon Sep 17 00:00:00 2001
+From abfcdd719dbdcb30dc5e790ab4c576387cec6bed Mon Sep 17 00:00:00 2001
 From: Harry van Haaren <harry.van.haaren at intel.com>
 Date: Fri, 21 Sep 2018 11:25:10 +0100
 Subject: [PATCH] event/sw: fix cq index check for unlink usecases
 
+[ upstream commit 733fc6ca0b48e4bdf2717a8723243f93a3864bb4 ]
+
 This commit fixes the cq index checks when unlinking
 ports/queues while the scheduler core is running.
 Previously, the == comparison could be "skipped" if
@@ -11,7 +13,6 @@
 
 Bugzilla ID: 60
 Fixes: 617995dfc5b2 ("event/sw: add scheduling logic")
-Cc: stable at dpdk.org
 
 Suggested-by: Matias Elo <matias.elo at nokia.com>
 Signed-off-by: Harry van Haaren <harry.van.haaren at intel.com>


More information about the stable mailing list