7 #ifndef __RTE_EVENT_TIMER_ADAPTER_H__
8 #define __RTE_EVENT_TIMER_ADAPTER_H__
138 #define RTE_EVENT_TIMER_ADAPTER_F_ADJUST_RES (1ULL << 0)
150 #define RTE_EVENT_TIMER_ADAPTER_F_SP_PUT (1ULL << 1)
200 struct rte_event_timer_adapter;
209 uint8_t event_dev_id,
210 uint8_t *event_port_id,
238 struct rte_event_timer_adapter * __rte_experimental
268 struct rte_event_timer_adapter * __rte_experimental
316 int __rte_experimental
318 const struct rte_event_timer_adapter *adapter,
343 int __rte_experimental
345 const struct rte_event_timer_adapter *adapter);
364 int __rte_experimental
386 struct rte_event_timer_adapter * __rte_experimental
410 int __rte_experimental
428 int __rte_experimental
430 uint32_t *service_id);
447 int __rte_experimental
464 int __rte_experimental
531 typedef uint16_t (*rte_event_timer_arm_burst_t)(
532 const struct rte_event_timer_adapter *adapter,
536 typedef uint16_t (*rte_event_timer_arm_tmo_tick_burst_t)(
537 const struct rte_event_timer_adapter *adapter,
539 uint64_t timeout_tick,
542 typedef uint16_t (*rte_event_timer_cancel_burst_t)(
543 const struct rte_event_timer_adapter *adapter,
551 struct rte_event_timer_adapter {
552 rte_event_timer_arm_burst_t arm_burst;
554 rte_event_timer_arm_tmo_tick_burst_t arm_tmo_tick_burst;
556 rte_event_timer_cancel_burst_t cancel_burst;
558 struct rte_event_timer_adapter_data *data;
560 const struct rte_event_timer_adapter_ops *ops;
564 uint8_t allocated : 1;
568 #define ADAPTER_VALID_OR_ERR_RET(adapter, retval) do { \
569 if (adapter == NULL || !adapter->allocated) \
573 #define FUNC_PTR_OR_ERR_RET(func, errval) do { \
574 if ((func) == NULL) \
578 #define FUNC_PTR_OR_NULL_RET_WITH_ERRNO(func, errval) do { \
579 if ((func) == NULL) { \
580 rte_errno = errval; \
619 static inline uint16_t __rte_experimental
624 #ifdef RTE_LIBRTE_EVENTDEV_DEBUG
625 ADAPTER_VALID_OR_ERR_RET(adapter, -EINVAL);
626 FUNC_PTR_OR_ERR_RET(adapter->arm_burst, -EINVAL);
628 return adapter->arm_burst(adapter, evtims, nb_evtims);
663 static inline uint16_t __rte_experimental
665 const struct rte_event_timer_adapter *adapter,
667 const uint64_t timeout_ticks,
668 const uint16_t nb_evtims)
670 #ifdef RTE_LIBRTE_EVENTDEV_DEBUG
671 ADAPTER_VALID_OR_ERR_RET(adapter, -EINVAL);
672 FUNC_PTR_OR_ERR_RET(adapter->arm_tmo_tick_burst, -EINVAL);
674 return adapter->arm_tmo_tick_burst(adapter, evtims, timeout_ticks,
701 static inline uint16_t __rte_experimental
706 #ifdef RTE_LIBRTE_EVENTDEV_DEBUG
707 ADAPTER_VALID_OR_ERR_RET(adapter, -EINVAL);
708 FUNC_PTR_OR_ERR_RET(adapter->cancel_burst, -EINVAL);
710 return adapter->cancel_burst(adapter, evtims, nb_evtims);
int __rte_experimental rte_event_timer_adapter_free(struct rte_event_timer_adapter *adapter)
int __rte_experimental rte_event_timer_adapter_stop(const struct rte_event_timer_adapter *adapter)
static uint16_t __rte_experimental rte_event_timer_arm_burst(const struct rte_event_timer_adapter *adapter, struct rte_event_timer **evtims, uint16_t nb_evtims)
int __rte_experimental rte_event_timer_adapter_start(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)
uint64_t min_resolution_ns
struct rte_event_timer_adapter *__rte_experimental rte_event_timer_adapter_lookup(uint16_t adapter_id)
int __rte_experimental rte_event_timer_adapter_get_info(const struct rte_event_timer_adapter *adapter, struct rte_event_timer_adapter_info *adapter_info)
uint64_t adapter_tick_count
struct rte_event_timer_adapter_conf conf
struct rte_event_timer_adapter *__rte_experimental 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)
int __rte_experimental rte_event_timer_adapter_stats_get(struct rte_event_timer_adapter *adapter, struct rte_event_timer_adapter_stats *stats)
struct rte_event_timer_adapter *__rte_experimental rte_event_timer_adapter_create(const struct rte_event_timer_adapter_conf *conf)
int __rte_experimental rte_event_timer_adapter_stats_reset(struct rte_event_timer_adapter *adapter)
uint64_t evtim_retry_count
rte_event_timer_adapter_clk_src
enum rte_event_timer_adapter_clk_src clk_src
enum rte_event_timer_state state
#define __rte_cache_aligned
static uint16_t __rte_experimental rte_event_timer_cancel_burst(const struct rte_event_timer_adapter *adapter, struct rte_event_timer **evtims, uint16_t nb_evtims)
int16_t event_dev_port_id
uint16_t timer_adapter_id
static uint16_t __rte_experimental 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_experimental rte_event_timer_adapter_service_id_get(struct rte_event_timer_adapter *adapter, uint32_t *service_id)