7#ifndef __RTE_EVENT_TIMER_ADAPTER_H__
8#define __RTE_EVENT_TIMER_ADAPTER_H__
134#define RTE_EVENT_TIMER_ADAPTER_F_ADJUST_RES (1ULL << 0)
146#define RTE_EVENT_TIMER_ADAPTER_F_SP_PUT (1ULL << 1)
152#define RTE_EVENT_TIMER_ADAPTER_F_PERIODIC (1ULL << 2)
200struct rte_event_timer_adapter;
206 uint8_t event_dev_id,
207 uint8_t *event_port_id,
232struct rte_event_timer_adapter *
259struct rte_event_timer_adapter *
303 const struct rte_event_timer_adapter *adapter,
332 const struct rte_event_timer_adapter *adapter);
367struct rte_event_timer_adapter *
408 uint32_t *service_id);
497typedef uint16_t (*rte_event_timer_arm_burst_t)(
498 const struct rte_event_timer_adapter *adapter,
502typedef uint16_t (*rte_event_timer_arm_tmo_tick_burst_t)(
503 const struct rte_event_timer_adapter *adapter,
505 uint64_t timeout_tick,
508typedef uint16_t (*rte_event_timer_cancel_burst_t)(
509 const struct rte_event_timer_adapter *adapter,
517struct rte_event_timer_adapter {
518 rte_event_timer_arm_burst_t arm_burst;
520 rte_event_timer_arm_tmo_tick_burst_t arm_tmo_tick_burst;
522 rte_event_timer_cancel_burst_t cancel_burst;
524 struct rte_event_timer_adapter_data *data;
526 const struct event_timer_adapter_ops *ops;
530 uint8_t allocated : 1;
534#define ADAPTER_VALID_OR_ERR_RET(adapter, retval) do { \
535 if (adapter == NULL || !adapter->allocated) \
539#define FUNC_PTR_OR_ERR_RET(func, errval) do { \
540 if ((func) == NULL) \
544#define FUNC_PTR_OR_NULL_RET_WITH_ERRNO(func, errval) do { \
545 if ((func) == NULL) { \
546 rte_errno = errval; \
587static inline uint16_t
592#ifdef RTE_LIBRTE_EVENTDEV_DEBUG
593 ADAPTER_VALID_OR_ERR_RET(adapter, -EINVAL);
594 FUNC_PTR_OR_ERR_RET(adapter->arm_burst, -EINVAL);
596 rte_eventdev_trace_timer_arm_burst(adapter, (
void **)evtims,
598 return adapter->arm_burst(adapter, evtims, nb_evtims);
630static inline uint16_t
632 const struct rte_event_timer_adapter *adapter,
634 const uint64_t timeout_ticks,
635 const uint16_t nb_evtims)
637#ifdef RTE_LIBRTE_EVENTDEV_DEBUG
638 ADAPTER_VALID_OR_ERR_RET(adapter, -EINVAL);
639 FUNC_PTR_OR_ERR_RET(adapter->arm_tmo_tick_burst, -EINVAL);
641 rte_eventdev_trace_timer_arm_tmo_tick_burst(adapter, timeout_ticks,
642 (
void **)evtims, nb_evtims);
643 return adapter->arm_tmo_tick_burst(adapter, evtims, timeout_ticks,
667static inline uint16_t
672#ifdef RTE_LIBRTE_EVENTDEV_DEBUG
673 ADAPTER_VALID_OR_ERR_RET(adapter, -EINVAL);
674 FUNC_PTR_OR_ERR_RET(adapter->cancel_burst, -EINVAL);
676 rte_eventdev_trace_timer_cancel_burst(adapter, (
void **)evtims,
678 return adapter->cancel_burst(adapter, evtims, nb_evtims);
#define __rte_cache_aligned
int rte_event_timer_adapter_stats_reset(struct rte_event_timer_adapter *adapter)
int rte_event_timer_adapter_service_id_get(struct rte_event_timer_adapter *adapter, uint32_t *service_id)
@ RTE_EVENT_TIMER_ERROR_TOOEARLY
@ RTE_EVENT_TIMER_CANCELED
@ RTE_EVENT_TIMER_NOT_ARMED
@ RTE_EVENT_TIMER_ERROR_TOOLATE
int rte_event_timer_adapter_stop(const struct rte_event_timer_adapter *adapter)
int(* rte_event_timer_adapter_port_conf_cb_t)(uint16_t id, uint8_t event_dev_id, uint8_t *event_port_id, void *conf_arg)
static uint16_t rte_event_timer_cancel_burst(const struct rte_event_timer_adapter *adapter, struct rte_event_timer **evtims, uint16_t nb_evtims)
static uint16_t rte_event_timer_arm_burst(const struct rte_event_timer_adapter *adapter, struct rte_event_timer **evtims, uint16_t nb_evtims)
int rte_event_timer_adapter_free(struct rte_event_timer_adapter *adapter)
struct rte_event_timer_adapter * rte_event_timer_adapter_create(const struct rte_event_timer_adapter_conf *conf)
struct rte_event_timer_adapter * rte_event_timer_adapter_lookup(uint16_t adapter_id)
rte_event_timer_adapter_clk_src
@ RTE_EVENT_TIMER_ADAPTER_EXT_CLK1
@ RTE_EVENT_TIMER_ADAPTER_CPU_CLK
@ RTE_EVENT_TIMER_ADAPTER_EXT_CLK2
@ RTE_EVENT_TIMER_ADAPTER_EXT_CLK3
@ RTE_EVENT_TIMER_ADAPTER_EXT_CLK0
int rte_event_timer_adapter_stats_get(struct rte_event_timer_adapter *adapter, struct rte_event_timer_adapter_stats *stats)
int rte_event_timer_adapter_start(const struct rte_event_timer_adapter *adapter)
struct rte_event_timer_adapter * rte_event_timer_adapter_create_ext(const struct rte_event_timer_adapter_conf *conf, rte_event_timer_adapter_port_conf_cb_t conf_cb, void *conf_arg)
static uint16_t rte_event_timer_arm_tmo_tick_burst(const struct rte_event_timer_adapter *adapter, struct rte_event_timer **evtims, const uint64_t timeout_ticks, const uint16_t nb_evtims)
int rte_event_timer_adapter_get_info(const struct rte_event_timer_adapter *adapter, struct rte_event_timer_adapter_info *adapter_info)
uint16_t timer_adapter_id
enum rte_event_timer_adapter_clk_src clk_src
uint64_t min_resolution_ns
struct rte_event_timer_adapter_conf conf
int16_t event_dev_port_id
uint64_t evtim_retry_count
uint64_t evtim_drop_count
uint64_t adapter_tick_count
enum rte_event_timer_state state