From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id 1D6701B505 for ; Fri, 30 Nov 2018 00:13:36 +0100 (CET) Received: from Internal Mail-Server by MTLPINE1 (envelope-from yskoh@mellanox.com) with ESMTPS (AES256-SHA encrypted); 30 Nov 2018 01:19:27 +0200 Received: from scfae-sc-2.mti.labs.mlnx (scfae-sc-2.mti.labs.mlnx [10.101.0.96]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id wATNCW7Z032075; Fri, 30 Nov 2018 01:13:32 +0200 From: Yongseok Koh To: Harry van Haaren Cc: Matias Elo , dpdk stable Date: Thu, 29 Nov 2018 15:10:29 -0800 Message-Id: <20181129231202.30436-35-yskoh@mellanox.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20181129231202.30436-1-yskoh@mellanox.com> References: <20181129231202.30436-1-yskoh@mellanox.com> Subject: [dpdk-stable] patch 'event/sw: fix cq index check for unlink usecases' has been queued to LTS release 17.11.5 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2018 23:13:36 -0000 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 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 Signed-off-by: Harry van Haaren --- 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 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@dpdk.org Suggested-by: Matias Elo Signed-off-by: Harry van Haaren @@ -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 */