On Thu, Apr 6, 2017 at 11:07 PM, Honnappa Nagarahalli
<[email protected]> wrote:
> Added size parameter indicating the maximum number of events in the
> queue and the corresponding queue capability changes.
>
> Signed-off-by: Honnappa Nagarahalli <[email protected]>
> ---
>  include/odp/api/spec/queue.h       | 12 ++++++++++++
>  platform/linux-generic/odp_queue.c |  1 +
>  2 files changed, 13 insertions(+)
>
> diff --git a/include/odp/api/spec/queue.h b/include/odp/api/spec/queue.h
> index 7972fea..ccb6fb8 100644
> --- a/include/odp/api/spec/queue.h
> +++ b/include/odp/api/spec/queue.h
> @@ -112,6 +112,12 @@ typedef struct odp_queue_capability_t {
>         /** Number of scheduling priorities */
>         unsigned sched_prios;
>
> +       /** Maximum number of events in the queue.
> +         *
> +         * Value of zero indicates the size is limited only by the available
> +         * memory in the system. */

This is not a specification, as memory may not be the controlling
factor. I'd rephrase this as:

"A value of zero indicates that there is no fixed upper bound to the
queue size."

> +       unsigned max_size;
> +
>  } odp_queue_capability_t;
>
>  /**
> @@ -124,6 +130,12 @@ typedef struct odp_queue_param_t {
>           * the queue type. */
>         odp_queue_type_t type;
>
> +       /** Queue size
> +         *
> +         * Maximum number of events in the queue. Value of 0 chooses the
> +         * default configuration of the implementation. */
> +       uint32_t size;
> +
>         /** Enqueue mode
>           *
>           * Default value for both queue types is ODP_QUEUE_OP_MT. Application
> diff --git a/platform/linux-generic/odp_queue.c 
> b/platform/linux-generic/odp_queue.c
> index fcf4bf5..5a50a57 100644
> --- a/platform/linux-generic/odp_queue.c
> +++ b/platform/linux-generic/odp_queue.c
> @@ -175,6 +175,7 @@ int odp_queue_capability(odp_queue_capability_t *capa)
>         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->max_size          = 0;
>
>         return 0;
>  }
> --
> 2.7.4
>

Reply via email to