[PATCH v6] api: timer: support period setting directly with frequency#2323
[PATCH v6] api: timer: support period setting directly with frequency#2323TuomasTaipale wants to merge 3 commits intoOpenDataPlane:masterfrom
Conversation
0cd8102 to
eabd867
Compare
eabd867 to
4dd48d2
Compare
4dd48d2 to
a9b6979
Compare
a9b6979 to
c1a881d
Compare
|
Hi @TuomasTaipale , Instead of adding ODP_TIMER_TYPE_PERIODIC_2, could the period configuration method be a separate mode field inside the periodic sub-struct? as there is really only one periodic timer concept. typedef enum { The mode would sit next to the union it discriminates. This would also avoid needing to recall a type_1 -> PERIODIC, type_2 -> PERIODIC_2 mapping. |
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>
Add tests for `odp_timeout_is_periodic()`. Signed-off-by: Tuomas Taipale <tuomas.taipale@nokia.com>
Add alternative method for configuring periodic timer frequency for timer pools and timers. The new method introduces a new periodic timer type `ODP_TIMER_TYPE_PERIODIC_FREQ` to be used with periodic timer capability checks and timer pool creation. Old periodic timer type `ODP_TIMER_TYPE_PERIODIC` is renamed to `ODP_TIMER_TYPE_PERIODIC_BASE_MUL` to better reflect the differences between these two types. Capability checks and timer pool configuration is based on a list of constraining periodic timer frequencies that are used to dimension the underlying timer pool resources. Subsequently, timers from the new type of timer pools can be started directly with a wanted timer frequency. Signed-off-by: Tuomas Taipale <tuomas.taipale@nokia.com>
c1a881d to
af6f323
Compare
@shijith Thanks for checking. Initially we had this two-level structure for the new periodic types but decided not to go with that as it would be perhaps a bit cumbersome/error-prone for application. Using the existing In v6, swapped the |
On top of #2320
v5:
v6: