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) 200 struct rte_event_timer_adapter;
207 uint8_t *event_port_id,
246 struct rte_event_timer_adapter *
273 struct rte_event_timer_adapter *
317 const struct rte_event_timer_adapter *adapter,
346 const struct rte_event_timer_adapter *adapter);
381 struct rte_event_timer_adapter *
422 uint32_t *service_id);
511 typedef uint16_t (*rte_event_timer_arm_burst_t)(
512 const struct rte_event_timer_adapter *adapter,
516 typedef uint16_t (*rte_event_timer_arm_tmo_tick_burst_t)(
517 const struct rte_event_timer_adapter *adapter,
519 uint64_t timeout_tick,
522 typedef uint16_t (*rte_event_timer_cancel_burst_t)(
523 const struct rte_event_timer_adapter *adapter,
531 struct rte_event_timer_adapter {
532 rte_event_timer_arm_burst_t arm_burst;
534 rte_event_timer_arm_tmo_tick_burst_t arm_tmo_tick_burst;
536 rte_event_timer_cancel_burst_t cancel_burst;
538 struct rte_event_timer_adapter_data *data;
540 const struct event_timer_adapter_ops *ops;
544 uint8_t allocated : 1;
548 #define ADAPTER_VALID_OR_ERR_RET(adapter, retval) do { \ 549 if (adapter == NULL || !adapter->allocated) \ 553 #define FUNC_PTR_OR_ERR_RET(func, errval) do { \ 554 if ((func) == NULL) \ 558 #define FUNC_PTR_OR_NULL_RET_WITH_ERRNO(func, errval) do { \ 559 if ((func) == NULL) { \ 560 rte_errno = errval; \ 601 static inline uint16_t
606 #ifdef RTE_LIBRTE_EVENTDEV_DEBUG 607 ADAPTER_VALID_OR_ERR_RET(adapter, -EINVAL);
608 FUNC_PTR_OR_ERR_RET(adapter->arm_burst, -EINVAL);
610 rte_eventdev_trace_timer_arm_burst(adapter, (
void **)evtims,
612 return adapter->arm_burst(adapter, evtims, nb_evtims);
644 static inline uint16_t
646 const struct rte_event_timer_adapter *adapter,
648 const uint64_t timeout_ticks,
649 const uint16_t nb_evtims)
651 #ifdef RTE_LIBRTE_EVENTDEV_DEBUG 652 ADAPTER_VALID_OR_ERR_RET(adapter, -EINVAL);
653 FUNC_PTR_OR_ERR_RET(adapter->arm_tmo_tick_burst, -EINVAL);
655 rte_eventdev_trace_timer_arm_tmo_tick_burst(adapter, timeout_ticks,
656 (
void **)evtims, nb_evtims);
657 return adapter->arm_tmo_tick_burst(adapter, evtims, timeout_ticks,
681 static inline uint16_t
686 #ifdef RTE_LIBRTE_EVENTDEV_DEBUG 687 ADAPTER_VALID_OR_ERR_RET(adapter, -EINVAL);
688 FUNC_PTR_OR_ERR_RET(adapter->cancel_burst, -EINVAL);
690 rte_eventdev_trace_timer_cancel_burst(adapter, (
void **)evtims,
692 return adapter->cancel_burst(adapter, evtims, nb_evtims);
718 const struct rte_event_timer_adapter *adapter,
720 uint64_t *ticks_remaining);
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)
__rte_experimental int rte_event_timer_remaining_ticks_get(const struct rte_event_timer_adapter *adapter, const struct rte_event_timer *evtim, uint64_t *ticks_remaining)
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 * 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_drop_count
#define __rte_cache_aligned
uint64_t evtim_retry_count
rte_event_timer_adapter_clk_src
enum rte_event_timer_adapter_clk_src clk_src
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)