8 #ifndef _RTE_EVENTDEV_H_
9 #define _RTE_EVENTDEV_H_
214 #include <rte_config.h>
224 #define RTE_EVENT_DEV_CAP_QUEUE_QOS (1ULL << 0)
230 #define RTE_EVENT_DEV_CAP_EVENT_QOS (1ULL << 1)
237 #define RTE_EVENT_DEV_CAP_DISTRIBUTED_SCHED (1ULL << 2)
246 #define RTE_EVENT_DEV_CAP_QUEUE_ALL_TYPES (1ULL << 3)
253 #define RTE_EVENT_DEV_CAP_BURST_MODE (1ULL << 4)
261 #define RTE_EVENT_DEV_CAP_IMPLICIT_RELEASE_DISABLE (1ULL << 5)
272 #define RTE_EVENT_DEV_CAP_NONSEQ_MODE (1ULL << 6)
282 #define RTE_EVENT_DEV_CAP_RUNTIME_PORT_LINK (1ULL << 7)
288 #define RTE_EVENT_DEV_CAP_MULTIPLE_QUEUE_PORT (1ULL << 8)
295 #define RTE_EVENT_DEV_PRIORITY_HIGHEST 0
300 #define RTE_EVENT_DEV_PRIORITY_NORMAL 128
305 #define RTE_EVENT_DEV_PRIORITY_LOWEST 255
413 #define RTE_EVENT_DEV_ATTR_PORT_COUNT 0
417 #define RTE_EVENT_DEV_ATTR_QUEUE_COUNT 1
421 #define RTE_EVENT_DEV_ATTR_STARTED 2
437 uint32_t *attr_value);
441 #define RTE_EVENT_DEV_CFG_PER_DEQUEUE_TIMEOUT (1ULL << 0)
526 #define RTE_EVENT_QUEUE_CFG_ALL_TYPES (1ULL << 0)
532 #define RTE_EVENT_QUEUE_CFG_SINGLE_LINK (1ULL << 1)
630 #define RTE_EVENT_QUEUE_ATTR_PRIORITY 0
634 #define RTE_EVENT_QUEUE_ATTR_NB_ATOMIC_FLOWS 1
638 #define RTE_EVENT_QUEUE_ATTR_NB_ATOMIC_ORDER_SEQUENCES 2
642 #define RTE_EVENT_QUEUE_ATTR_EVENT_QUEUE_CFG 3
646 #define RTE_EVENT_QUEUE_ATTR_SCHEDULE_TYPE 4
670 uint32_t *attr_value);
763 #define RTE_EVENT_PORT_ATTR_ENQ_DEPTH 0
767 #define RTE_EVENT_PORT_ATTR_DEQ_DEPTH 1
771 #define RTE_EVENT_PORT_ATTR_NEW_EVENT_THRESHOLD 2
791 uint32_t *attr_value);
882 #define RTE_SCHED_TYPE_ORDERED 0
909 #define RTE_SCHED_TYPE_ATOMIC 1
928 #define RTE_SCHED_TYPE_PARALLEL 2
942 #define RTE_EVENT_TYPE_ETHDEV 0x0
944 #define RTE_EVENT_TYPE_CRYPTODEV 0x1
946 #define RTE_EVENT_TYPE_TIMER 0x2
948 #define RTE_EVENT_TYPE_CPU 0x3
952 #define RTE_EVENT_TYPE_ETH_RX_ADAPTER 0x4
954 #define RTE_EVENT_TYPE_MAX 0x10
958 #define RTE_EVENT_OP_NEW 0
962 #define RTE_EVENT_OP_FORWARD 1
970 #define RTE_EVENT_OP_RELEASE 2
1080 #define RTE_EVENT_ETH_RX_ADAPTER_CAP_INTERNAL_PORT 0x1
1084 #define RTE_EVENT_ETH_RX_ADAPTER_CAP_MULTI_EVENTQ 0x2
1088 #define RTE_EVENT_ETH_RX_ADAPTER_CAP_OVERRIDE_FLOW_ID 0x4
1119 #define RTE_EVENT_TIMER_ADAPTER_CAP_INTERNAL_PORT (1ULL << 0)
1139 #define RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_NEW 0x1
1146 #define RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_FWD 0x2
1153 #define RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_QP_EV_BIND 0x4
1158 #define RTE_EVENT_CRYPTO_ADAPTER_CAP_SESSION_PRIVATE_DATA 0x8
1188 #define RTE_EVENT_ETH_TX_ADAPTER_CAP_INTERNAL_PORT 0x1
1214 struct rte_eventdev;
1216 typedef uint16_t (*event_enqueue_t)(
void *port,
const struct rte_event *ev);
1219 typedef uint16_t (*event_enqueue_burst_t)(
void *port,
1220 const struct rte_event ev[], uint16_t nb_events);
1223 typedef uint16_t (*event_dequeue_t)(
void *port,
struct rte_event *ev,
1224 uint64_t timeout_ticks);
1227 typedef uint16_t (*event_dequeue_burst_t)(
void *port,
struct rte_event ev[],
1228 uint16_t nb_events, uint64_t timeout_ticks);
1231 typedef uint16_t (*event_tx_adapter_enqueue)(
void *port,
1232 struct rte_event ev[], uint16_t nb_events);
1235 typedef uint16_t (*event_tx_adapter_enqueue_same_dest)(
void *port,
1236 struct rte_event ev[], uint16_t nb_events);
1241 #define RTE_EVENTDEV_NAME_MAX_LEN (64)
1251 struct rte_eventdev_data {
1266 uint16_t *links_map;
1270 uint32_t event_dev_cap;
1274 uint8_t service_inited;
1276 uint32_t service_id;
1278 void *dev_stop_flush_arg;
1282 uint8_t dev_started : 1;
1285 char name[RTE_EVENTDEV_NAME_MAX_LEN];
1288 uint64_t reserved_64s[4];
1289 void *reserved_ptrs[4];
1293 struct rte_eventdev {
1294 event_enqueue_t enqueue;
1296 event_enqueue_burst_t enqueue_burst;
1298 event_enqueue_burst_t enqueue_new_burst;
1300 event_enqueue_burst_t enqueue_forward_burst;
1302 event_dequeue_t dequeue;
1304 event_dequeue_burst_t dequeue_burst;
1306 event_tx_adapter_enqueue_same_dest txa_enqueue_same_dest;
1310 event_tx_adapter_enqueue txa_enqueue;
1312 struct rte_eventdev_data *data;
1320 uint8_t attached : 1;
1323 uint64_t reserved_64s[4];
1324 void *reserved_ptrs[4];
1327 extern struct rte_eventdev *rte_eventdevs;
1331 __rte_event_enqueue_burst(uint8_t dev_id, uint8_t port_id,
1332 const struct rte_event ev[], uint16_t nb_events,
1333 const event_enqueue_burst_t fn)
1335 const struct rte_eventdev *dev = &rte_eventdevs[dev_id];
1337 #ifdef RTE_LIBRTE_EVENTDEV_DEBUG
1338 if (dev_id >= RTE_EVENT_MAX_DEVS || !rte_eventdevs[dev_id].attached) {
1343 if (port_id >= dev->data->nb_ports) {
1348 rte_eventdev_trace_enq_burst(dev_id, port_id, ev, nb_events, fn);
1354 return (*dev->enqueue)(dev->data->ports[port_id], ev);
1356 return fn(dev->data->ports[port_id], ev, nb_events);
1402 static inline uint16_t
1404 const struct rte_event ev[], uint16_t nb_events)
1406 const struct rte_eventdev *dev = &rte_eventdevs[dev_id];
1408 return __rte_event_enqueue_burst(dev_id, port_id, ev, nb_events,
1409 dev->enqueue_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_new_burst);
1504 static inline uint16_t
1506 const struct rte_event ev[], uint16_t nb_events)
1508 const struct rte_eventdev *dev = &rte_eventdevs[dev_id];
1510 return __rte_event_enqueue_burst(dev_id, port_id, ev, nb_events,
1511 dev->enqueue_forward_burst);
1541 uint64_t *timeout_ticks);
1609 static inline uint16_t
1611 uint16_t nb_events, uint64_t timeout_ticks)
1613 struct rte_eventdev *dev = &rte_eventdevs[dev_id];
1615 #ifdef RTE_LIBRTE_EVENTDEV_DEBUG
1616 if (dev_id >= RTE_EVENT_MAX_DEVS || !rte_eventdevs[dev_id].attached) {
1621 if (port_id >= dev->data->nb_ports) {
1626 rte_eventdev_trace_deq_burst(dev_id, port_id, ev, nb_events);
1632 return (*dev->dequeue)(
1633 dev->data->ports[port_id], ev, timeout_ticks);
1635 return (*dev->dequeue_burst)(
1636 dev->data->ports[port_id], ev, nb_events,
1702 const uint8_t queues[],
const uint8_t priorities[],
1746 uint8_t queues[], uint16_t nb_unlinks);
1801 uint8_t queues[], uint8_t priorities[]);
1838 #define RTE_EVENT_DEV_XSTATS_NAME_SIZE 64
1844 RTE_EVENT_DEV_XSTATS_DEVICE,
1845 RTE_EVENT_DEV_XSTATS_PORT,
1846 RTE_EVENT_DEV_XSTATS_QUEUE,
1894 uint8_t queue_port_id,
1928 uint8_t queue_port_id,
1929 const unsigned int ids[],
1930 uint64_t values[],
unsigned int n);
1975 int16_t queue_port_id,
1976 const uint32_t ids[],
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)
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_dev_stop_flush_callback_register(uint8_t dev_id, eventdev_stop_flush_t callback, void *userdata)
int rte_event_queue_setup(uint8_t dev_id, uint8_t queue_id, const struct rte_event_queue_conf *queue_conf)
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
int rte_event_dev_socket_id(uint8_t dev_id)
uint32_t max_event_port_enqueue_depth
uint64_t rte_event_dev_xstats_by_name_get(uint8_t dev_id, const char *name, unsigned int *id)
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)
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)
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 disable_implicit_release
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_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)
int rte_event_port_setup(uint8_t dev_id, uint8_t port_id, const struct rte_event_port_conf *port_conf)
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
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_dev_xstats_get(uint8_t dev_id, enum rte_event_dev_xstats_mode mode, uint8_t queue_port_id, const unsigned int ids[], uint64_t values[], unsigned int n)
int rte_event_dev_xstats_reset(uint8_t dev_id, enum rte_event_dev_xstats_mode mode, int16_t queue_port_id, const uint32_t ids[], uint32_t nb_ids)
int rte_event_crypto_adapter_caps_get(uint8_t dev_id, uint8_t cdev_id, uint32_t *caps)
uint32_t dequeue_timeout_ns
int rte_event_dev_service_id_get(uint8_t dev_id, uint32_t *service_id)
#define __rte_cache_aligned
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)
int rte_event_dev_dump(uint8_t dev_id, FILE *f)
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)
void(* eventdev_stop_flush_t)(uint8_t dev_id, struct rte_event event, void *arg)
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)
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, unsigned int *ids, unsigned int size)
uint32_t nb_event_queue_flows