Skip to content

[PATCH v9] api: timer: refactor periodic timer expiration event configuration#2320

Merged
MatiasElo merged 2 commits intoOpenDataPlane:masterfrom
TuomasTaipale:dev/add_timer_last_ev_4
Mar 27, 2026
Merged

[PATCH v9] api: timer: refactor periodic timer expiration event configuration#2320
MatiasElo merged 2 commits intoOpenDataPlane:masterfrom
TuomasTaipale:dev/add_timer_last_ev_4

Conversation

@TuomasTaipale
Copy link
Copy Markdown
Collaborator

@TuomasTaipale TuomasTaipale commented Mar 3, 2026

Instead of configuring a single event to be sent for periodic timer expirations, application now configures a timeout pool to be created as part of timer pool creation. This enables more flexibility for implementations to control how they setup the periodic timer expiration signaling.

Additionally, periodic timers are now allocated with the new odp_timer_periodic_alloc() function the parameters of which now house a combination of parameters from odp_timer_alloc() and odp_timer_periodic_start_t. In particular the freq_multiplier is now part of timer allocation which implementation can utilize in calculating needed timeout events for a timer as well as an application provided callback that can be used to initialize the user areas of the to-be-allocated timeout events.

Lastly, periodic timer related function specifications clarified in places.

v2:

  • Comments addressed

v4:

  • Rebased
  • Fixed implementation and tests
  • Ready for review

v5:

  • Petri's comments

v6:

  • Shijith's comment
  • Added testing for the initialization callback during periodic timer allocation

v7:

  • Rebased
  • Matias' comments
  • New patch for odp_bench_timer

v8:

  • Rebased
  • Added review tags

@odpbuild odpbuild changed the title api: timer: refactor periodic timer expiration event configuration [PATCH v1] api: timer: refactor periodic timer expiration event configuration Mar 3, 2026
@TuomasTaipale TuomasTaipale force-pushed the dev/add_timer_last_ev_4 branch from 1b2976d to 2c0ed70 Compare March 5, 2026 13:12
@odpbuild odpbuild changed the title [PATCH v1] api: timer: refactor periodic timer expiration event configuration [PATCH v2] api: timer: refactor periodic timer expiration event configuration Mar 5, 2026
@MatiasElo MatiasElo added this to the v1.50.0 milestone Mar 12, 2026
@TuomasTaipale TuomasTaipale force-pushed the dev/add_timer_last_ev_4 branch from 2c0ed70 to 4b1aa83 Compare March 17, 2026 07:25
@odpbuild odpbuild changed the title [PATCH v2] api: timer: refactor periodic timer expiration event configuration [PATCH v3] api: timer: refactor periodic timer expiration event configuration Mar 17, 2026
@TuomasTaipale TuomasTaipale force-pushed the dev/add_timer_last_ev_4 branch from 4b1aa83 to e7d1225 Compare March 17, 2026 07:46
@odpbuild odpbuild changed the title [PATCH v3] api: timer: refactor periodic timer expiration event configuration [PATCH v4] api: timer: refactor periodic timer expiration event configuration Mar 17, 2026
@TuomasTaipale TuomasTaipale marked this pull request as ready for review March 17, 2026 08:15
@TuomasTaipale TuomasTaipale force-pushed the dev/add_timer_last_ev_4 branch from e7d1225 to 79a5476 Compare March 18, 2026 09:13
@odpbuild odpbuild changed the title [PATCH v4] api: timer: refactor periodic timer expiration event configuration [PATCH v5] api: timer: refactor periodic timer expiration event configuration Mar 18, 2026
Copy link
Copy Markdown
Collaborator

@psavol psavol left a comment

Choose a reason for hiding this comment

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

Reviewed API changes

@TuomasTaipale TuomasTaipale force-pushed the dev/add_timer_last_ev_4 branch from 79a5476 to abb58ec Compare March 23, 2026 14:59
@odpbuild odpbuild changed the title [PATCH v5] api: timer: refactor periodic timer expiration event configuration [PATCH v6] api: timer: refactor periodic timer expiration event configuration Mar 23, 2026
@MatiasElo MatiasElo added the API spec OK API specification is ready. Needs implementation and test updates. label Mar 24, 2026
Copy link
Copy Markdown
Collaborator

@MatiasElo MatiasElo left a comment

Choose a reason for hiding this comment

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

Checked API and implementation.

typedef struct {
/** Destination queue
*
* When timer expires, a ODP_EVENT_TIMEOUT event is sent to this queue. The event is from
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Typo: an ODP_EVENT_TIMEOUT

Copy link
Copy Markdown
Collaborator

@MatiasElo MatiasElo left a comment

Choose a reason for hiding this comment

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

All changes checked.

@TuomasTaipale TuomasTaipale force-pushed the dev/add_timer_last_ev_4 branch from abb58ec to 31f99bd Compare March 26, 2026 07:44
@odpbuild odpbuild changed the title [PATCH v6] api: timer: refactor periodic timer expiration event configuration [PATCH v7] api: timer: refactor periodic timer expiration event configuration Mar 26, 2026
Copy link
Copy Markdown
Collaborator

@MatiasElo MatiasElo left a comment

Choose a reason for hiding this comment

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

Couple a ODP_EVENT_TIMEOUT typos still, but otherwise looks good.

@TuomasTaipale TuomasTaipale force-pushed the dev/add_timer_last_ev_4 branch from 31f99bd to b1cfd63 Compare March 27, 2026 09:39
@odpbuild odpbuild changed the title [PATCH v7] api: timer: refactor periodic timer expiration event configuration [PATCH v8] api: timer: refactor periodic timer expiration event configuration Mar 27, 2026
@MatiasElo MatiasElo added API Ready API change ready to be merged (with the next API version increment) and removed API spec OK API specification is ready. Needs implementation and test updates. labels Mar 27, 2026
Instead of configuring a single event to be sent for periodic timer
expirations, application now configures a timeout pool to be created as
part of timer pool creation. This enables more flexibility for
implementations to control how they setup the periodic timer expiration
signaling.

Additionally, periodic timers are now allocated with the new
`odp_timer_periodic_alloc()` function the parameters of which now
house a combination of parameters from `odp_timer_alloc()` and
`odp_timer_periodic_start_t`. In particular the `freq_multiplier`
is now part of timer allocation which implementation can utilize
in calculating needed timeout events for a timer as well as an
application provided callback that can be used to initialize the
user areas of the to-be-allocated timeout events.

Lastly, periodic timer related function specifications clarified
in places.

Signed-off-by: Tuomas Taipale <tuomas.taipale@nokia.com>
Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
Reviewed-by: Matias Elo <matias.elo@nokia.com>
Reviewed-by: Shijith Thotton <sthotton@marvell.com>
Add tests for `odp_timeout_is_periodic()`.

Signed-off-by: Tuomas Taipale <tuomas.taipale@nokia.com>
Reviewed-by: Matias Elo <matias.elo@nokia.com>
@MatiasElo MatiasElo force-pushed the dev/add_timer_last_ev_4 branch from b1cfd63 to c210f6c Compare March 27, 2026 10:11
@odpbuild odpbuild changed the title [PATCH v8] api: timer: refactor periodic timer expiration event configuration [PATCH v9] api: timer: refactor periodic timer expiration event configuration Mar 27, 2026
@MatiasElo MatiasElo enabled auto-merge (rebase) March 27, 2026 10:11
@MatiasElo MatiasElo merged commit 1ab0b9e into OpenDataPlane:master Mar 27, 2026
346 of 348 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

API Ready API change ready to be merged (with the next API version increment)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants