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);