diff mbox series

[API-NEXT,1/4] api: timer: add odp_timer_capability() api

Message ID 1484889704-14990-1-git-send-email-kevin.wang@linaro.org
State Superseded
Headers show
Series [API-NEXT,1/4] api: timer: add odp_timer_capability() api | expand

Commit Message

Kevin Wang Jan. 20, 2017, 5:21 a.m. UTC
Currently, user needs to decide the timer resolution before creating
a timer pool. But sometimes it will cause timer overrun as the system
can't support such high resolution.
So a new API is required to expose the timer capability to the user.

Signed-off-by: Kevin Wang <kevin.wang@linaro.org>

---
 include/odp/api/spec/timer.h | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

-- 
1.9.1

Comments

Mike Holmes Jan. 20, 2017, 4:43 p.m. UTC | #1
Hi Kevin

How did you send these patches ?
If you look in patchworks it can't identify them as a series and gives
them odd names. http://patches.opendataplane.org/project/lng-odp/list/

Untitled series #10
Untitled series #11
Untitled series #12

Even though they claim to be (n) of 4

Perhaps you did not generate them with git format patch as a series
but manually changed their names ?

Mike

On 20 January 2017 at 00:21, Kevin Wang <kevin.wang@linaro.org> wrote:
> Currently, user needs to decide the timer resolution before creating

> a timer pool. But sometimes it will cause timer overrun as the system

> can't support such high resolution.

> So a new API is required to expose the timer capability to the user.

>

> Signed-off-by: Kevin Wang <kevin.wang@linaro.org>

> ---

>  include/odp/api/spec/timer.h | 21 +++++++++++++++++++++

>  1 file changed, 21 insertions(+)

>

> diff --git a/include/odp/api/spec/timer.h b/include/odp/api/spec/timer.h

> index 75f9db9..78d9119 100644

> --- a/include/odp/api/spec/timer.h

> +++ b/include/odp/api/spec/timer.h

> @@ -108,6 +108,27 @@ typedef struct {

>  } odp_timer_pool_param_t;

>

>  /**

> + * Timer capability

> + */

> +typedef struct {

> +       uint64_t res_ns; /**< Timeout resolution in nanoseconds */

> +} odp_timer_capability_t;

> +

> +

> +/**

> + * Query Timer interface capabilities

> + *

> + * Outputs Timer interface capabilities on success.

> + *

> + * @param clk_src Clock source for timers

> + * @param[out] capa   Pointer to capability structure for output

> + *

> + * @retval 0 on success

> + * @retval <0 on failure

> + */

> +int odp_timer_capability(odp_timer_clk_src_t clk_src, odp_timer_capability_t *capa);

> +

> +/**

>   * Create a timer pool

>   *

>   * The use of pool name is optional. Unique names are not required.

> --

> 1.9.1

>




-- 
Mike Holmes
Program Manager - Linaro Networking Group
Linaro.org │ Open source software for ARM SoCs
"Work should be fun and collaborative, the rest follows"
Bill Fischofer Jan. 21, 2017, 2:53 p.m. UTC | #2
In general these look good, but still have some problems:

1. The are checkpatch formatting issues in parts 1, 2, and 3. Please
run ./scripts/checkpatch on your patches before submitting and ensure
that they are clean.

2. Each new revision of a patch should increment the version number.
This one really should have been PATCHv2 since it was a resubmittal of
the original. So for the next revision please be sure you use the
command:

git format-patch origin/api-next --subject-prefix="API-NEXT PATCHv3"

I suspect this should also fix Mike's noted issue with the series
since you didn't increment the version number last time but changed
the patch structure.

On Fri, Jan 20, 2017 at 10:43 AM, Mike Holmes <mike.holmes@linaro.org> wrote:
> Hi Kevin

>

> How did you send these patches ?

> If you look in patchworks it can't identify them as a series and gives

> them odd names. http://patches.opendataplane.org/project/lng-odp/list/

>

> Untitled series #10

> Untitled series #11

> Untitled series #12

>

> Even though they claim to be (n) of 4

>

> Perhaps you did not generate them with git format patch as a series

> but manually changed their names ?

>

> Mike

>

> On 20 January 2017 at 00:21, Kevin Wang <kevin.wang@linaro.org> wrote:

>> Currently, user needs to decide the timer resolution before creating

>> a timer pool. But sometimes it will cause timer overrun as the system

>> can't support such high resolution.

>> So a new API is required to expose the timer capability to the user.

>>

>> Signed-off-by: Kevin Wang <kevin.wang@linaro.org>

>> ---

>>  include/odp/api/spec/timer.h | 21 +++++++++++++++++++++

>>  1 file changed, 21 insertions(+)

>>

>> diff --git a/include/odp/api/spec/timer.h b/include/odp/api/spec/timer.h

>> index 75f9db9..78d9119 100644

>> --- a/include/odp/api/spec/timer.h

>> +++ b/include/odp/api/spec/timer.h

>> @@ -108,6 +108,27 @@ typedef struct {

>>  } odp_timer_pool_param_t;

>>

>>  /**

>> + * Timer capability

>> + */

