aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPetri Savolainen <petri.savolainen@linaro.org>2018-12-17 16:03:02 +0200
committerMaxim Uvarov <maxim.uvarov@linaro.org>2018-12-26 16:48:54 +0300
commitb0d8afdb22c92c4f0974acbe30e346110b8a8fc6 (patch)
tree6ba9efa6000b66eb06c09999b8ce5b6959f6ebf7
parent89f4d6b463c93e2e87634f0d17f214d967b66bdd (diff)
api: sched: max_flow_id capability
Change max number of flows to max flow ID. This way implementation can utilize full 32 bits of flow ID space. Also, note explicitly that odp_schedule_config() must be called only once. Signed-off-by: Petri Savolainen <petri.savolainen@linaro.org> Reviewed-by: Dmitry Eremin-Solenikov <dmitry.ereminsolenikov@linaro.org> Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
-rw-r--r--include/odp/api/spec/schedule.h4
-rw-r--r--include/odp/api/spec/schedule_types.h38
2 files changed, 23 insertions, 19 deletions
diff --git a/include/odp/api/spec/schedule.h b/include/odp/api/spec/schedule.h
index 432921245..fa66f2600 100644
--- a/include/odp/api/spec/schedule.h
+++ b/include/odp/api/spec/schedule.h
@@ -271,8 +271,8 @@ void odp_schedule_config_init(odp_schedule_config_t *config);
*
* Initialize and configure scheduler with global configuration options
* to schedule events across different scheduled queues.
- * This function must be called before scheduler is used (any other scheduler
- * function is called except odp_schedule_capability() and
+ * This function must be called only once and before scheduler is used
+ * (any other scheduler function is called except odp_schedule_capability() and
* odp_schedule_config_init()) or any queues are created (by application itself
* or by other ODP modules).
* An application can pass NULL value to use default configuration. It will
diff --git a/include/odp/api/spec/schedule_types.h b/include/odp/api/spec/schedule_types.h
index 3648c64e0..2acec0dba 100644
--- a/include/odp/api/spec/schedule_types.h
+++ b/include/odp/api/spec/schedule_types.h
@@ -196,12 +196,13 @@ typedef struct odp_schedule_capability_t {
* events. */
uint32_t max_queue_size;
- /** Maximum supported flows per queue.
- * Specifies the maximum number of flows per queue supported by the
- * implementation. A value of 0 indicates flow aware mode is not
- * supported.
- */
- uint32_t max_flows;
+ /** Maximum flow ID per queue
+ *
+ * Valid flow ID range in flow aware mode of scheduling is from 0 to
+ * this maximum value. So, maximum number of flows per queue is this
+ * value plus one. A value of 0 indicates that flow aware mode is not
+ * supported. */
+ uint32_t max_flow_id;
/** Lock-free (ODP_NONBLOCKING_LF) queues support.
* The specification is the same as for the blocking implementation. */
@@ -230,21 +231,24 @@ typedef struct odp_schedule_config_t {
*/
uint32_t queue_size;
- /** Number of flows per queue to be supported. Scheduler enables flow
- * aware mode when flow count is configured greater than 1 (up to
- * 'max_flows' capability).
+ /** Maximum flow ID per queue
*
- * Flows are lightweight entities and events can be assigned to
- * specific flows by the application using odp_event_flow_id_set()
- * before enqueuing the event into the scheduler. This value is ignored
- * unless scheduler supports flow aware mode.
+ * This value must not exceed 'max_flow_id' capability. Flow aware
+ * mode of scheduling is enabled when the value is greater than 0.
+ * The default value is 0.
*
- * This number should be less than maximum flow supported by the
- * implementation. The default value is zero.
+ * Application can assign events to specific flows by calling
+ * odp_event_flow_id_set() before enqueuing events into a scheduled
+ * queue. When in flow aware mode, the event flow id value affects
+ * scheduling of the event and synchronization is maintained per flow
+ * within each queue.
*
- * @see odp_schedule_capability_t
+ * Depeding on implementation, there may be much more flows supported
+ * than queues, as flows are lightweight entities.
+ *
+ * @see odp_schedule_capability_t, odp_event_flow_id()
*/
- uint32_t num_flows;
+ uint32_t max_flow_id;
} odp_schedule_config_t;