diff mbox series

[API-NEXT,v1,2/3] linux-gen: queue: fill blocking capa

Message ID 1511272811-6276-3-git-send-email-odpbot@yandex.ru
State New
Headers show
Series [API-NEXT,v1,1/3] api: queue: blocking level parameter | expand

Commit Message

Github ODP bot Nov. 21, 2017, 2 p.m. UTC
From: Petri Savolainen <petri.savolainen@linaro.org>


Currently, only blocking queues are implemented.

Signed-off-by: Petri Savolainen <petri.savolainen@linaro.org>

---
/** Email created from pull request 302 (psavol:next-lockfree-queue)
 ** https://github.com/Linaro/odp/pull/302
 ** Patch: https://github.com/Linaro/odp/pull/302.patch
 ** Base sha: d4b364849c4abb4c71e0c5260e1a793ebb8dc97d
 ** Merge commit sha: fc00736d09bd0388db2bde3a9177edfd995eec67
 **/
 platform/linux-generic/odp_queue.c          | 15 +++++++++------
 platform/linux-generic/odp_queue_scalable.c | 18 ++++++++++--------
 2 files changed, 19 insertions(+), 14 deletions(-)
diff mbox series

Patch

diff --git a/platform/linux-generic/odp_queue.c b/platform/linux-generic/odp_queue.c
index 3f355e695..ca8ce16b3 100644
--- a/platform/linux-generic/odp_queue.c
+++ b/platform/linux-generic/odp_queue.c
@@ -145,12 +145,14 @@  static int queue_capability(odp_queue_capability_t *capa)
 	memset(capa, 0, sizeof(odp_queue_capability_t));
 
 	/* Reserve some queues for internal use */
-	capa->max_queues        = ODP_CONFIG_QUEUES - NUM_INTERNAL_QUEUES;
-	capa->max_ordered_locks = sched_fn->max_ordered_locks();
-	capa->max_sched_groups  = sched_fn->num_grps();
-	capa->sched_prios       = odp_schedule_num_prio();
-	capa->plain.max_num     = capa->max_queues;
-	capa->sched.max_num     = capa->max_queues;
+	capa->max_queues           = ODP_CONFIG_QUEUES - NUM_INTERNAL_QUEUES;
+	capa->max_ordered_locks    = sched_fn->max_ordered_locks();
+	capa->max_sched_groups     = sched_fn->num_grps();
+	capa->sched_prios          = odp_schedule_num_prio();
+	capa->plain.max_num        = capa->max_queues;
+	capa->plain.blocking_level = ODP_BLOCKING;
+	capa->sched.max_num        = capa->max_queues;
+	capa->sched.blocking_level = ODP_BLOCKING;
 
 	return 0;
 }
@@ -601,6 +603,7 @@  static void queue_param_init(odp_queue_param_t *params)
 	params->type = ODP_QUEUE_TYPE_PLAIN;
 	params->enq_mode = ODP_QUEUE_OP_MT;
 	params->deq_mode = ODP_QUEUE_OP_MT;
+	params->blocking_level = ODP_BLOCKING;
 	params->sched.prio  = ODP_SCHED_PRIO_DEFAULT;
 	params->sched.sync  = ODP_SCHED_SYNC_PARALLEL;
 	params->sched.group = ODP_SCHED_GROUP_ALL;
diff --git a/platform/linux-generic/odp_queue_scalable.c b/platform/linux-generic/odp_queue_scalable.c
index 07201ce7b..87165195b 100644
--- a/platform/linux-generic/odp_queue_scalable.c
+++ b/platform/linux-generic/odp_queue_scalable.c
@@ -309,14 +309,16 @@  static int queue_capability(odp_queue_capability_t *capa)
 	memset(capa, 0, sizeof(odp_queue_capability_t));
 
 	/* Reserve some queues for internal use */
-	capa->max_queues        = ODP_CONFIG_QUEUES - NUM_INTERNAL_QUEUES;
-	capa->max_ordered_locks = sched_fn->max_ordered_locks();
-	capa->max_sched_groups  = sched_fn->num_grps();
-	capa->sched_prios       = odp_schedule_num_prio();
-	capa->plain.max_num     = ODP_CONFIG_QUEUES - NUM_INTERNAL_QUEUES;
-	capa->plain.max_size    = 0;
-	capa->sched.max_num     = ODP_CONFIG_QUEUES - NUM_INTERNAL_QUEUES;
-	capa->sched.max_size    = 0;
+	capa->max_queues           = ODP_CONFIG_QUEUES - NUM_INTERNAL_QUEUES;
+	capa->max_ordered_locks    = sched_fn->max_ordered_locks();
+	capa->max_sched_groups     = sched_fn->num_grps();
+	capa->sched_prios          = odp_schedule_num_prio();
+	capa->plain.max_num        = ODP_CONFIG_QUEUES - NUM_INTERNAL_QUEUES;
+	capa->plain.max_size       = 0;
+	capa->plain.blocking_level = ODP_BLOCKING;
+	capa->sched.max_num        = ODP_CONFIG_QUEUES - NUM_INTERNAL_QUEUES;
+	capa->sched.max_size       = 0;
+	capa->sched.blocking_level = ODP_BLOCKING;
 
 	return 0;
 }