aboutsummaryrefslogtreecommitdiff
path: root/platform/linux-dpdk/include/odp/api
diff options
context:
space:
mode:
authorMatias Elo <matias.elo@nokia.com>2024-01-05 12:40:58 +0200
committerMatias Elo <matias.elo@nokia.com>2024-01-29 12:53:15 +0200
commit016946a13c33899b075d31e97169857c04c83614 (patch)
tree9be3157de0b2e67cc9660c142ec606de950a35ec /platform/linux-dpdk/include/odp/api
parent052d246a58081cf3cca9231dce162edec42f4d76 (diff)
Port 063e2f067 "linux-gen: timer: inline odp_timer_current_tick()"
Port original commit from linux-generic. Signed-off-by: Matias Elo <matias.elo@nokia.com> Reviewed-by: Tuomas Taipale <tuomas.taipale@nokia.com>
Diffstat (limited to 'platform/linux-dpdk/include/odp/api')
-rw-r--r--platform/linux-dpdk/include/odp/api/plat/timer_inlines.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/platform/linux-dpdk/include/odp/api/plat/timer_inlines.h b/platform/linux-dpdk/include/odp/api/plat/timer_inlines.h
index 66327acdb..d9403bb0e 100644
--- a/platform/linux-dpdk/include/odp/api/plat/timer_inlines.h
+++ b/platform/linux-dpdk/include/odp/api/plat/timer_inlines.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2022-2023, Nokia
+/* Copyright (c) 2022-2024, Nokia
* All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
@@ -8,11 +8,15 @@
#define ODP_PLAT_TIMER_INLINES_H_
#include <odp/api/event.h>
+#include <odp/api/hints.h>
#include <odp/api/timer_types.h>
#include <odp/api/plat/debug_inlines.h>
#include <odp/api/plat/timer_inline_types.h>
+#include <rte_config.h>
+#include <rte_cycles.h>
+
#include <stdint.h>
/** @cond _ODP_HIDE_FROM_DOXYGEN_ */
@@ -24,6 +28,7 @@
#define odp_timeout_tick __odp_timeout_tick
#define odp_timeout_user_ptr __odp_timeout_user_ptr
#define odp_timeout_user_area __odp_timeout_user_area
+ #define odp_timer_current_tick __odp_timer_current_tick
#define odp_timeout_from_event __odp_timeout_from_event
#define odp_timeout_from_event_multi __odp_timeout_from_event_multi
#define odp_timeout_to_event __odp_timeout_to_event
@@ -51,6 +56,11 @@ _ODP_INLINE void *odp_timeout_user_area(odp_timeout_t tmo)
return _odp_timeout_hdr_field(tmo, void *, uarea_addr);
}
+_ODP_INLINE uint64_t odp_timer_current_tick(odp_timer_pool_t tp ODP_UNUSED)
+{
+ return rte_get_timer_cycles();
+}
+
_ODP_INLINE odp_timeout_t odp_timeout_from_event(odp_event_t ev)
{
_ODP_ASSERT(odp_event_type(ev) == ODP_EVENT_TIMEOUT);