>> +typedef struct {

>> +       uint64_t res_ns; /**< Timeout resolution in nanoseconds */

>> +} odp_timer_capability_t;

>> +

>> +

>> +/**

>> + * Query Timer interface capabilities

>> + *

>> + * Outputs Timer interface capabilities on success.

>> + *

>> + * @param clk_src Clock source for timers

>> + * @param[out] capa   Pointer to capability structure for output

>> + *

>> + * @retval 0 on success

>> + * @retval <0 on failure

>> + */

>> +int odp_timer_capability(odp_timer_clk_src_t clk_src, odp_timer_capability_t *capa);

>> +

>> +/**

>>   * Create a timer pool

>>   *

>>   * The use of pool name is optional. Unique names are not required.

>> --

>> 1.9.1

>>

>

>

>

> --

> Mike Holmes

> Program Manager - Linaro Networking Group

> Linaro.org │ Open source software for ARM SoCs

> "Work should be fun and collaborative, the rest follows"
Yi He Jan. 22, 2017, 8:59 a.m. UTC | #3
Hi, Bill and Mike

Thanks for your comments, Kevin starts his vacation till Feb 3, Song and I
will bring this thread up to him.

Best Regards, Yi

On 21 January 2017 at 22:53, Bill Fischofer <bill.fischofer@linaro.org>
wrote:

> In general these look good, but still have some problems:

>

> 1. The are checkpatch formatting issues in parts 1, 2, and 3. Please

> run ./scripts/checkpatch on your patches before submitting and ensure

> that they are clean.

>

> 2. Each new revision of a patch should increment the version number.

> This one really should have been PATCHv2 since it was a resubmittal of

> the original. So for the next revision please be sure you use the

> command:

>

> git format-patch origin/api-next --subject-prefix="API-NEXT PATCHv3"

>

> I suspect this should also fix Mike's noted issue with the series

> since you didn't increment the version number last time but changed

> the patch structure.

>

> On Fri, Jan 20, 2017 at 10:43 AM, Mike Holmes <mike.holmes@linaro.org>

> wrote:

> > Hi Kevin

> >

> > How did you send these patches ?

> > If you look in patchworks it can't identify them as a series and gives

> > them odd names. http://patches.opendataplane.org/project/lng-odp/list/

> >

> > Untitled series #10

> > Untitled series #11

> > Untitled series #12

> >

> > Even though they claim to be (n) of 4

> >

> > Perhaps you did not generate them with git format patch as a series

> > but manually changed their names ?

> >

> > Mike

> >

> > On 20 January 2017 at 00:21, Kevin Wang <kevin.wang@linaro.org> wrote:

> >> Currently, user needs to decide the timer resolution before creating

> >> a timer pool. But sometimes it will cause timer overrun as the system

> >> can't support such high resolution.

> >> So a new API is required to expose the timer capability to the user.

> >>

> >> Signed-off-by: Kevin Wang <kevin.wang@linaro.org>

> >> ---

> >>  include/odp/api/spec/timer.h | 21 +++++++++++++++++++++

> >>  1 file changed, 21 insertions(+)

> >>

> >> diff --git a/include/odp/api/spec/timer.h b/include/odp/api/spec/timer.h

> >> index 75f9db9..78d9119 100644

> >> --- a/include/odp/api/spec/timer.h

> >> +++ b/include/odp/api/spec/timer.h

> >> @@ -108,6 +108,27 @@ typedef struct {

> >>  } odp_timer_pool_param_t;

> >>

> >>  /**

> >> + * Timer capability

> >> + */

