8 #ifndef _RTE_EVENTDEV_H_
9 #define _RTE_EVENTDEV_H_
244 #include <rte_compat.h>
256 #define RTE_EVENT_DEV_CAP_QUEUE_QOS (1ULL << 0)
274 #define RTE_EVENT_DEV_CAP_EVENT_QOS (1ULL << 1)
288 #define RTE_EVENT_DEV_CAP_DISTRIBUTED_SCHED (1ULL << 2)
298 #define RTE_EVENT_DEV_CAP_QUEUE_ALL_TYPES (1ULL << 3)
322 #define RTE_EVENT_DEV_CAP_BURST_MODE (1ULL << 4)
333 #define RTE_EVENT_DEV_CAP_IMPLICIT_RELEASE_DISABLE (1ULL << 5)
346 #define RTE_EVENT_DEV_CAP_NONSEQ_MODE (1ULL << 6)
358 #define RTE_EVENT_DEV_CAP_RUNTIME_PORT_LINK (1ULL << 7)
369 #define RTE_EVENT_DEV_CAP_MULTIPLE_QUEUE_PORT (1ULL << 8)
379 #define RTE_EVENT_DEV_CAP_CARRY_FLOW_ID (1ULL << 9)
388 #define RTE_EVENT_DEV_CAP_MAINTENANCE_FREE (1ULL << 10)
401 #define RTE_EVENT_DEV_CAP_RUNTIME_QUEUE_ATTR (1ULL << 11)
411 #define RTE_EVENT_DEV_CAP_PROFILE_LINK (1ULL << 12)
425 #define RTE_EVENT_DEV_CAP_ATOMIC (1ULL << 13)
433 #define RTE_EVENT_DEV_CAP_ORDERED (1ULL << 14)
441 #define RTE_EVENT_DEV_CAP_PARALLEL (1ULL << 15)
450 #define RTE_EVENT_DEV_PRIORITY_HIGHEST 0
457 #define RTE_EVENT_DEV_PRIORITY_NORMAL 128
464 #define RTE_EVENT_DEV_PRIORITY_LOWEST 255
473 #define RTE_EVENT_QUEUE_WEIGHT_HIGHEST 255
479 #define RTE_EVENT_QUEUE_WEIGHT_LOWEST 0
487 #define RTE_EVENT_QUEUE_AFFINITY_HIGHEST 255
493 #define RTE_EVENT_QUEUE_AFFINITY_LOWEST 0
650 #define RTE_EVENT_DEV_ATTR_PORT_COUNT 0
654 #define RTE_EVENT_DEV_ATTR_QUEUE_COUNT 1
658 #define RTE_EVENT_DEV_ATTR_STARTED 2
674 uint32_t *attr_value);
678 #define RTE_EVENT_DEV_CFG_PER_DEQUEUE_TIMEOUT (1ULL << 0)
788 #define RTE_EVENT_QUEUE_CFG_ALL_TYPES (1ULL << 0)
802 #define RTE_EVENT_QUEUE_CFG_SINGLE_LINK (1ULL << 1)
952 #define RTE_EVENT_QUEUE_ATTR_PRIORITY 0
956 #define RTE_EVENT_QUEUE_ATTR_NB_ATOMIC_FLOWS 1
960 #define RTE_EVENT_QUEUE_ATTR_NB_ATOMIC_ORDER_SEQUENCES 2
964 #define RTE_EVENT_QUEUE_ATTR_EVENT_QUEUE_CFG 3
968 #define RTE_EVENT_QUEUE_ATTR_SCHEDULE_TYPE 4
972 #define RTE_EVENT_QUEUE_ATTR_WEIGHT 5
976 #define RTE_EVENT_QUEUE_ATTR_AFFINITY 6
1000 uint32_t *attr_value);
1023 uint64_t attr_value);
1028 #define RTE_EVENT_PORT_CFG_DISABLE_IMPL_REL (1ULL << 0)
1035 #define RTE_EVENT_PORT_CFG_SINGLE_LINK (1ULL << 1)
1043 #define RTE_EVENT_PORT_CFG_HINT_PRODUCER (1ULL << 2)
1053 #define RTE_EVENT_PORT_CFG_HINT_CONSUMER (1ULL << 3)
1064 #define RTE_EVENT_PORT_CFG_HINT_WORKER (1ULL << 4)
1206 #define RTE_EVENT_PORT_ATTR_ENQ_DEPTH 0
1210 #define RTE_EVENT_PORT_ATTR_DEQ_DEPTH 1
1216 #define RTE_EVENT_PORT_ATTR_NEW_EVENT_THRESHOLD 2
1220 #define RTE_EVENT_PORT_ATTR_IMPLICIT_RELEASE_DISABLE 3
1241 uint32_t *attr_value);
1344 uint16_t elem_offset : 12;
1348 uint16_t attr_valid : 1;
1366 uint64_t impl_opaque;
1394 #define RTE_SCHED_TYPE_ORDERED 0
1432 #define RTE_SCHED_TYPE_ATOMIC 1
1459 #define RTE_SCHED_TYPE_PARALLEL 2
1473 #define RTE_EVENT_TYPE_ETHDEV 0x0
1475 #define RTE_EVENT_TYPE_CRYPTODEV 0x1
1477 #define RTE_EVENT_TYPE_TIMER 0x2
1479 #define RTE_EVENT_TYPE_CPU 0x3
1483 #define RTE_EVENT_TYPE_ETH_RX_ADAPTER 0x4
1485 #define RTE_EVENT_TYPE_DMADEV 0x5
1487 #define RTE_EVENT_TYPE_VECTOR 0x8
1499 #define RTE_EVENT_TYPE_ETHDEV_VECTOR \
1500 (RTE_EVENT_TYPE_VECTOR | RTE_EVENT_TYPE_ETHDEV)
1502 #define RTE_EVENT_TYPE_CPU_VECTOR (RTE_EVENT_TYPE_VECTOR | RTE_EVENT_TYPE_CPU)
1504 #define RTE_EVENT_TYPE_ETH_RX_ADAPTER_VECTOR \
1505 (RTE_EVENT_TYPE_VECTOR | RTE_EVENT_TYPE_ETH_RX_ADAPTER)
1507 #define RTE_EVENT_TYPE_CRYPTODEV_VECTOR \
1508 (RTE_EVENT_TYPE_VECTOR | RTE_EVENT_TYPE_CRYPTODEV)
1511 #define RTE_EVENT_TYPE_MAX 0x10
1515 #define RTE_EVENT_OP_NEW 0
1520 #define RTE_EVENT_OP_FORWARD 1
1532 #define RTE_EVENT_OP_RELEASE 2
1698 #define RTE_EVENT_ETH_RX_ADAPTER_CAP_INTERNAL_PORT 0x1
1702 #define RTE_EVENT_ETH_RX_ADAPTER_CAP_MULTI_EVENTQ 0x2
1706 #define RTE_EVENT_ETH_RX_ADAPTER_CAP_OVERRIDE_FLOW_ID 0x4
1713 #define RTE_EVENT_ETH_RX_ADAPTER_CAP_EVENT_VECTOR 0x8
1738 #define RTE_EVENT_TIMER_ADAPTER_CAP_INTERNAL_PORT (1ULL << 0)
1741 #define RTE_EVENT_TIMER_ADAPTER_CAP_PERIODIC (1ULL << 1)
1761 #define RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_NEW 0x1
1768 #define RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_FWD 0x2
1775 #define RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_QP_EV_BIND 0x4
1780 #define RTE_EVENT_CRYPTO_ADAPTER_CAP_SESSION_PRIVATE_DATA 0x8
1785 #define RTE_EVENT_CRYPTO_ADAPTER_CAP_EVENT_VECTOR 0x10
1814 #define RTE_EVENT_DMA_ADAPTER_CAP_INTERNAL_PORT_OP_NEW 0x1
1821 #define RTE_EVENT_DMA_ADAPTER_CAP_INTERNAL_PORT_OP_FWD 0x2
1828 #define RTE_EVENT_DMA_ADAPTER_CAP_INTERNAL_PORT_VCHAN_EV_BIND 0x4
1856 #define RTE_EVENT_ETH_TX_ADAPTER_CAP_INTERNAL_PORT 0x1
1859 #define RTE_EVENT_ETH_TX_ADAPTER_CAP_EVENT_VECTOR 0x2
1910 uint64_t *timeout_ticks);
1977 const uint8_t queues[],
const uint8_t priorities[],
2025 uint8_t queues[], uint16_t nb_unlinks);
2102 const uint8_t priorities[], uint16_t nb_links, uint8_t profile_id);
2155 uint16_t nb_unlinks, uint8_t profile_id);
2209 uint8_t queues[], uint8_t priorities[]);
2245 uint8_t priorities[], uint8_t profile_id);
2282 #define RTE_EVENT_DEV_XSTATS_NAME_SIZE 64
2288 RTE_EVENT_DEV_XSTATS_DEVICE,
2289 RTE_EVENT_DEV_XSTATS_PORT,
2290 RTE_EVENT_DEV_XSTATS_QUEUE,
2338 uint8_t queue_port_id,
2372 uint8_t queue_port_id,
2373 const uint64_t ids[],
2374 uint64_t values[],
unsigned int n);
2419 int16_t queue_port_id,
2420 const uint64_t ids[],
2470 #include <rte_eventdev_core.h>
2473 __rte_event_enqueue_burst(uint8_t dev_id, uint8_t port_id,
2474 const struct rte_event ev[], uint16_t nb_events,
2475 const event_enqueue_burst_t fn)
2477 const struct rte_event_fp_ops *fp_ops;
2480 fp_ops = &rte_event_fp_ops[dev_id];
2481 port = fp_ops->data[port_id];
2482 #ifdef RTE_LIBRTE_EVENTDEV_DEBUG
2483 if (dev_id >= RTE_EVENT_MAX_DEVS ||
2484 port_id >= RTE_EVENT_MAX_PORTS_PER_DEV) {
2494 rte_eventdev_trace_enq_burst(dev_id, port_id, ev, nb_events, (
void *)fn);
2500 return (fp_ops->enqueue)(port, ev);
2502 return fn(port, ev, nb_events);
2548 static inline uint16_t
2550 const struct rte_event ev[], uint16_t nb_events)
2552 const struct rte_event_fp_ops *fp_ops;
2554 fp_ops = &rte_event_fp_ops[dev_id];
2555 return __rte_event_enqueue_burst(dev_id, port_id, ev, nb_events,
2556 fp_ops->enqueue_burst);
2600 static inline uint16_t
2602 const struct rte_event ev[], uint16_t nb_events)
2604 const struct rte_event_fp_ops *fp_ops;
2606 fp_ops = &rte_event_fp_ops[dev_id];
2607 return __rte_event_enqueue_burst(dev_id, port_id, ev, nb_events,
2608 fp_ops->enqueue_new_burst);
2652 static inline uint16_t
2654 const struct rte_event ev[], uint16_t nb_events)
2656 const struct rte_event_fp_ops *fp_ops;
2658 fp_ops = &rte_event_fp_ops[dev_id];
2659 return __rte_event_enqueue_burst(dev_id, port_id, ev, nb_events,
2660 fp_ops->enqueue_forward_burst);
2729 static inline uint16_t
2731 uint16_t nb_events, uint64_t timeout_ticks)
2733 const struct rte_event_fp_ops *fp_ops;
2736 fp_ops = &rte_event_fp_ops[dev_id];
2737 port = fp_ops->data[port_id];
2738 #ifdef RTE_LIBRTE_EVENTDEV_DEBUG
2739 if (dev_id >= RTE_EVENT_MAX_DEVS ||
2740 port_id >= RTE_EVENT_MAX_PORTS_PER_DEV) {
2750 rte_eventdev_trace_deq_burst(dev_id, port_id, ev, nb_events);
2756 return (fp_ops->dequeue)(port, ev, timeout_ticks);
2758 return (fp_ops->dequeue_burst)(port, ev, nb_events,
2762 #define RTE_EVENT_DEV_MAINT_OP_FLUSH (1 << 0)
2807 const struct rte_event_fp_ops *fp_ops;
2810 fp_ops = &rte_event_fp_ops[dev_id];
2811 port = fp_ops->data[port_id];
2812 #ifdef RTE_LIBRTE_EVENTDEV_DEBUG
2813 if (dev_id >= RTE_EVENT_MAX_DEVS ||
2814 port_id >= RTE_EVENT_MAX_PORTS_PER_DEV)
2823 rte_eventdev_trace_maintain(dev_id, port_id, op);
2825 if (fp_ops->maintain != NULL)
2826 fp_ops->maintain(port, op);
2852 static inline uint8_t
2855 const struct rte_event_fp_ops *fp_ops;
2858 fp_ops = &rte_event_fp_ops[dev_id];
2859 port = fp_ops->data[port_id];
2861 #ifdef RTE_LIBRTE_EVENTDEV_DEBUG
2862 if (dev_id >= RTE_EVENT_MAX_DEVS ||
2863 port_id >= RTE_EVENT_MAX_PORTS_PER_DEV)
2869 if (profile_id >= RTE_EVENT_MAX_PROFILES_PER_PORT)
2872 rte_eventdev_trace_port_profile_switch(dev_id, port_id, profile_id);
2874 return fp_ops->profile_switch(port, profile_id);
void rte_event_dev_stop(uint8_t dev_id)
uint32_t min_dequeue_timeout_ns
int rte_event_dequeue_timeout_ticks(uint8_t dev_id, uint64_t ns, uint64_t *timeout_ticks)
int rte_event_dev_xstats_names_get(uint8_t dev_id, enum rte_event_dev_xstats_mode mode, uint8_t queue_port_id, struct rte_event_dev_xstats_name *xstats_names, uint64_t *ids, unsigned int size)
static uint16_t rte_event_enqueue_new_burst(uint8_t dev_id, uint8_t port_id, const struct rte_event ev[], uint16_t nb_events)
#define __rte_always_inline
#define RTE_EVENT_DEV_XSTATS_NAME_SIZE
int rte_event_dev_attr_get(uint8_t dev_id, uint32_t attr_id, uint32_t *attr_value)
int rte_event_eth_tx_adapter_caps_get(uint8_t dev_id, uint16_t eth_port_id, uint32_t *caps)
int rte_event_queue_setup(uint8_t dev_id, uint8_t queue_id, const struct rte_event_queue_conf *queue_conf)
uint8_t max_event_port_links
int rte_event_queue_default_conf_get(uint8_t dev_id, uint8_t queue_id, struct rte_event_queue_conf *queue_conf)
int rte_event_port_default_conf_get(uint8_t dev_id, uint8_t port_id, struct rte_event_port_conf *port_conf)
uint32_t dequeue_timeout_ns
__rte_experimental int rte_event_dma_adapter_caps_get(uint8_t dev_id, uint8_t dmadev_id, uint32_t *caps)
int rte_event_queue_attr_set(uint8_t dev_id, uint8_t queue_id, uint32_t attr_id, uint64_t attr_value)
int rte_event_dev_socket_id(uint8_t dev_id)
int rte_event_dev_xstats_get(uint8_t dev_id, enum rte_event_dev_xstats_mode mode, uint8_t queue_port_id, const uint64_t ids[], uint64_t values[], unsigned int n)
static uint8_t rte_event_port_profile_switch(uint8_t dev_id, uint8_t port_id, uint8_t profile_id)
int rte_event_dev_xstats_reset(uint8_t dev_id, enum rte_event_dev_xstats_mode mode, int16_t queue_port_id, const uint64_t ids[], uint32_t nb_ids)
uint32_t max_event_port_enqueue_depth
int rte_event_timer_adapter_caps_get(uint8_t dev_id, uint32_t *caps)
int rte_event_dev_info_get(uint8_t dev_id, struct rte_event_dev_info *dev_info)
char name[RTE_MEMPOOL_NAMESIZE]
uint32_t nb_atomic_order_sequences
uint32_t nb_event_port_dequeue_depth
int rte_event_port_unlinks_in_progress(uint8_t dev_id, uint8_t port_id)
__rte_experimental int rte_event_port_profile_links_set(uint8_t dev_id, uint8_t port_id, const uint8_t queues[], const uint8_t priorities[], uint16_t nb_links, uint8_t profile_id)
int rte_event_port_link(uint8_t dev_id, uint8_t port_id, const uint8_t queues[], const uint8_t priorities[], uint16_t nb_links)
int rte_event_queue_attr_get(uint8_t dev_id, uint8_t queue_id, uint32_t attr_id, uint32_t *attr_value)
uint8_t max_profiles_per_port
struct rte_event_vector * vec
uint8_t max_single_link_event_port_queue_pairs
rte_event_dev_xstats_mode
int rte_event_port_links_get(uint8_t dev_id, uint8_t port_id, uint8_t queues[], uint8_t priorities[])
int rte_event_dev_stop_flush_callback_register(uint8_t dev_id, rte_eventdev_stop_flush_t callback, void *userdata)
int rte_event_dev_selftest(uint8_t dev_id)
static uint16_t rte_event_enqueue_burst(uint8_t dev_id, uint8_t port_id, const struct rte_event ev[], uint16_t nb_events)
int rte_event_dev_start(uint8_t dev_id)
uint64_t rte_event_dev_xstats_by_name_get(uint8_t dev_id, const char *name, uint64_t *id)
int rte_event_port_setup(uint8_t dev_id, uint8_t port_id, const struct rte_event_port_conf *port_conf)
void rte_event_port_quiesce(uint8_t dev_id, uint8_t port_id, rte_eventdev_port_flush_t release_cb, void *args)
uint8_t max_event_port_dequeue_depth
int rte_event_port_attr_get(uint8_t dev_id, uint8_t port_id, uint32_t attr_id, uint32_t *attr_value)
uint32_t nb_event_port_enqueue_depth
struct __rte_aligned(16) rte_event_vector
static uint16_t rte_event_dequeue_burst(uint8_t dev_id, uint8_t port_id, struct rte_event ev[], uint16_t nb_events, uint64_t timeout_ticks)
int rte_event_dev_get_dev_id(const char *name)
uint8_t rte_event_dev_count(void)
int rte_event_dev_close(uint8_t dev_id)
int rte_event_crypto_adapter_caps_get(uint8_t dev_id, uint8_t cdev_id, uint32_t *caps)
__rte_experimental int rte_event_port_profile_links_get(uint8_t dev_id, uint8_t port_id, uint8_t queues[], uint8_t priorities[], uint8_t profile_id)
uint32_t dequeue_timeout_ns
static int rte_event_maintain(uint8_t dev_id, uint8_t port_id, int op)
int rte_event_dev_service_id_get(uint8_t dev_id, uint32_t *service_id)
static uint16_t rte_event_enqueue_forward_burst(uint8_t dev_id, uint8_t port_id, const struct rte_event ev[], uint16_t nb_events)
#define RTE_EVENT_DEV_MAINT_OP_FLUSH
struct rte_mempool * rte_event_vector_pool_create(const char *name, unsigned int n, unsigned int cache_size, uint16_t nb_elem, int socket_id)
int rte_event_dev_dump(uint8_t dev_id, FILE *f)
uint8_t nb_single_link_event_port_queues
void(* rte_eventdev_port_flush_t)(uint8_t dev_id, struct rte_event event, void *arg)
void(* rte_eventdev_stop_flush_t)(uint8_t dev_id, struct rte_event event, void *arg)
int32_t new_event_threshold
uint8_t max_event_priority_levels
uint32_t max_dequeue_timeout_ns
uint32_t max_event_queue_flows
int rte_event_dev_configure(uint8_t dev_id, const struct rte_event_dev_config *dev_conf)
__rte_experimental int rte_event_port_profile_unlink(uint8_t dev_id, uint8_t port_id, uint8_t queues[], uint16_t nb_unlinks, uint8_t profile_id)
uint8_t max_event_queue_priority_levels
int rte_event_port_unlink(uint8_t dev_id, uint8_t port_id, uint8_t queues[], uint16_t nb_unlinks)
int rte_event_eth_rx_adapter_caps_get(uint8_t dev_id, uint16_t eth_port_id, uint32_t *caps)
uint32_t nb_event_queue_flows