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;
197 uint8_t event_dev_id,
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);
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);