Defines which values queue param init set by default. Default
queue type is PLAIN, but it minimizes application work if also
sched params are init with well known defaults. PARALLEL is chosen
as default since it provides the lowest level of features.

Signed-off-by: Petri Savolainen <[email protected]>
---
 include/odp/api/spec/queue.h          |  4 +++-
 include/odp/api/spec/schedule_types.h | 19 +++++++++++++++----
 platform/linux-generic/odp_queue.c    |  3 +++
 3 files changed, 21 insertions(+), 5 deletions(-)

diff --git a/include/odp/api/spec/queue.h b/include/odp/api/spec/queue.h
index 532d6b6..a16821c 100644
--- a/include/odp/api/spec/queue.h
+++ b/include/odp/api/spec/queue.h
@@ -341,7 +341,9 @@ uint64_t odp_queue_to_u64(odp_queue_t hdl);
 /**
  * Initialize queue params
  *
- * Initialize an odp_queue_param_t to its default values for all fields
+ * Initialize an odp_queue_param_t to its default values for all fields.
+ * Also the schedule parameters are set to defaults, although the default queue
+ * type is ODP_QUEUE_TYPE_PLAIN.
  *
  * @param param   Address of the odp_queue_param_t to be initialized
  */
diff --git a/include/odp/api/spec/schedule_types.h 
b/include/odp/api/spec/schedule_types.h
index cf204f4..34046af 100644
--- a/include/odp/api/spec/schedule_types.h
+++ b/include/odp/api/spec/schedule_types.h
@@ -127,13 +127,24 @@ extern "C" {
 
 /** Scheduler parameters */
 typedef        struct odp_schedule_param_t {
-       /** Priority level */
+       /** Priority level
+         *
+         * Default value is ODP_SCHED_PRIO_DEFAULT. */
        odp_schedule_prio_t  prio;
-       /** Synchronization method */
+
+       /** Synchronization method
+         *
+         * Default value is ODP_SCHED_SYNC_PARALLEL. */
        odp_schedule_sync_t  sync;
-       /** Thread group */
+
+       /** Thread group
+         *
+         * Default value is ODP_SCHED_GROUP_ALL. */
        odp_schedule_group_t group;
-       /** Ordered lock count for this queue */
+
+       /** Ordered lock count for this queue
+         *
+         * Default value is 0. */
        unsigned lock_count;
 } odp_schedule_param_t;
 
diff --git a/platform/linux-generic/odp_queue.c 
b/platform/linux-generic/odp_queue.c
index b2519a0..cc324c6 100644
--- a/platform/linux-generic/odp_queue.c
+++ b/platform/linux-generic/odp_queue.c
@@ -1013,6 +1013,9 @@ void odp_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->sched.prio  = ODP_SCHED_PRIO_DEFAULT;
+       params->sched.sync  = ODP_SCHED_SYNC_PARALLEL;
+       params->sched.group = ODP_SCHED_GROUP_ALL;
 }
 
 /* These routines exists here rather than in odp_schedule
-- 
2.7.1

_______________________________________________
lng-odp mailing list
[email protected]
https://lists.linaro.org/mailman/listinfo/lng-odp

Reply via email to