> >> +typedef struct {

> >> +       uint64_t res_ns; /**< Timeout resolution in nanoseconds */

> >> +} odp_timer_capability_t;

> >> +

> >> +

> >> +/**

> >> + * Query Timer interface capabilities

> >> + *

> >> + * Outputs Timer interface capabilities on success.

> >> + *

> >> + * @param clk_src Clock source for timers

> >> + * @param[out] capa   Pointer to capability structure for output

> >> + *

> >> + * @retval 0 on success

> >> + * @retval <0 on failure

> >> + */

> >> +int odp_timer_capability(odp_timer_clk_src_t clk_src,

> odp_timer_capability_t *capa);

> >> +

> >> +/**

> >>   * Create a timer pool

> >>   *

> >>   * The use of pool name is optional. Unique names are not required.

> >> --

> >> 1.9.1

> >>

> >

> >

> >

> > --

> > Mike Holmes

> > Program Manager - Linaro Networking Group

> > Linaro.org │ Open source software for ARM SoCs

> > "Work should be fun and collaborative, the rest follows"

>
Kevin Wang Feb. 7, 2017, 9:28 a.m. UTC | #4
​Hi Bill, Mike,
​./scripts/checkpatch is already ok.
But those patches still can't be identified as a series. Not sure the
reason. I'll list my commit steps.

1. git format-patch origin/api-next -s --cover-letter
--subject-prefix="API-NEXT PATCHv3"
Then there will be five new files are created.
2. Edit them to add [lng-odp] at the prefix of subject for each patch.
Like:
Original:Subject: [API-NEXT PATCHv3 1/4] api: timer: add
odp_timer_capability() api
Modified: Subject: [lng-odp] [API-NEXT PATCHv3 1/4] api: timer: add
odp_timer_capability() api

3. Send Email
git send-email --to=lng-odp@lists.linaro.org 0000-cover-letter.patch git
send-email --to=lng-odp@lists.linaro.org
0001-api-timer-add-odp_timer_capability-api.patch git send-email --to=
lng-odp@lists.linaro.org
0002-linux-generic-timer-implement-odp_timer_capability.patch git
send-email --to=lng-odp@lists.linaro.org
0003-validation-example-call-odp_timer_capability-before-.patch git
send-email --to=lng-odp@lists.linaro.org
0004-doc-userguide-add-odp_timer_capability-section-to-us.patch

​Please correct me if I missed any steps.​

Thanks
​Kevin​


2017-01-22 16:59 GMT+08:00 Yi He <yi.he@linaro.org>:

> Hi, Bill and Mike

>

> Thanks for your comments, Kevin starts his vacation till Feb 3, Song and I

> will bring this thread up to him.

>

> Best Regards, Yi

>

> On 21 January 2017 at 22:53, Bill Fischofer <bill.fischofer@linaro.org>

> wrote:

>

> > In general these look good, but still have some problems:

> >

> > 1. The are checkpatch formatting issues in parts 1, 2, and 3. Please

> > run ./scripts/checkpatch on your patches before submitting and ensure

> > that they are clean.

> >

> > 2. Each new revision of a patch should increment the version number.

> > This one really should have been PATCHv2 since it was a resubmittal of

> > the original. So for the next revision please be sure you use the

> > command:

> >

> > git format-patch origin/api-next --subject-prefix="API-NEXT PATCHv3"

> >

> > I suspect this should also fix Mike's noted issue with the series

> > since you didn't increment the version number last time but changed

> > the patch structure.

> >

> > On Fri, Jan 20, 2017 at 10:43 AM, Mike Holmes <mike.holmes@linaro.org>

> > wrote:

> > > Hi Kevin

> > >

> > > How did you send these patches ?

> > > If you look in patchworks it can't identify them as a series and gives

> > > them odd names. http://patches.opendataplane.org/project/lng-odp/list/

> > >

> > > Untitled series #10

> > > Untitled series #11

> > > Untitled series #12

> > >

> > > Even though they claim to be (n) of 4

> > >

> > > Perhaps you did not generate them with git format patch as a series

> > > but manually changed their names ?

> > >

> > > Mike

> > >

> > > On 20 January 2017 at 00:21, Kevin Wang <kevin.wang@linaro.org> wrote:

> > >> Currently, user needs to decide the timer resolution before creating

> > >> a timer pool. But sometimes it will cause timer overrun as the system

> > >> can't support such high resolution.

> > >> So a new API is required to expose the timer capability to the user.

> > >>

> > >> Signed-off-by: Kevin Wang <kevin.wang@linaro.org>

> > >> ---

> > >>  include/odp/api/spec/timer.h | 21 +++++++++++++++++++++

> > >>  1 file changed, 21 insertions(+)

> > >>

> > >> diff --git a/include/odp/api/spec/timer.h

> b/include/odp/api/spec/timer.h

> > >> index 75f9db9..78d9119 100644

> > >> --- a/include/odp/api/spec/timer.h

> > >> +++ b/include/odp/api/spec/timer.h

> > >> @@ -108,6 +108,27 @@ typedef struct {

> > >>  } odp_timer_pool_param_t;

> > >>

> > >>  /**

> > >> + * Timer capability

> > >> + */

> > >> +typedef struct {

> > >> +       uint64_t res_ns; /**< Timeout resolution in nanoseconds */

> > >> +} odp_timer_capability_t;

> > >> +

> > >> +

> > >> +/**

> > >> + * Query Timer interface capabilities

> > >> + *

> > >> + * Outputs Timer interface capabilities on success.

> > >> + *

> > >> + * @param clk_src Clock source for timers

> > >> + * @param[out] capa   Pointer to capability structure for output

> > >> + *

> > >> + * @retval 0 on success

> > >> + * @retval <0 on failure

> > >> + */

> > >> +int odp_timer_capability(odp_timer_clk_src_t clk_src,

> > odp_timer_capability_t *capa);

> > >> +

> > >> +/**

> > >>   * Create a timer pool

> > >>   *

> > >>   * The use of pool name is optional. Unique names are not required.

> > >> --

> > >> 1.9.1

> > >>

> > >

> > >

> > >

> > > --

> > > Mike Holmes

> > > Program Manager - Linaro Networking Group

> > > Linaro.org │ Open source software for ARM SoCs

> > > "Work should be fun and collaborative, the rest follows"

> >

>




-- 
Thanks,
Kevin
Maxim Uvarov Feb. 7, 2017, 1:35 p.m. UTC | #5
On 02/07/17 12:28, Kevin Wang wrote:
> ​Hi Bill, Mike,

> ​./scripts/checkpatch is already ok.

> But those patches still can't be identified as a series. Not sure the

> reason. I'll list my commit steps.

> 

> 1. git format-patch origin/api-next -s --cover-letter

> --subject-prefix="API-NEXT PATCHv3"


git format-patch -M <base_commit_hash> --cover-letter
--subject-prefix="API-NEXT PATCHv3"

then check patches:

perl ./scripts/checkpatch.pl *.patch


> Then there will be five new files are created.

> 2. Edit them to add [lng-odp] at the prefix of subject for each patch.

> Like:

> Original:Subject: [API-NEXT PATCHv3 1/4] api: timer: add

> odp_timer_capability() api

> Modified: Subject: [lng-odp] [API-NEXT PATCHv3 1/4] api: timer: add

> odp_timer_capability() api

> 


mailing list adds [lng-odp] automatically. Please do not modify patches
after creation. Only cover letter you can change.


> 3. Send Email

> git send-email --to=lng-odp@lists.linaro.org 0000-cover-letter.patch git

> send-email --to=lng-odp@lists.linaro.org

> 0001-api-timer-add-odp_timer_capability-api.patch git send-email --to=

> lng-odp@lists.linaro.org

> 0002-linux-generic-timer-implement-odp_timer_capability.patch git

> send-email --to=lng-odp@lists.linaro.org

> 0003-validation-example-call-odp_timer_capability-before-.patch git

> send-email --to=lng-odp@lists.linaro.org

> 0004-doc-userguide-add-odp_timer_capability-section-to-us.patch

> 

> ​Please correct me if I missed any steps.​

> 


send all packets as patch set with one command:
 git send-email --to=lng-odp@lists.linaro.org *.patch

Maxim.

> Thanks

> ​Kevin​

> 

> 

> 2017-01-22 16:59 GMT+08:00 Yi He <yi.he@linaro.org>:

> 

>> Hi, Bill and Mike

>>

>> Thanks for your comments, Kevin starts his vacation till Feb 3, Song and I

>> will bring this thread up to him.

>>

>> Best Regards, Yi

>>

>> On 21 January 2017 at 22:53, Bill Fischofer <bill.fischofer@linaro.org>

>> wrote:

>>

>>> In general these look good, but still have some problems:

>>>

>>> 1. The are checkpatch formatting issues in parts 1, 2, and 3. Please

>>> run ./scripts/checkpatch on your patches before submitting and ensure

>>> that they are clean.

>>>

>>> 2. Each new revision of a patch should increment the version number.

>>> This one really should have been PATCHv2 since it was a resubmittal of

>>> the original. So for the next revision please be sure you use the

>>> command:

>>>

>>> git format-patch origin/api-next --subject-prefix="API-NEXT PATCHv3"

>>>

>>> I suspect this should also fix Mike's noted issue with the series

>>> since you didn't increment the version number last time but changed

>>> the patch structure.

>>>

>>> On Fri, Jan 20, 2017 at 10:43 AM, Mike Holmes <mike.holmes@linaro.org>

>>> wrote:

>>>> Hi Kevin

>>>>

>>>> How did you send these patches ?

>>>> If you look in patchworks it can't identify them as a series and gives

>>>> them odd names. http://patches.opendataplane.org/project/lng-odp/list/

>>>>

>>>> Untitled series #10

>>>> Untitled series #11

>>>> Untitled series #12

>>>>

>>>> Even though they claim to be (n) of 4

>>>>

>>>> Perhaps you did not generate them with git format patch as a series

>>>> but manually changed their names ?

>>>>

>>>> Mike

>>>>

>>>> On 20 January 2017 at 00:21, Kevin Wang <kevin.wang@linaro.org> wrote:

>>>>> Currently, user needs to decide the timer resolution before creating

>>>>> a timer pool. But sometimes it will cause timer overrun as the system

>>>>> can't support such high resolution.

>>>>> So a new API is required to expose the timer capability to the user.

>>>>>

>>>>> Signed-off-by: Kevin Wang <kevin.wang@linaro.org>

>>>>> ---

>>>>>  include/odp/api/spec/timer.h | 21 +++++++++++++++++++++

>>>>>  1 file changed, 21 insertions(+)

>>>>>

>>>>> diff --git a/include/odp/api/spec/timer.h

>> b/include/odp/api/spec/timer.h

>>>>> index 75f9db9..78d9119 100644

>>>>> --- a/include/odp/api/spec/timer.h

>>>>> +++ b/include/odp/api/spec/timer.h

>>>>> @@ -108,6 +108,27 @@ typedef struct {

>>>>>  } odp_timer_pool_param_t;

>>>>>

>>>>>  /**

>>>>> + * Timer capability

>>>>> + */

