7 #ifndef __RTE_EVENT_TIMER_ADAPTER_H__ 8 #define __RTE_EVENT_TIMER_ADAPTER_H__ 135 #define RTE_EVENT_TIMER_ADAPTER_F_ADJUST_RES (1ULL << 0) 147 #define RTE_EVENT_TIMER_ADAPTER_F_SP_PUT (1ULL << 1) 191 struct rte_event_timer_adapter;
198 uint8_t *event_port_id,
223 struct rte_event_timer_adapter *
250 struct rte_event_timer_adapter *
294 const struct rte_event_timer_adapter *adapter,
323 const struct rte_event_timer_adapter *adapter);
358 struct rte_event_timer_adapter *
399 uint32_t *service_id);
482 uint8_t user_meta[0];
488 typedef uint16_t (*rte_event_timer_arm_burst_t)(
489 const struct rte_event_timer_adapter *adapter,
493 typedef uint16_t (*rte_event_timer_arm_tmo_tick_burst_t)(
494 const struct rte_event_timer_adapter *adapter,
496 uint64_t timeout_tick,
499 typedef uint16_t (*rte_event_timer_cancel_burst_t)(
500 const struct rte_event_timer_adapter *adapter,
508 struct rte_event_timer_adapter {
509 rte_event_timer_arm_burst_t arm_burst;
511 rte_event_timer_arm_tmo_tick_burst_t arm_tmo_tick_burst;
513 rte_event_timer_cancel_burst_t cancel_burst;
515 struct rte_event_timer_adapter_data *data;
517 const struct rte_event_timer_adapter_ops *ops;
521 uint8_t allocated : 1;
525 #define ADAPTER_VALID_OR_ERR_RET(adapter, retval) do { \ 526 if (adapter == NULL || !adapter->allocated) \ 530 #define FUNC_PTR_OR_ERR_RET(func, errval) do { \ 531 if ((func) == NULL) \ 535 #define FUNC_PTR_OR_NULL_RET_WITH_ERRNO(func, errval) do { \ 536 if ((func) == NULL) { \ 537 rte_errno = errval; \ 573 static inline uint16_t
578 #ifdef RTE_LIBRTE_EVENTDEV_DEBUG 579 ADAPTER_VALID_OR_ERR_RET(adapter, -EINVAL);
580 FUNC_PTR_OR_ERR_RET(adapter->arm_burst, -EINVAL);
582 return adapter->arm_burst(adapter, evtims, nb_evtims);
614 static inline uint16_t
616 const struct rte_event_timer_adapter *adapter,
618 const uint64_t timeout_ticks,
619 const uint16_t nb_evtims)
621 #ifdef RTE_LIBRTE_EVENTDEV_DEBUG 622 ADAPTER_VALID_OR_ERR_RET(adapter, -EINVAL);
623 FUNC_PTR_OR_ERR_RET(adapter->arm_tmo_tick_burst, -EINVAL);
625 return adapter->arm_tmo_tick_burst(adapter, evtims, timeout_ticks,
649 static inline uint16_t
654 #ifdef RTE_LIBRTE_EVENTDEV_DEBUG 655 ADAPTER_VALID_OR_ERR_RET(adapter, -EINVAL);
656 FUNC_PTR_OR_ERR_RET(adapter->cancel_burst, -EINVAL);
658 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 * 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
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)