aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatias Elo <matias.elo@nokia.com>2023-10-26 08:44:24 +0300
committerMatias Elo <matias.elo@nokia.com>2023-11-06 08:55:30 +0200
commit543fae4081050144dd1581d72ed1ebd8b9348e4b (patch)
tree22e6c5cf80d6d8917f0014f01977fcd6fe04a654
parent5a741e7bce5962a6044a7ce086b1f9f2b9988ab7 (diff)
Port 189f0258d "linux-gen: timer: implement odp_timeout_alloc_multi() function"
Port original commit from linux-generic. Signed-off-by: Matias Elo <matias.elo@nokia.com> Reviewed-by: Jere Leppänen <jere.leppanen@nokia.com>
-rw-r--r--platform/linux-dpdk/odp_timer.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/platform/linux-dpdk/odp_timer.c b/platform/linux-dpdk/odp_timer.c
index 4056018ae..4e7900093 100644
--- a/platform/linux-dpdk/odp_timer.c
+++ b/platform/linux-dpdk/odp_timer.c
@@ -1335,6 +1335,27 @@ odp_timeout_t odp_timeout_alloc(odp_pool_t pool_hdl)
return odp_timeout_from_event(event);
}
+int odp_timeout_alloc_multi(odp_pool_t pool_hdl, odp_timeout_t tmo[], int num)
+{
+ pool_t *pool;
+ int ret;
+
+ _ODP_ASSERT(pool_hdl != ODP_POOL_INVALID);
+ _ODP_ASSERT(tmo != NULL);
+ _ODP_ASSERT(num > 0);
+
+ pool = _odp_pool_entry(pool_hdl);
+
+ _ODP_ASSERT(pool->type == ODP_POOL_TIMEOUT);
+
+ ret = _odp_event_alloc_multi(pool, (_odp_event_hdr_t **)tmo, num);
+
+ for (int i = 0; i < ret; i++)
+ timeout_to_hdr(tmo[i])->timer = ODP_TIMER_INVALID;
+
+ return ret;
+}
+
void odp_timeout_free(odp_timeout_t tmo)
{
_odp_event_free(odp_timeout_to_event(tmo));