>>>>> +typedef struct {

>>>>> +       uint64_t res_ns; /**< Timeout resolution in nanoseconds */

>>>>> +} odp_timer_capability_t;

>>>>> +

>>>>> +

>>>>> +/**

>>>>> + * Query Timer interface capabilities

>>>>> + *

>>>>> + * Outputs Timer interface capabilities on success.

>>>>> + *

>>>>> + * @param clk_src Clock source for timers

>>>>> + * @param[out] capa   Pointer to capability structure for output

>>>>> + *

>>>>> + * @retval 0 on success

>>>>> + * @retval <0 on failure

>>>>> + */

>>>>> +int odp_timer_capability(odp_timer_clk_src_t clk_src,

>>> odp_timer_capability_t *capa);

>>>>> +

>>>>> +/**

>>>>>   * Create a timer pool

>>>>>   *

>>>>>   * The use of pool name is optional. Unique names are not required.

>>>>> --

>>>>> 1.9.1

>>>>>

>>>>

>>>>

>>>>

>>>> --

>>>> Mike Holmes

>>>> Program Manager - Linaro Networking Group

>>>> Linaro.org │ Open source software for ARM SoCs

>>>> "Work should be fun and collaborative, the rest follows"

>>>

>>

> 

> 

>
Kevin Wang Feb. 9, 2017, 2:43 a.m. UTC | #6
​From yesterday's ​sync meeting, we have some new requirements besides
timer resolution.
So should we complete the code review and upstream this patch set
previously? We can use another patchset to trace the new requirements.

​Kevin​

2017-02-07 21:35 GMT+08:00 Maxim Uvarov <maxim.uvarov@linaro.org>:

> On 02/07/17 12:28, Kevin Wang wrote:

> > ​Hi Bill, Mike,

> > ​./scripts/checkpatch is already ok.

> > But those patches still can't be identified as a series. Not sure the

> > reason. I'll list my commit steps.

> >

> > 1. git format-patch origin/api-next -s --cover-letter

> > --subject-prefix="API-NEXT PATCHv3"

>

> git format-patch -M <base_commit_hash> --cover-letter

> --subject-prefix="API-NEXT PATCHv3"

>

> then check patches:

>

> perl ./scripts/checkpatch.pl *.patch

>

>

> > Then there will be five new files are created.

> > 2. Edit them to add [lng-odp] at the prefix of subject for each patch.

> > Like:

> > Original:Subject: [API-NEXT PATCHv3 1/4] api: timer: add

> > odp_timer_capability() api

> > Modified: Subject: [lng-odp] [API-NEXT PATCHv3 1/4] api: timer: add

> > odp_timer_capability() api

> >

>

> mailing list adds [lng-odp] automatically. Please do not modify patches

> after creation. Only cover letter you can change.

>

>

> > 3. Send Email

> > git send-email --to=lng-odp@lists.linaro.org 0000-cover-letter.patch git

> > send-email --to=lng-odp@lists.linaro.org

> > 0001-api-timer-add-odp_timer_capability-api.patch git send-email --to=

> > lng-odp@lists.linaro.org

> > 0002-linux-generic-timer-implement-odp_timer_capability.patch git

> > send-email --to=lng-odp@lists.linaro.org

> > 0003-validation-example-call-odp_timer_capability-before-.patch git

> > send-email --to=lng-odp@lists.linaro.org

> > 0004-doc-userguide-add-odp_timer_capability-section-to-us.patch

> >

> > ​Please correct me if I missed any steps.​

> >

>

> send all packets as patch set with one command:

>  git send-email --to=lng-odp@lists.linaro.org *.patch

>

> Maxim.

>

> > Thanks

> > ​Kevin​

> >

> >

> > 2017-01-22 16:59 GMT+08:00 Yi He <yi.he@linaro.org>:

> >

> >> Hi, Bill and Mike

> >>

> >> Thanks for your comments, Kevin starts his vacation till Feb 3, Song

> and I

> >> will bring this thread up to him.

> >>

> >> Best Regards, Yi

> >>

> >> On 21 January 2017 at 22:53, Bill Fischofer <bill.fischofer@linaro.org>

> >> wrote:

> >>

> >>> In general these look good, but still have some problems:

> >>>

> >>> 1. The are checkpatch formatting issues in parts 1, 2, and 3. Please

> >>> run ./scripts/checkpatch on your patches before submitting and ensure

> >>> that they are clean.

> >>>

> >>> 2. Each new revision of a patch should increment the version number.

> >>> This one really should have been PATCHv2 since it was a resubmittal of

> >>> the original. So for the next revision please be sure you use the

> >>> command:

> >>>

> >>> git format-patch origin/api-next --subject-prefix="API-NEXT PATCHv3"

> >>>

> >>> I suspect this should also fix Mike's noted issue with the series

> >>> since you didn't increment the version number last time but changed

> >>> the patch structure.

> >>>

> >>> On Fri, Jan 20, 2017 at 10:43 AM, Mike Holmes <mike.holmes@linaro.org>

> >>> wrote:

> >>>> Hi Kevin

> >>>>

> >>>> How did you send these patches ?

> >>>> If you look in patchworks it can't identify them as a series and gives

> >>>> them odd names. http://patches.opendataplane.o

> rg/project/lng-odp/list/

> >>>>

> >>>> Untitled series #10

> >>>> Untitled series #11

> >>>> Untitled series #12

> >>>>

> >>>> Even though they claim to be (n) of 4

> >>>>

> >>>> Perhaps you did not generate them with git format patch as a series

> >>>> but manually changed their names ?

> >>>>

> >>>> Mike

> >>>>

> >>>> On 20 January 2017 at 00:21, Kevin Wang <kevin.wang@linaro.org>

> wrote:

> >>>>> Currently, user needs to decide the timer resolution before creating

> >>>>> a timer pool. But sometimes it will cause timer overrun as the system

> >>>>> can't support such high resolution.

> >>>>> So a new API is required to expose the timer capability to the user.

> >>>>>

> >>>>> Signed-off-by: Kevin Wang <kevin.wang@linaro.org>

> >>>>> ---

> >>>>>  include/odp/api/spec/timer.h | 21 +++++++++++++++++++++

> >>>>>  1 file changed, 21 insertions(+)

> >>>>>

> >>>>> diff --git a/include/odp/api/spec/timer.h

> >> b/include/odp/api/spec/timer.h

> >>>>> index 75f9db9..78d9119 100644

> >>>>> --- a/include/odp/api/spec/timer.h

> >>>>> +++ b/include/odp/api/spec/timer.h

> >>>>> @@ -108,6 +108,27 @@ typedef struct {

> >>>>>  } odp_timer_pool_param_t;

> >>>>>

> >>>>>  /**

> >>>>> + * Timer capability

> >>>>> + */

