7 #ifndef __RTE_EVENT_TIMER_ADAPTER_H__
8 #define __RTE_EVENT_TIMER_ADAPTER_H__
136 #define RTE_EVENT_TIMER_ADAPTER_F_ADJUST_RES (1ULL << 0)
148 #define RTE_EVENT_TIMER_ADAPTER_F_SP_PUT (1ULL << 1)
192 struct rte_event_timer_adapter;
198 uint8_t event_dev_id,
199 uint8_t *event_port_id,
224 struct rte_event_timer_adapter *
251 struct rte_event_timer_adapter *
295 const struct rte_event_timer_adapter *adapter,
324 const struct rte_event_timer_adapter *adapter);
359 struct rte_event_timer_adapter *
400 uint32_t *service_id);
489 typedef uint16_t (*rte_event_timer_arm_burst_t)(
490 const struct rte_event_timer_adapter *adapter,
494 typedef uint16_t (*rte_event_timer_arm_tmo_tick_burst_t)(
495 const struct rte_event_timer_adapter *adapter,
497 uint64_t timeout_tick,
500 typedef uint16_t (*rte_event_timer_cancel_burst_t)(
501 const struct rte_event_timer_adapter *adapter,
509 struct rte_event_timer_adapter {
510 rte_event_timer_arm_burst_t arm_burst;
512 rte_event_timer_arm_tmo_tick_burst_t arm_tmo_tick_burst;
514 rte_event_timer_cancel_burst_t cancel_burst;
516 struct rte_event_timer_adapter_data *data;
518 const struct rte_event_timer_adapter_ops *ops;
522 uint8_t allocated : 1;
526 #define ADAPTER_VALID_OR_ERR_RET(adapter, retval) do { \
527 if (adapter == NULL || !adapter->allocated) \
531 #define FUNC_PTR_OR_ERR_RET(func, errval) do { \
532 if ((func) == NULL) \
536 #define FUNC_PTR_OR_NULL_RET_WITH_ERRNO(func, errval) do { \
537 if ((func) == NULL) { \
538 rte_errno = errval; \
574 static inline uint16_t
579 #ifdef RTE_LIBRTE_EVENTDEV_DEBUG
580 ADAPTER_VALID_OR_ERR_RET(adapter, -EINVAL);
581 FUNC_PTR_OR_ERR_RET(adapter->arm_burst, -EINVAL);
583 rte_eventdev_trace_timer_arm_burst(adapter, (
void **)evtims,
585 return adapter->arm_burst(adapter, evtims, nb_evtims);
617 static inline uint16_t
619 const struct rte_event_timer_adapter *adapter,
621 const uint64_t timeout_ticks,
622 const uint16_t nb_evtims)
624 #ifdef RTE_LIBRTE_EVENTDEV_DEBUG
625 ADAPTER_VALID_OR_ERR_RET(adapter, -EINVAL);
626 FUNC_PTR_OR_ERR_RET(adapter->arm_tmo_tick_burst, -EINVAL);
628 rte_eventdev_trace_timer_arm_tmo_tick_burst(adapter, timeout_ticks,
629 (
void **)evtims, nb_evtims);
630 return adapter->arm_tmo_tick_burst(adapter, evtims, timeout_ticks,
654 static inline uint16_t
659 #ifdef RTE_LIBRTE_EVENTDEV_DEBUG
660 ADAPTER_VALID_OR_ERR_RET(adapter, -EINVAL);
661 FUNC_PTR_OR_ERR_RET(adapter->cancel_burst, -EINVAL);
663 rte_eventdev_trace_timer_cancel_burst(adapter, (
void **)evtims,
665 return adapter->cancel_burst(adapter, evtims, nb_evtims);
struct rte_event_timer_adapter * rte_event_timer_adapter_create(const struct rte_event_timer_adapter_conf *conf)
int rte_event_timer_adapter_service_id_get(struct rte_event_timer_adapter *adapter, uint32_t *service_id)
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)
struct rte_event_timer_adapter * rte_event_timer_adapter_lookup(uint16_t adapter_id)
int rte_event_timer_adapter_start(const struct rte_event_timer_adapter *adapter)
int rte_event_timer_adapter_stats_reset(struct rte_event_timer_adapter *adapter)
int rte_event_timer_adapter_stats_get(struct rte_event_timer_adapter *adapter, struct rte_event_timer_adapter_stats *stats)
static uint16_t rte_event_timer_arm_burst(const struct rte_event_timer_adapter *adapter, struct rte_event_timer **evtims, uint16_t nb_evtims)
uint64_t min_resolution_ns
int rte_event_timer_adapter_free(struct rte_event_timer_adapter *adapter)
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)
uint64_t adapter_tick_count
struct rte_event_timer_adapter_conf conf
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)
uint64_t evtim_retry_count
rte_event_timer_adapter_clk_src
#define __rte_cache_aligned
enum rte_event_timer_adapter_clk_src clk_src
enum rte_event_timer_state state
static uint16_t rte_event_timer_cancel_burst(const struct rte_event_timer_adapter *adapter, struct rte_event_timer **evtims, uint16_t nb_evtims)
int rte_event_timer_adapter_stop(const struct rte_event_timer_adapter *adapter)
int16_t event_dev_port_id
uint16_t timer_adapter_id
int rte_event_timer_adapter_get_info(const struct rte_event_timer_adapter *adapter, struct rte_event_timer_adapter_info *adapter_info)