8 #ifndef _RTE_EVENTDEV_H_
9 #define _RTE_EVENTDEV_H_
215 #include <rte_config.h>
223 #define RTE_EVENT_DEV_CAP_QUEUE_QOS (1ULL << 0)
229 #define RTE_EVENT_DEV_CAP_EVENT_QOS (1ULL << 1)
236 #define RTE_EVENT_DEV_CAP_DISTRIBUTED_SCHED (1ULL << 2)
245 #define RTE_EVENT_DEV_CAP_QUEUE_ALL_TYPES (1ULL << 3)
252 #define RTE_EVENT_DEV_CAP_BURST_MODE (1ULL << 4)
260 #define RTE_EVENT_DEV_CAP_IMPLICIT_RELEASE_DISABLE (1ULL << 5)
271 #define RTE_EVENT_DEV_CAP_NONSEQ_MODE (1ULL << 6)
281 #define RTE_EVENT_DEV_CAP_RUNTIME_PORT_LINK (1ULL << 7)
287 #define RTE_EVENT_DEV_CAP_MULTIPLE_QUEUE_PORT (1ULL << 8)
294 #define RTE_EVENT_DEV_PRIORITY_HIGHEST 0
299 #define RTE_EVENT_DEV_PRIORITY_NORMAL 128
304 #define RTE_EVENT_DEV_PRIORITY_LOWEST 255
412 #define RTE_EVENT_DEV_ATTR_PORT_COUNT 0
416 #define RTE_EVENT_DEV_ATTR_QUEUE_COUNT 1
420 #define RTE_EVENT_DEV_ATTR_STARTED 2
436 uint32_t *attr_value);
440 #define RTE_EVENT_DEV_CFG_PER_DEQUEUE_TIMEOUT (1ULL << 0)
525 #define RTE_EVENT_QUEUE_CFG_ALL_TYPES (1ULL << 0)
531 #define RTE_EVENT_QUEUE_CFG_SINGLE_LINK (1ULL << 1)
629 #define RTE_EVENT_QUEUE_ATTR_PRIORITY 0
633 #define RTE_EVENT_QUEUE_ATTR_NB_ATOMIC_FLOWS 1
637 #define RTE_EVENT_QUEUE_ATTR_NB_ATOMIC_ORDER_SEQUENCES 2
641 #define RTE_EVENT_QUEUE_ATTR_EVENT_QUEUE_CFG 3
645 #define RTE_EVENT_QUEUE_ATTR_SCHEDULE_TYPE 4
669 uint32_t *attr_value);
762 #define RTE_EVENT_PORT_ATTR_ENQ_DEPTH 0
766 #define RTE_EVENT_PORT_ATTR_DEQ_DEPTH 1
770 #define RTE_EVENT_PORT_ATTR_NEW_EVENT_THRESHOLD 2
790 uint32_t *attr_value);
881 #define RTE_SCHED_TYPE_ORDERED 0
908 #define RTE_SCHED_TYPE_ATOMIC 1
927 #define RTE_SCHED_TYPE_PARALLEL 2
941 #define RTE_EVENT_TYPE_ETHDEV 0x0
943 #define RTE_EVENT_TYPE_CRYPTODEV 0x1
945 #define RTE_EVENT_TYPE_TIMER 0x2
947 #define RTE_EVENT_TYPE_CPU 0x3
951 #define RTE_EVENT_TYPE_ETH_RX_ADAPTER 0x4
953 #define RTE_EVENT_TYPE_MAX 0x10
957 #define RTE_EVENT_OP_NEW 0
961 #define RTE_EVENT_OP_FORWARD 1
969 #define RTE_EVENT_OP_RELEASE 2
1079 #define RTE_EVENT_ETH_RX_ADAPTER_CAP_INTERNAL_PORT 0x1
1083 #define RTE_EVENT_ETH_RX_ADAPTER_CAP_MULTI_EVENTQ 0x2
1087 #define RTE_EVENT_ETH_RX_ADAPTER_CAP_OVERRIDE_FLOW_ID 0x4
1118 #define RTE_EVENT_TIMER_ADAPTER_CAP_INTERNAL_PORT (1ULL << 0)
1134 int __rte_experimental
1138 #define RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_NEW 0x1
1145 #define RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_FWD 0x2
1152 #define RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_QP_EV_BIND 0x4
1157 #define RTE_EVENT_CRYPTO_ADAPTER_CAP_SESSION_PRIVATE_DATA 0x8
1185 int __rte_experimental
1190 struct rte_eventdev;
1192 typedef uint16_t (*event_enqueue_t)(
void *
port,
const struct rte_event *ev);
1195 typedef uint16_t (*event_enqueue_burst_t)(
void *port,
1196 const struct rte_event ev[], uint16_t nb_events);
1199 typedef uint16_t (*event_dequeue_t)(
void *port,
struct rte_event *ev,
1200 uint64_t timeout_ticks);
1203 typedef uint16_t (*event_dequeue_burst_t)(
void *port,
struct rte_event ev[],
1204 uint16_t nb_events, uint64_t timeout_ticks);
1207 #define RTE_EVENTDEV_NAME_MAX_LEN (64)
1217 struct rte_eventdev_data {
1232 uint16_t *links_map;
1236 uint32_t event_dev_cap;
1240 uint8_t service_inited;
1242 uint32_t service_id;
1244 void *dev_stop_flush_arg;
1248 uint8_t dev_started : 1;
1251 char name[RTE_EVENTDEV_NAME_MAX_LEN];
1256 struct rte_eventdev {
1257 event_enqueue_t enqueue;
1259 event_enqueue_burst_t enqueue_burst;
1261 event_enqueue_burst_t enqueue_new_burst;
1263 event_enqueue_burst_t enqueue_forward_burst;
1265 event_dequeue_t dequeue;
1267 event_dequeue_burst_t dequeue_burst;
1270 struct rte_eventdev_data *data;
1278 uint8_t attached : 1;
1282 extern struct rte_eventdev *rte_eventdevs;
1286 __rte_event_enqueue_burst(uint8_t dev_id, uint8_t port_id,
1287 const struct rte_event ev[], uint16_t nb_events,
1288 const event_enqueue_burst_t fn)
1290 const struct rte_eventdev *dev = &rte_eventdevs[dev_id];
1292 #ifdef RTE_LIBRTE_EVENTDEV_DEBUG
1293 if (dev_id >= RTE_EVENT_MAX_DEVS || !rte_eventdevs[dev_id].attached) {
1298 if (port_id >= dev->data->nb_ports) {
1308 return (*dev->enqueue)(dev->data->ports[port_id], ev);
1310 return fn(dev->data->ports[port_id], ev, nb_events);
1355 static inline uint16_t
1357 const struct rte_event ev[], uint16_t nb_events)
1359 const struct rte_eventdev *dev = &rte_eventdevs[dev_id];
1361 return __rte_event_enqueue_burst(dev_id, port_id, ev, nb_events,
1362 dev->enqueue_burst);
1404 static inline uint16_t
1406 const struct rte_event ev[], uint16_t nb_events)
1408 const struct rte_eventdev *dev = &rte_eventdevs[dev_id];
1410 return __rte_event_enqueue_burst(dev_id, port_id, ev, nb_events,
1411 dev->enqueue_new_burst);
1453 static inline uint16_t
1455 const struct rte_event ev[], uint16_t nb_events)
1457 const struct rte_eventdev *dev = &rte_eventdevs[dev_id];
1459 return __rte_event_enqueue_burst(dev_id, port_id, ev, nb_events,
1460 dev->enqueue_forward_burst);
1490 uint64_t *timeout_ticks);
1558 static inline uint16_t
1560 uint16_t nb_events, uint64_t timeout_ticks)
1562 struct rte_eventdev *dev = &rte_eventdevs[dev_id];
1564 #ifdef RTE_LIBRTE_EVENTDEV_DEBUG
1565 if (dev_id >= RTE_EVENT_MAX_DEVS || !rte_eventdevs[dev_id].attached) {
1570 if (port_id >= dev->data->nb_ports) {
1581 return (*dev->dequeue)(
1582 dev->data->ports[port_id], ev, timeout_ticks);
1584 return (*dev->dequeue_burst)(
1585 dev->data->ports[port_id], ev, nb_events,
1651 const uint8_t queues[],
const uint8_t priorities[],
1695 uint8_t queues[], uint16_t nb_unlinks);
1726 uint8_t queues[], uint8_t priorities[]);
1763 #define RTE_EVENT_DEV_XSTATS_NAME_SIZE 64
1769 RTE_EVENT_DEV_XSTATS_DEVICE,
1770 RTE_EVENT_DEV_XSTATS_PORT,
1771 RTE_EVENT_DEV_XSTATS_QUEUE,
1819 uint8_t queue_port_id,
1853 uint8_t queue_port_id,
1854 const unsigned int ids[],
1855 uint64_t values[],
unsigned int n);
1900 int16_t queue_port_id,
1901 const uint32_t ids[],