> >>>>> +typedef struct {

> >>>>> +       uint64_t res_ns; /**< Timeout resolution in nanoseconds */

> >>>>> +} odp_timer_capability_t;

> >>>>> +

> >>>>> +

> >>>>> +/**

> >>>>> + * Query Timer interface capabilities

> >>>>> + *

> >>>>> + * Outputs Timer interface capabilities on success.

> >>>>> + *

> >>>>> + * @param clk_src Clock source for timers

> >>>>> + * @param[out] capa   Pointer to capability structure for output

> >>>>> + *

> >>>>> + * @retval 0 on success

> >>>>> + * @retval <0 on failure

> >>>>> + */

> >>>>> +int odp_timer_capability(odp_timer_clk_src_t clk_src,

> >>> odp_timer_capability_t *capa);

> >>>>> +

> >>>>> +/**

> >>>>>   * Create a timer pool

> >>>>>   *

> >>>>>   * The use of pool name is optional. Unique names are not required.

> >>>>> --

> >>>>> 1.9.1

> >>>>>

> >>>>

> >>>>

> >>>>

> >>>> --

> >>>> Mike Holmes

> >>>> Program Manager - Linaro Networking Group

> >>>> Linaro.org │ Open source software for ARM SoCs

> >>>> "Work should be fun and collaborative, the rest follows"

> >>>

> >>

> >

> >

> >

>

>



-- 
Thanks,
Kevin
diff mbox series

Patch

diff --git a/include/odp/api/spec/timer.h b/include/odp/api/spec/timer.h
index 75f9db9..78d9119 100644
--- a/include/odp/api/spec/timer.h
+++ b/include/odp/api/spec/timer.h
@@ -108,6 +108,27 @@  typedef struct {
 } odp_timer_pool_param_t;
 
 /**
+ * Timer capability
+ */
+typedef struct {
+	uint64_t res_ns; /**< Timeout resolution in nanoseconds */
+} odp_timer_capability_t;
+
+
+/**
+ * Query Timer interface capabilities
+ *
+ * Outputs Timer interface capabilities on success.
+ *
+ * @param clk_src Clock source for timers
+ * @param[out] capa   Pointer to capability structure for output
+ *
+ * @retval 0 on success
+ * @retval <0 on failure
+ */
+int odp_timer_capability(odp_timer_clk_src_t clk_src, odp_timer_capability_t *capa);
+
+/**
  * Create a timer pool
  *
  * The use of pool name is optional. Unique names are not required.