@@ -25,6 +25,7 @@ typedef int (*schedule_init_queue_fn_t)(uint32_t queue_index,
);
typedef void (*schedule_destroy_queue_fn_t)(uint32_t queue_index);
typedef int (*schedule_sched_queue_fn_t)(uint32_t queue_index);
+typedef int (*schedule_unsched_queue_fn_t)(uint32_t queue_index);
typedef int (*schedule_ord_enq_multi_fn_t)(uint32_t queue_index,
void *buf_hdr[], int num, int *ret);
typedef int (*schedule_init_global_fn_t)(void);
@@ -44,6 +45,7 @@ typedef struct schedule_fn_t {
schedule_init_queue_fn_t init_queue;
schedule_destroy_queue_fn_t destroy_queue;
schedule_sched_queue_fn_t sched_queue;
+ schedule_unsched_queue_fn_t unsched_queue;
schedule_ord_enq_multi_fn_t ord_enq_multi;
schedule_init_global_fn_t init_global;
schedule_term_global_fn_t term_global;
@@ -525,8 +525,10 @@ static inline int deq_multi(queue_entry_t *queue, odp_buffer_hdr_t *buf_hdr[],
if (hdr == NULL) {
/* Already empty queue */
- if (queue->s.status == QUEUE_STATUS_SCHED)
+ if (queue->s.status == QUEUE_STATUS_SCHED) {
queue->s.status = QUEUE_STATUS_NOTSCHED;
+ sched_fn->unsched_queue(queue->s.index);
+ }
UNLOCK(&queue->s.lock);
return 0;
@@ -1200,6 +1200,11 @@ static int schedule_sched_queue(uint32_t queue_index)
return 0;
}
+static int schedule_unsched_queue(uint32_t queue_index ODP_UNUSED)
+{
+ return 0;
+}
+
static int schedule_num_grps(void)
{
return NUM_SCHED_GRPS;
@@ -1218,6 +1223,7 @@ const schedule_fn_t schedule_default_fn = {
.init_queue = schedule_init_queue,
.destroy_queue = schedule_destroy_queue,
.sched_queue = schedule_sched_queue,
+ .unsched_queue = schedule_unsched_queue,
.ord_enq_multi = schedule_ord_enq_multi,
.init_global = schedule_init_global,
.term_global = schedule_term_global,
@@ -390,6 +390,11 @@ static int sched_queue(uint32_t qi)
return 0;
}
+static int unsched_queue(uint32_t qi ODP_UNUSED)
+{
+ return 0;
+}
+
static int ord_enq_multi(uint32_t queue_index, void *buf_hdr[], int num,
int *ret)
{
@@ -816,6 +821,7 @@ const schedule_fn_t schedule_sp_fn = {
.init_queue = init_queue,
.destroy_queue = destroy_queue,
.sched_queue = sched_queue,
+ .unsched_queue = unsched_queue,
.ord_enq_multi = ord_enq_multi,
.init_global = init_global,
.term_global = term_global,
Add this unsched_queue callback to indicate queue's ineligible for scheduling. Signed-off-by: Yi He <yi.he@linaro.org> --- platform/linux-generic/include/odp_schedule_if.h | 2 ++ platform/linux-generic/odp_queue.c | 4 +++- platform/linux-generic/odp_schedule.c | 6 ++++++ platform/linux-generic/odp_schedule_sp.c | 6 ++++++ 4 files changed, 17 insertions(+), 1 deletion(-) -- 2.7.4