Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PATCH v3] timer: tick does not need to start from zero #1968

Merged
merged 4 commits into from
Dec 12, 2023

Conversation

psavol
Copy link
Collaborator

@psavol psavol commented Dec 8, 2023

Optimize timer current tick and other functions by using nsec time directly as the tick. API does not require tick to start from zero.

@odpbuild odpbuild changed the title timer: tick does not need to start from zero [PATCH v1] timer: tick does not need to start from zero Dec 8, 2023
@odpbuild odpbuild changed the title [PATCH v1] timer: tick does not need to start from zero [PATCH v2] timer: tick does not need to start from zero Dec 11, 2023
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copyright can be updated.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in v3

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copyright can be updated.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in v3

@@ -1471,16 +1453,15 @@ void odp_timer_pool_destroy(odp_timer_pool_t tpid)

uint64_t odp_timer_current_tick(odp_timer_pool_t tpid)
{
timer_pool_t *tp = timer_pool_from_hdl(tpid);
(void)tpid;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ODP_UNUSED would save one line.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cast to void is used with other inline functions. This function moves into inline header in the next patch.

Check that ticks and converted nanosecond value will not wrap in
10 years.

Signed-off-by: Petri Savolainen <petri.savolainen@nokia.com>
Reviewed-by: Matias Elo <matias.elo@nokia.com>
Measure and report timer start cycles in expire and start mode
(-m 2).

Signed-off-by: Petri Savolainen <petri.savolainen@nokia.com>
Reviewed-by: Matias Elo <matias.elo@nokia.com>
API does not require tick to start from zero. Optimize timer
implementation by removing per timer pool start time subtraction.

Signed-off-by: Petri Savolainen <petri.savolainen@nokia.com>
Reviewed-by: Matias Elo <matias.elo@nokia.com>
Inline current tick function as it does not depend on timer
pool structure any more.

Signed-off-by: Petri Savolainen <petri.savolainen@nokia.com>
Reviewed-by: Matias Elo <matias.elo@nokia.com>
@odpbuild odpbuild changed the title [PATCH v2] timer: tick does not need to start from zero [PATCH v3] timer: tick does not need to start from zero Dec 11, 2023
@psavol psavol merged commit 063e2f0 into OpenDataPlane:master Dec 12, 2023
167 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants