8 #ifndef _RTE_EVENTDEV_H_
9 #define _RTE_EVENTDEV_H_
214 #include <rte_config.h>
222 #define RTE_EVENT_DEV_CAP_QUEUE_QOS (1ULL << 0)
228 #define RTE_EVENT_DEV_CAP_EVENT_QOS (1ULL << 1)
235 #define RTE_EVENT_DEV_CAP_DISTRIBUTED_SCHED (1ULL << 2)
244 #define RTE_EVENT_DEV_CAP_QUEUE_ALL_TYPES (1ULL << 3)
251 #define RTE_EVENT_DEV_CAP_BURST_MODE (1ULL << 4)
259 #define RTE_EVENT_DEV_CAP_IMPLICIT_RELEASE_DISABLE (1ULL << 5)
270 #define RTE_EVENT_DEV_CAP_NONSEQ_MODE (1ULL << 6)
280 #define RTE_EVENT_DEV_CAP_RUNTIME_PORT_LINK (1ULL << 7)
286 #define RTE_EVENT_DEV_CAP_MULTIPLE_QUEUE_PORT (1ULL << 8)
293 #define RTE_EVENT_DEV_PRIORITY_HIGHEST 0
298 #define RTE_EVENT_DEV_PRIORITY_NORMAL 128
303 #define RTE_EVENT_DEV_PRIORITY_LOWEST 255
411 #define RTE_EVENT_DEV_ATTR_PORT_COUNT 0
415 #define RTE_EVENT_DEV_ATTR_QUEUE_COUNT 1
419 #define RTE_EVENT_DEV_ATTR_STARTED 2
435 uint32_t *attr_value);
439 #define RTE_EVENT_DEV_CFG_PER_DEQUEUE_TIMEOUT (1ULL << 0)
524 #define RTE_EVENT_QUEUE_CFG_ALL_TYPES (1ULL << 0)
530 #define RTE_EVENT_QUEUE_CFG_SINGLE_LINK (1ULL << 1)
628 #define RTE_EVENT_QUEUE_ATTR_PRIORITY 0
632 #define RTE_EVENT_QUEUE_ATTR_NB_ATOMIC_FLOWS 1
636 #define RTE_EVENT_QUEUE_ATTR_NB_ATOMIC_ORDER_SEQUENCES 2
640 #define RTE_EVENT_QUEUE_ATTR_EVENT_QUEUE_CFG 3
644 #define RTE_EVENT_QUEUE_ATTR_SCHEDULE_TYPE 4
668 uint32_t *attr_value);
761 #define RTE_EVENT_PORT_ATTR_ENQ_DEPTH 0
765 #define RTE_EVENT_PORT_ATTR_DEQ_DEPTH 1
769 #define RTE_EVENT_PORT_ATTR_NEW_EVENT_THRESHOLD 2
789 uint32_t *attr_value);
880 #define RTE_SCHED_TYPE_ORDERED 0
907 #define RTE_SCHED_TYPE_ATOMIC 1
926 #define RTE_SCHED_TYPE_PARALLEL 2
940 #define RTE_EVENT_TYPE_ETHDEV 0x0
942 #define RTE_EVENT_TYPE_CRYPTODEV 0x1
944 #define RTE_EVENT_TYPE_TIMER 0x2
946 #define RTE_EVENT_TYPE_CPU 0x3
950 #define RTE_EVENT_TYPE_ETH_RX_ADAPTER 0x4
952 #define RTE_EVENT_TYPE_MAX 0x10
956 #define RTE_EVENT_OP_NEW 0
960 #define RTE_EVENT_OP_FORWARD 1
968 #define RTE_EVENT_OP_RELEASE 2
1078 #define RTE_EVENT_ETH_RX_ADAPTER_CAP_INTERNAL_PORT 0x1
1082 #define RTE_EVENT_ETH_RX_ADAPTER_CAP_MULTI_EVENTQ 0x2
1086 #define RTE_EVENT_ETH_RX_ADAPTER_CAP_OVERRIDE_FLOW_ID 0x4
1117 #define RTE_EVENT_TIMER_ADAPTER_CAP_INTERNAL_PORT (1ULL << 0)
1133 int __rte_experimental
1137 #define RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_NEW 0x1
1144 #define RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_FWD 0x2
1151 #define RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_QP_EV_BIND 0x4
1156 #define RTE_EVENT_CRYPTO_ADAPTER_CAP_SESSION_PRIVATE_DATA 0x8
1184 int __rte_experimental
1189 #define RTE_EVENT_ETH_TX_ADAPTER_CAP_INTERNAL_PORT 0x1
1210 int __rte_experimental
1215 struct rte_eventdev;
1217 typedef uint16_t (*event_enqueue_t)(
void *
port,
const struct rte_event *ev);
1220 typedef uint16_t (*event_enqueue_burst_t)(
void *port,
1221 const struct rte_event ev[], uint16_t nb_events);
1224 typedef uint16_t (*event_dequeue_t)(
void *port,
struct rte_event *ev,
1225 uint64_t timeout_ticks);
1228 typedef uint16_t (*event_dequeue_burst_t)(
void *port,
struct rte_event ev[],
1229 uint16_t nb_events, uint64_t timeout_ticks);
1232 typedef uint16_t (*event_tx_adapter_enqueue)(
void *port,
1233 struct rte_event ev[], uint16_t nb_events);
1236 #define RTE_EVENTDEV_NAME_MAX_LEN (64)
1246 struct rte_eventdev_data {
1261 uint16_t *links_map;
1265 uint32_t event_dev_cap;
1269 uint8_t service_inited;
1271 uint32_t service_id;
1273 void *dev_stop_flush_arg;
1277 uint8_t dev_started : 1;
1280 char name[RTE_EVENTDEV_NAME_MAX_LEN];
1285 struct rte_eventdev {
1286 event_enqueue_t enqueue;
1288 event_enqueue_burst_t enqueue_burst;
1290 event_enqueue_burst_t enqueue_new_burst;
1292 event_enqueue_burst_t enqueue_forward_burst;
1294 event_dequeue_t dequeue;
1296 event_dequeue_burst_t dequeue_burst;
1298 event_tx_adapter_enqueue txa_enqueue;
1300 struct rte_eventdev_data *data;
1308 uint8_t attached : 1;
1312 extern struct rte_eventdev *rte_eventdevs;
1316 __rte_event_enqueue_burst(uint8_t dev_id, uint8_t port_id,
1317 const struct rte_event ev[], uint16_t nb_events,
1318 const event_enqueue_burst_t fn)
1320 const struct rte_eventdev *dev = &rte_eventdevs[dev_id];
1322 #ifdef RTE_LIBRTE_EVENTDEV_DEBUG
1323 if (dev_id >= RTE_EVENT_MAX_DEVS || !rte_eventdevs[dev_id].attached) {
1328 if (port_id >= dev->data->nb_ports) {
1338 return (*dev->enqueue)(dev->data->ports[port_id], ev);
1340 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);
1437 static inline uint16_t
1439 const struct rte_event ev[], uint16_t nb_events)
1441 const struct rte_eventdev *dev = &rte_eventdevs[dev_id];
1443 return __rte_event_enqueue_burst(dev_id, port_id, ev, nb_events,
1444 dev->enqueue_new_burst);
1488 static inline uint16_t
1490 const struct rte_event ev[], uint16_t nb_events)
1492 const struct rte_eventdev *dev = &rte_eventdevs[dev_id];
1494 return __rte_event_enqueue_burst(dev_id, port_id, ev, nb_events,
1495 dev->enqueue_forward_burst);
1525 uint64_t *timeout_ticks);
1593 static inline uint16_t
1595 uint16_t nb_events, uint64_t timeout_ticks)
1597 struct rte_eventdev *dev = &rte_eventdevs[dev_id];
1599 #ifdef RTE_LIBRTE_EVENTDEV_DEBUG
1600 if (dev_id >= RTE_EVENT_MAX_DEVS || !rte_eventdevs[dev_id].attached) {
1605 if (port_id >= dev->data->nb_ports) {
1616 return (*dev->dequeue)(
1617 dev->data->ports[port_id], ev, timeout_ticks);
1619 return (*dev->dequeue_burst)(
1620 dev->data->ports[port_id], ev, nb_events,
1686 const uint8_t queues[],
const uint8_t priorities[],
1730 uint8_t queues[], uint16_t nb_unlinks);
1756 int __rte_experimental
1788 uint8_t queues[], uint8_t priorities[]);
1825 #define RTE_EVENT_DEV_XSTATS_NAME_SIZE 64
1831 RTE_EVENT_DEV_XSTATS_DEVICE,
1832 RTE_EVENT_DEV_XSTATS_PORT,
1833 RTE_EVENT_DEV_XSTATS_QUEUE,
1881 uint8_t queue_port_id,
1915 uint8_t queue_port_id,
1916 const unsigned int ids[],
1917 uint64_t values[],
unsigned int n);
1962 int16_t queue_port_id,
1963 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_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_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_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_experimental rte_event_eth_tx_adapter_caps_get(uint8_t dev_id, uint16_t eth_port_id, uint32_t *caps)
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)
int __rte_experimental rte_event_port_unlinks_in_progress(uint8_t dev_id, uint8_t port_id)
uint8_t rte_event_dev_count(void)
int rte_event_dev_close(uint8_t dev_id)
int __rte_experimental rte_event_crypto_adapter_caps_get(uint8_t dev_id, uint8_t cdev_id, uint32_t *caps)
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)
uint32_t dequeue_timeout_ns
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_cache_aligned
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
int __rte_experimental rte_event_timer_adapter_caps_get(uint8_t dev_id, uint32_t *caps)
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