diff mbox

[1/2] api: queue: add odp_queue_sched_prio and odp_queue_sched_group

Message ID 1418047120-27159-1-git-send-email-ciprian.barbu@linaro.org
State New
Headers show

Commit Message

Ciprian Barbu Dec. 8, 2014, 1:58 p.m. UTC
Signed-off-by: Ciprian Barbu <ciprian.barbu@linaro.org>
---
 platform/linux-generic/include/api/odp_queue.h | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

Comments

Maxim Uvarov Dec. 9, 2014, 12:24 p.m. UTC | #1
Petri, please review.

Maxim.

On 12/08/2014 04:58 PM, Ciprian Barbu wrote:
> Signed-off-by: Ciprian Barbu <ciprian.barbu@linaro.org>
> ---
>   platform/linux-generic/include/api/odp_queue.h | 18 ++++++++++++++++++
>   1 file changed, 18 insertions(+)
>
> diff --git a/platform/linux-generic/include/api/odp_queue.h b/platform/linux-generic/include/api/odp_queue.h
> index b8ac4bb..d25fd65 100644
> --- a/platform/linux-generic/include/api/odp_queue.h
> +++ b/platform/linux-generic/include/api/odp_queue.h
> @@ -222,6 +222,24 @@ odp_queue_type_t odp_queue_type(odp_queue_t queue);
>   odp_schedule_sync_t odp_queue_sched_type(odp_queue_t queue);
>   
>   /**
> + * Queue priority
> + *
> + * @param queue   Queue handle
> + *
> + * @return Queue priority
> + */
> +odp_schedule_prio_t odp_queue_sched_prio(odp_queue_t queue);
> +
> +/**
> + * Queue group
> + *
> + * @param queue   Queue handle
> + *
> + * @return Queue group
> + */
> +odp_schedule_group_t odp_queue_sched_group(odp_queue_t queue);
> +
> +/**
>    * @}
>    */
>
Ciprian Barbu Dec. 9, 2014, 2:16 p.m. UTC | #2
On Tue, Dec 9, 2014 at 3:46 PM, Savolainen, Petri (NSN - FI/Espoo)
<petri.savolainen@nsn.com> wrote:
> After the minor documentation change (see under), for the entire patch set:

Yeah, sorry about that. Thanks!

>
> Reviewed-by: Petri Savolainen <petri.savolainen@linaro.org>
>
>
>> -----Original Message-----
>> From: lng-odp-bounces@lists.linaro.org [mailto:lng-odp-
>> bounces@lists.linaro.org] On Behalf Of ext Ciprian Barbu
>> Sent: Monday, December 08, 2014 3:59 PM
>> To: lng-odp@lists.linaro.org
>> Subject: [lng-odp] [PATCH 1/2] api: queue: add odp_queue_sched_prio and
>> odp_queue_sched_group
>>
>> Signed-off-by: Ciprian Barbu <ciprian.barbu@linaro.org>
>> ---
>>  platform/linux-generic/include/api/odp_queue.h | 18 ++++++++++++++++++
>>  1 file changed, 18 insertions(+)
>>
>> diff --git a/platform/linux-generic/include/api/odp_queue.h
>> b/platform/linux-generic/include/api/odp_queue.h
>> index b8ac4bb..d25fd65 100644
>> --- a/platform/linux-generic/include/api/odp_queue.h
>> +++ b/platform/linux-generic/include/api/odp_queue.h
>> @@ -222,6 +222,24 @@ odp_queue_type_t odp_queue_type(odp_queue_t queue);
>>  odp_schedule_sync_t odp_queue_sched_type(odp_queue_t queue);
>>
>>  /**
>> + * Queue priority
>
> Queue schedule priority
>
>> + *
>> + * @param queue   Queue handle
>> + *
>> + * @return Queue priority
>
> @return Queue schedule priority
>
>> + */
>> +odp_schedule_prio_t odp_queue_sched_prio(odp_queue_t queue);
>> +
>> +/**
>> + * Queue group
>
> Queue schedule group
>
>> + *
>> + * @param queue   Queue handle
>> + *
>> + * @return Queue group
>
> @return Queue schedule group
>
>> + */
>> +odp_schedule_group_t odp_queue_sched_group(odp_queue_t queue);
>> +
>> +/**
>>   * @}
>>   */
>>
>> --
>> 1.8.3.2
>>
>>
>> _______________________________________________
>> lng-odp mailing list
>> lng-odp@lists.linaro.org
>> http://lists.linaro.org/mailman/listinfo/lng-odp
Ciprian Barbu Dec. 10, 2014, 9:59 a.m. UTC | #3
On Tue, Dec 9, 2014 at 4:16 PM, Ciprian Barbu <ciprian.barbu@linaro.org> wrote:
> On Tue, Dec 9, 2014 at 3:46 PM, Savolainen, Petri (NSN - FI/Espoo)
> <petri.savolainen@nsn.com> wrote:
>> After the minor documentation change (see under), for the entire patch set:
>
> Yeah, sorry about that. Thanks!

