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 #define RTE_EVENT_ETH_TX_ADAPTER_CAP_INTERNAL_PORT 0x1
1211 int __rte_experimental
1216 struct rte_eventdev;
1218 typedef uint16_t (*event_enqueue_t)(
void *
port,
const struct rte_event *ev);
1221 typedef uint16_t (*event_enqueue_burst_t)(
void *port,
1222 const struct rte_event ev[], uint16_t nb_events);
1225 typedef uint16_t (*event_dequeue_t)(
void *port,
struct rte_event *ev,
1226 uint64_t timeout_ticks);
1229 typedef uint16_t (*event_dequeue_burst_t)(
void *port,
struct rte_event ev[],
1230 uint16_t nb_events, uint64_t timeout_ticks);
1233 typedef uint16_t (*event_tx_adapter_enqueue)(
void *port,
1234 struct rte_event ev[], uint16_t nb_events);
1237 #define RTE_EVENTDEV_NAME_MAX_LEN (64)
1247 struct rte_eventdev_data {
1262 uint16_t *links_map;
1266 uint32_t event_dev_cap;
1270 uint8_t service_inited;
1272 uint32_t service_id;
1274 void *dev_stop_flush_arg;
1278 uint8_t dev_started : 1;
1281 char name[RTE_EVENTDEV_NAME_MAX_LEN];
1286 struct rte_eventdev {
1287 event_enqueue_t enqueue;
1289 event_enqueue_burst_t enqueue_burst;
1291 event_enqueue_burst_t enqueue_new_burst;
1293 event_enqueue_burst_t enqueue_forward_burst;
1295 event_dequeue_t dequeue;
1297 event_dequeue_burst_t dequeue_burst;
1299 event_tx_adapter_enqueue txa_enqueue;
1301 struct rte_eventdev_data *data;
1309 uint8_t attached : 1;
1313 extern struct rte_eventdev *rte_eventdevs;
1317 __rte_event_enqueue_burst(uint8_t dev_id, uint8_t port_id,
1318 const struct rte_event ev[], uint16_t nb_events,
1319 const event_enqueue_burst_t fn)
1321 const struct rte_eventdev *dev = &rte_eventdevs[dev_id];
1323 #ifdef RTE_LIBRTE_EVENTDEV_DEBUG
1324 if (dev_id >= RTE_EVENT_MAX_DEVS || !rte_eventdevs[dev_id].attached) {
1329 if (port_id >= dev->data->nb_ports) {
1339 return (*dev->enqueue)(dev->data->ports[port_id], ev);
1341 return fn(dev->data->ports[port_id], ev, nb_events);
1386 static inline uint16_t
1388 const struct rte_event ev[], uint16_t nb_events)
1390 const struct rte_eventdev *dev = &rte_eventdevs[dev_id];
1392 return __rte_event_enqueue_burst(dev_id, port_id, ev, nb_events,
1393 dev->enqueue_burst);
1435 static inline uint16_t
1437 const struct rte_event ev[], uint16_t nb_events)
1439 const struct rte_eventdev *dev = &rte_eventdevs[dev_id];
1441 return __rte_event_enqueue_burst(dev_id, port_id, ev, nb_events,
1442 dev->enqueue_new_burst);
1484 static inline uint16_t
1486 const struct rte_event ev[], uint16_t nb_events)
1488 const struct rte_eventdev *dev = &rte_eventdevs[dev_id];
1490 return __rte_event_enqueue_burst(dev_id, port_id, ev, nb_events,
1491 dev->enqueue_forward_burst);
1521 uint64_t *timeout_ticks);
1589 static inline uint16_t
1591 uint16_t nb_events, uint64_t timeout_ticks)
1593 struct rte_eventdev *dev = &rte_eventdevs[dev_id];
1595 #ifdef RTE_LIBRTE_EVENTDEV_DEBUG
1596 if (dev_id >= RTE_EVENT_MAX_DEVS || !rte_eventdevs[dev_id].attached) {
1601 if (port_id >= dev->data->nb_ports) {
1612 return (*dev->dequeue)(
1613 dev->data->ports[port_id], ev, timeout_ticks);
1615 return (*dev->dequeue_burst)(
1616 dev->data->ports[port_id], ev, nb_events,
1682 const uint8_t queues[],
const uint8_t priorities[],
1726 uint8_t queues[], uint16_t nb_unlinks);
1752 int __rte_experimental
1784 uint8_t queues[], uint8_t priorities[]);
1821 #define RTE_EVENT_DEV_XSTATS_NAME_SIZE 64
1827 RTE_EVENT_DEV_XSTATS_DEVICE,
1828 RTE_EVENT_DEV_XSTATS_PORT,
1829 RTE_EVENT_DEV_XSTATS_QUEUE,
1877 uint8_t queue_port_id,
1911 uint8_t queue_port_id,
1912 const unsigned int ids[],
1913 uint64_t values[],
unsigned int n);
1958 int16_t queue_port_id,
1959 const uint32_t ids[],