diff mbox

[RFC,4/4] schedule: fix priority scheduling bug

Message ID 1418723669-10161-5-git-send-email-ciprian.barbu@linaro.org
State New
Headers show

Commit Message

Ciprian Barbu Dec. 16, 2014, 9:54 a.m. UTC
Before this fix the scheduler would skip the current list of queues per priority
if it found an empty queue. An empty queue can get in the scheduling list if the
last dequeue popped all the buffers (MAX_DEQ).

Signed-off-by: Ciprian Barbu <ciprian.barbu@linaro.org>
---
 platform/linux-generic/odp_schedule.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
diff mbox

Patch

diff --git a/platform/linux-generic/odp_schedule.c b/platform/linux-generic/odp_schedule.c
index aa11b7b..06e3889 100644
--- a/platform/linux-generic/odp_schedule.c
+++ b/platform/linux-generic/odp_schedule.c
@@ -264,7 +264,7 @@  static int schedule(odp_queue_t *out_queue, odp_buffer_t out_buf[],
 
 		id = thr & (QUEUES_PER_PRIO-1);
 
-		for (j = 0; j < QUEUES_PER_PRIO; j++, id++) {
+		for (j = 0; j < QUEUES_PER_PRIO; ) {
 			odp_queue_t  pri_q;
 			odp_buffer_t desc_buf;
 
@@ -321,6 +321,9 @@  static int schedule(odp_queue_t *out_queue, odp_buffer_t out_buf[],
 
 				return ret;
 			}
+
+			j++;
+			id++;
 		}
 	}