[dpdk-stable] patch 'event/sw: fix cq index check for unlink usecases' has been queued to LTS release 17.11.5
Yongseok Koh
yskoh at mellanox.com
Fri Nov 30 00:10:29 CET 2018
Hi,
FYI, your patch has been queued to LTS release 17.11.5
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 12/01/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.
Yongseok
---
>From a49935d1c7f2553097b031cee7c9023d06e50bc3 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 8a2c9d4f9..2d25cf0b3 100644
--- a/drivers/event/sw/sw_evdev_scheduler.c
+++ b/drivers/event/sw/sw_evdev_scheduler.c
@@ -79,9 +79,11 @@ sw_schedule_atomic_to_cq(struct sw_evdev *sw, struct sw_qid * const qid,
int cq = fid->cq;
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];
/* find least used */
@@ -168,9 +170,10 @@ sw_schedule_parallel_to_cq(struct sw_evdev *sw, struct sw_qid * const qid,
do {
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 ||
sw->ports[cq].inflights == SW_PORT_HIST_LIST);
@@ -248,7 +251,7 @@ sw_schedule_qid_to_cq(struct sw_evdev *sw)
int iq_num = PKT_MASK_TO_IQ(qid->iq_pkt_mask);
/* zero mapped CQs indicates directed */
- if (iq_num >= SW_IQS_MAX)
+ if (iq_num >= SW_IQS_MAX || qid->cq_num_mapped_cqs == 0)
continue;
uint32_t pkts_done = 0;
--
2.11.0
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2018-11-29 15:01:46.799937892 -0800
+++ 0035-event-sw-fix-cq-index-check-for-unlink-usecases.patch 2018-11-29 15:01:45.052962000 -0800
@@ -1,8 +1,10 @@
-From 733fc6ca0b48e4bdf2717a8723243f93a3864bb4 Mon Sep 17 00:00:00 2001
+From a49935d1c7f2553097b031cee7c9023d06e50bc3 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>
@@ -20,10 +21,10 @@
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
+index 8a2c9d4f9..2d25cf0b3 100644
--- a/drivers/event/sw/sw_evdev_scheduler.c
+++ b/drivers/event/sw/sw_evdev_scheduler.c
-@@ -51,9 +51,11 @@ sw_schedule_atomic_to_cq(struct sw_evdev *sw, struct sw_qid * const qid,
+@@ -79,9 +79,11 @@ sw_schedule_atomic_to_cq(struct sw_evdev *sw, struct sw_qid * const qid,
int cq = fid->cq;
if (cq < 0) {
@@ -37,7 +38,7 @@
cq = qid->cq_map[cq_idx];
/* find least used */
-@@ -140,9 +142,10 @@ sw_schedule_parallel_to_cq(struct sw_evdev *sw, struct sw_qid * const qid,
+@@ -168,9 +170,10 @@ sw_schedule_parallel_to_cq(struct sw_evdev *sw, struct sw_qid * const qid,
do {
if (++cq_check_count > qid->cq_num_mapped_cqs)
goto exit;
@@ -50,7 +51,7 @@
} while (rte_event_ring_free_count(
sw->ports[cq].cq_worker_ring) == 0 ||
sw->ports[cq].inflights == SW_PORT_HIST_LIST);
-@@ -220,7 +223,7 @@ sw_schedule_qid_to_cq(struct sw_evdev *sw)
+@@ -248,7 +251,7 @@ sw_schedule_qid_to_cq(struct sw_evdev *sw)
int iq_num = PKT_MASK_TO_IQ(qid->iq_pkt_mask);
/* zero mapped CQs indicates directed */
More information about the stable
mailing list