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
465 struct rte_event_timer_adapter *adapter);
484 uint32_t *service_id);
518 struct rte_event_timer_adapter *adapter);
584 typedef uint16_t (*rte_event_timer_arm_burst_t)(
585 const struct rte_event_timer_adapter *adapter,
589 typedef uint16_t (*rte_event_timer_arm_tmo_tick_burst_t)(
590 const struct rte_event_timer_adapter *adapter,
592 uint64_t timeout_tick,
595 typedef uint16_t (*rte_event_timer_cancel_burst_t)(
596 const struct rte_event_timer_adapter *adapter,
604 struct rte_event_timer_adapter {
605 rte_event_timer_arm_burst_t arm_burst;
607 rte_event_timer_arm_tmo_tick_burst_t arm_tmo_tick_burst;
609 rte_event_timer_cancel_burst_t cancel_burst;
611 struct rte_event_timer_adapter_data *data;
613 const struct rte_event_timer_adapter_ops *ops;
617 uint8_t allocated : 1;
621 #define ADAPTER_VALID_OR_ERR_RET(adapter, retval) do { \
622 if (adapter == NULL || !adapter->allocated) \
626 #define FUNC_PTR_OR_ERR_RET(func, errval) do { \
627 if ((func) == NULL) \
631 #define FUNC_PTR_OR_NULL_RET_WITH_ERRNO(func, errval) do { \
632 if ((func) == NULL) { \
633 rte_errno = errval; \
672 static inline uint16_t __rte_experimental
677 #ifdef RTE_LIBRTE_EVENTDEV_DEBUG
678 ADAPTER_VALID_OR_ERR_RET(adapter, -EINVAL);
679 FUNC_PTR_OR_ERR_RET(adapter->arm_burst, -EINVAL);
681 return adapter->arm_burst(adapter, evtims, nb_evtims);
716 static inline uint16_t __rte_experimental
718 const struct rte_event_timer_adapter *adapter,
720 const uint64_t timeout_ticks,
721 const uint16_t nb_evtims)
723 #ifdef RTE_LIBRTE_EVENTDEV_DEBUG
724 ADAPTER_VALID_OR_ERR_RET(adapter, -EINVAL);
725 FUNC_PTR_OR_ERR_RET(adapter->arm_tmo_tick_burst, -EINVAL);
727 return adapter->arm_tmo_tick_burst(adapter, evtims, timeout_ticks,
754 static inline uint16_t __rte_experimental
759 #ifdef RTE_LIBRTE_EVENTDEV_DEBUG
760 ADAPTER_VALID_OR_ERR_RET(adapter, -EINVAL);
761 FUNC_PTR_OR_ERR_RET(adapter->cancel_burst, -EINVAL);
763 return adapter->cancel_burst(adapter, evtims, nb_evtims);