Anders spotted I'm missing checks, v2 on the way.

>
>>
>> Reviewed-by: Petri Savolainen <petri.savolainen@linaro.org>
>>
>>
>>> -----Original Message-----
>>> From: lng-odp-bounces@lists.linaro.org [mailto:lng-odp-
>>> bounces@lists.linaro.org] On Behalf Of ext Ciprian Barbu
>>> Sent: Monday, December 08, 2014 3:59 PM
>>> To: lng-odp@lists.linaro.org
>>> Subject: [lng-odp] [PATCH 1/2] api: queue: add odp_queue_sched_prio and
>>> odp_queue_sched_group
>>>
>>> Signed-off-by: Ciprian Barbu <ciprian.barbu@linaro.org>
>>> ---
>>>  platform/linux-generic/include/api/odp_queue.h | 18 ++++++++++++++++++
>>>  1 file changed, 18 insertions(+)
>>>
>>> diff --git a/platform/linux-generic/include/api/odp_queue.h
>>> b/platform/linux-generic/include/api/odp_queue.h
>>> index b8ac4bb..d25fd65 100644
>>> --- a/platform/linux-generic/include/api/odp_queue.h
>>> +++ b/platform/linux-generic/include/api/odp_queue.h
>>> @@ -222,6 +222,24 @@ odp_queue_type_t odp_queue_type(odp_queue_t queue);
>>>  odp_schedule_sync_t odp_queue_sched_type(odp_queue_t queue);
>>>
>>>  /**
>>> + * Queue priority
>>
>> Queue schedule priority
>>
>>> + *
>>> + * @param queue   Queue handle
>>> + *
>>> + * @return Queue priority
>>
>> @return Queue schedule priority
>>
>>> + */
>>> +odp_schedule_prio_t odp_queue_sched_prio(odp_queue_t queue);
>>> +
>>> +/**
>>> + * Queue group
>>
>> Queue schedule group
>>
>>> + *
>>> + * @param queue   Queue handle
>>> + *
>>> + * @return Queue group
>>
>> @return Queue schedule group
>>
>>> + */
>>> +odp_schedule_group_t odp_queue_sched_group(odp_queue_t queue);
>>> +
>>> +/**
>>>   * @}
>>>   */
>>>
>>> --
>>> 1.8.3.2
>>>
>>>
>>> _______________________________________________
>>> lng-odp mailing list
>>> lng-odp@lists.linaro.org
>>> http://lists.linaro.org/mailman/listinfo/lng-odp
Ciprian Barbu Dec. 10, 2014, 10:18 a.m. UTC | #4
On Wed, Dec 10, 2014 at 11:59 AM, Ciprian Barbu
<ciprian.barbu@linaro.org> wrote:
> On Tue, Dec 9, 2014 at 4:16 PM, Ciprian Barbu <ciprian.barbu@linaro.org> wrote:
>> On Tue, Dec 9, 2014 at 3:46 PM, Savolainen, Petri (NSN - FI/Espoo)
>> <petri.savolainen@nsn.com> wrote:
>>> After the minor documentation change (see under), for the entire patch set:
>>
>> Yeah, sorry about that. Thanks!
>
> Anders spotted I'm missing checks, v2 on the way.
>
>>
>>>
>>> Reviewed-by: Petri Savolainen <petri.savolainen@linaro.org>
>>>
>>>
>>>> -----Original Message-----
>>>> From: lng-odp-bounces@lists.linaro.org [mailto:lng-odp-
>>>> bounces@lists.linaro.org] On Behalf Of ext Ciprian Barbu
>>>> Sent: Monday, December 08, 2014 3:59 PM
>>>> To: lng-odp@lists.linaro.org
>>>> Subject: [lng-odp] [PATCH 1/2] api: queue: add odp_queue_sched_prio and
>>>> odp_queue_sched_group
>>>>
>>>> Signed-off-by: Ciprian Barbu <ciprian.barbu@linaro.org>
>>>> ---
>>>>  platform/linux-generic/include/api/odp_queue.h | 18 ++++++++++++++++++
>>>>  1 file changed, 18 insertions(+)
>>>>
>>>> diff --git a/platform/linux-generic/include/api/odp_queue.h
>>>> b/platform/linux-generic/include/api/odp_queue.h
>>>> index b8ac4bb..d25fd65 100644
>>>> --- a/platform/linux-generic/include/api/odp_queue.h
>>>> +++ b/platform/linux-generic/include/api/odp_queue.h
>>>> @@ -222,6 +222,24 @@ odp_queue_type_t odp_queue_type(odp_queue_t queue);
>>>>  odp_schedule_sync_t odp_queue_sched_type(odp_queue_t queue);
>>>>
>>>>  /**
>>>> + * Queue priority
>>>
>>> Queue schedule priority
>>>
>>>> + *
>>>> + * @param queue   Queue handle
>>>> + *
>>>> + * @return Queue priority
>>>
>>> @return Queue schedule priority

Question: Can these two APIs fail (e.g. invalid queue handle) ? What
should the return value be if the queue handle is invalid? Maybe
introduce a ODP_SCHEDULE_PRIO_INVALID?

>>>
>>>> + */
>>>> +odp_schedule_prio_t odp_queue_sched_prio(odp_queue_t queue);
>>>> +
>>>> +/**
>>>> + * Queue group
>>>
>>> Queue schedule group
>>>
>>>> + *
>>>> + * @param queue   Queue handle
>>>> + *
>>>> + * @return Queue group
>>>
>>> @return Queue schedule group
>>>
>>>> + */
>>>> +odp_schedule_group_t odp_queue_sched_group(odp_queue_t queue);
>>>> +
>>>> +/**
>>>>   * @}
>>>>   */
>>>>
>>>> --
>>>> 1.8.3.2
>>>>
>>>>
>>>> _______________________________________________
>>>> lng-odp mailing list
>>>> lng-odp@lists.linaro.org
>>>> http://lists.linaro.org/mailman/listinfo/lng-odp
Ola Liljedahl Dec. 10, 2014, 11:02 a.m. UTC | #5
On 10 December 2014 at 11:18, Ciprian Barbu <ciprian.barbu@linaro.org> wrote:
> On Wed, Dec 10, 2014 at 11:59 AM, Ciprian Barbu
> <ciprian.barbu@linaro.org> wrote:
>> On Tue, Dec 9, 2014 at 4:16 PM, Ciprian Barbu <ciprian.barbu@linaro.org> wrote:
>>> On Tue, Dec 9, 2014 at 3:46 PM, Savolainen, Petri (NSN - FI/Espoo)
>>> <petri.savolainen@nsn.com> wrote:
>>>> After the minor documentation change (see under), for the entire patch set:
>>>
>>> Yeah, sorry about that. Thanks!
>>
>> Anders spotted I'm missing checks, v2 on the way.
>>
>>>
>>>>
>>>> Reviewed-by: Petri Savolainen <petri.savolainen@linaro.org>
>>>>
>>>>
>>>>> -----Original Message-----
>>>>> From: lng-odp-bounces@lists.linaro.org [mailto:lng-odp-
>>>>> bounces@lists.linaro.org] On Behalf Of ext Ciprian Barbu
>>>>> Sent: Monday, December 08, 2014 3:59 PM
>>>>> To: lng-odp@lists.linaro.org
>>>>> Subject: [lng-odp] [PATCH 1/2] api: queue: add odp_queue_sched_prio and
>>>>> odp_queue_sched_group
>>>>>
>>>>> Signed-off-by: Ciprian Barbu <ciprian.barbu@linaro.org>
>>>>> ---
>>>>>  platform/linux-generic/include/api/odp_queue.h | 18 ++++++++++++++++++
>>>>>  1 file changed, 18 insertions(+)
>>>>>
>>>>> diff --git a/platform/linux-generic/include/api/odp_queue.h
>>>>> b/platform/linux-generic/include/api/odp_queue.h
>>>>> index b8ac4bb..d25fd65 100644
>>>>> --- a/platform/linux-generic/include/api/odp_queue.h
>>>>> +++ b/platform/linux-generic/include/api/odp_queue.h
>>>>> @@ -222,6 +222,24 @@ odp_queue_type_t odp_queue_type(odp_queue_t queue);
>>>>>  odp_schedule_sync_t odp_queue_sched_type(odp_queue_t queue);
>>>>>
>>>>>  /**
>>>>> + * Queue priority
>>>>
>>>> Queue schedule priority
>>>>
>>>>> + *
>>>>> + * @param queue   Queue handle
>>>>> + *
>>>>> + * @return Queue priority
>>>>
>>>> @return Queue schedule priority
>
> Question: Can these two APIs fail (e.g. invalid queue handle) ? What
> should the return value be if the queue handle is invalid? Maybe
> introduce a ODP_SCHEDULE_PRIO_INVALID?
Is it expected that these functions are called with queue handles that
can reasonably become invalid, e.g. because some other thread has a
legal need for destroying the queues without properly synchronizing
with other threads that might use the queue handles? In such case, we
need to handle invalid queue handles gracefully. But until this is
proven, I prefer to treat all such cases as programming errors and
call abort (e.g. through ODP_ABORT). We can always loosen up the
semantics later if necessary, e.g. define some error code to be
returned for parameter errors.

>
>>>>
>>>>> + */
>>>>> +odp_schedule_prio_t odp_queue_sched_prio(odp_queue_t queue);
>>>>> +
>>>>> +/**
>>>>> + * Queue group
>>>>
>>>> Queue schedule group
>>>>
>>>>> + *
>>>>> + * @param queue   Queue handle
>>>>> + *
>>>>> + * @return Queue group
>>>>
>>>> @return Queue schedule group
>>>>
>>>>> + */
>>>>> +odp_schedule_group_t odp_queue_sched_group(odp_queue_t queue);
>>>>> +
>>>>> +/**
>>>>>   * @}
>>>>>   */
>>>>>
>>>>> --
>>>>> 1.8.3.2
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> lng-odp mailing list
>>>>> lng-odp@lists.linaro.org
>>>>> http://lists.linaro.org/mailman/listinfo/lng-odp
>
> _______________________________________________
> lng-odp mailing list
> lng-odp@lists.linaro.org
> http://lists.linaro.org/mailman/listinfo/lng-odp
diff mbox

Patch

diff --git a/platform/linux-generic/include/api/odp_queue.h b/platform/linux-generic/include/api/odp_queue.h
index b8ac4bb..d25fd65 100644
--- a/platform/linux-generic/include/api/odp_queue.h
+++ b/platform/linux-generic/include/api/odp_queue.h
@@ -222,6 +222,24 @@  odp_queue_type_t odp_queue_type(odp_queue_t queue);
 odp_schedule_sync_t odp_queue_sched_type(odp_queue_t queue);
 
 /**
+ * Queue priority
+ *
+ * @param queue   Queue handle
+ *
+ * @return Queue priority
+ */
+odp_schedule_prio_t odp_queue_sched_prio(odp_queue_t queue);
+
+/**
+ * Queue group
+ *
+ * @param queue   Queue handle
+ *
+ * @return Queue group
+ */
+odp_schedule_group_t odp_queue_sched_group(odp_queue_t queue);
+
+/**
  * @}
  */