8 #ifndef _RTE_EVENTDEV_H_ 9 #define _RTE_EVENTDEV_H_ 214 #include <rte_config.h> 226 #define RTE_EVENT_DEV_CAP_QUEUE_QOS (1ULL << 0) 232 #define RTE_EVENT_DEV_CAP_EVENT_QOS (1ULL << 1) 239 #define RTE_EVENT_DEV_CAP_DISTRIBUTED_SCHED (1ULL << 2) 248 #define RTE_EVENT_DEV_CAP_QUEUE_ALL_TYPES (1ULL << 3) 255 #define RTE_EVENT_DEV_CAP_BURST_MODE (1ULL << 4) 263 #define RTE_EVENT_DEV_CAP_IMPLICIT_RELEASE_DISABLE (1ULL << 5) 274 #define RTE_EVENT_DEV_CAP_NONSEQ_MODE (1ULL << 6) 284 #define RTE_EVENT_DEV_CAP_RUNTIME_PORT_LINK (1ULL << 7) 290 #define RTE_EVENT_DEV_CAP_MULTIPLE_QUEUE_PORT (1ULL << 8) 296 #define RTE_EVENT_DEV_CAP_CARRY_FLOW_ID (1ULL << 9) 303 #define RTE_EVENT_DEV_PRIORITY_HIGHEST 0 308 #define RTE_EVENT_DEV_PRIORITY_NORMAL 128 313 #define RTE_EVENT_DEV_PRIORITY_LOWEST 255 431 #define RTE_EVENT_DEV_ATTR_PORT_COUNT 0 435 #define RTE_EVENT_DEV_ATTR_QUEUE_COUNT 1 439 #define RTE_EVENT_DEV_ATTR_STARTED 2 455 uint32_t *attr_value);
459 #define RTE_EVENT_DEV_CFG_PER_DEQUEUE_TIMEOUT (1ULL << 0) 551 #define RTE_EVENT_QUEUE_CFG_ALL_TYPES (1ULL << 0) 557 #define RTE_EVENT_QUEUE_CFG_SINGLE_LINK (1ULL << 1) 655 #define RTE_EVENT_QUEUE_ATTR_PRIORITY 0 659 #define RTE_EVENT_QUEUE_ATTR_NB_ATOMIC_FLOWS 1 663 #define RTE_EVENT_QUEUE_ATTR_NB_ATOMIC_ORDER_SEQUENCES 2 667 #define RTE_EVENT_QUEUE_ATTR_EVENT_QUEUE_CFG 3 671 #define RTE_EVENT_QUEUE_ATTR_SCHEDULE_TYPE 4 695 uint32_t *attr_value);
700 #define RTE_EVENT_PORT_CFG_DISABLE_IMPL_REL (1ULL << 0) 707 #define RTE_EVENT_PORT_CFG_SINGLE_LINK (1ULL << 1) 796 #define RTE_EVENT_PORT_ATTR_ENQ_DEPTH 0 800 #define RTE_EVENT_PORT_ATTR_DEQ_DEPTH 1 804 #define RTE_EVENT_PORT_ATTR_NEW_EVENT_THRESHOLD 2 808 #define RTE_EVENT_PORT_ATTR_IMPLICIT_RELEASE_DISABLE 3 828 uint32_t *attr_value);
964 #define RTE_SCHED_TYPE_ORDERED 0 991 #define RTE_SCHED_TYPE_ATOMIC 1 1010 #define RTE_SCHED_TYPE_PARALLEL 2 1024 #define RTE_EVENT_TYPE_ETHDEV 0x0 1026 #define RTE_EVENT_TYPE_CRYPTODEV 0x1 1028 #define RTE_EVENT_TYPE_TIMER 0x2 1030 #define RTE_EVENT_TYPE_CPU 0x3 1034 #define RTE_EVENT_TYPE_ETH_RX_ADAPTER 0x4 1036 #define RTE_EVENT_TYPE_VECTOR 0x8 1048 #define RTE_EVENT_TYPE_ETHDEV_VECTOR \ 1049 (RTE_EVENT_TYPE_VECTOR | RTE_EVENT_TYPE_ETHDEV) 1051 #define RTE_EVENT_TYPE_CPU_VECTOR (RTE_EVENT_TYPE_VECTOR | RTE_EVENT_TYPE_CPU) 1053 #define RTE_EVENT_TYPE_ETH_RX_ADAPTER_VECTOR \ 1054 (RTE_EVENT_TYPE_VECTOR | RTE_EVENT_TYPE_ETH_RX_ADAPTER) 1057 #define RTE_EVENT_TYPE_MAX 0x10 1061 #define RTE_EVENT_OP_NEW 0 1065 #define RTE_EVENT_OP_FORWARD 1 1073 #define RTE_EVENT_OP_RELEASE 2 1185 #define RTE_EVENT_ETH_RX_ADAPTER_CAP_INTERNAL_PORT 0x1 1189 #define RTE_EVENT_ETH_RX_ADAPTER_CAP_MULTI_EVENTQ 0x2 1193 #define RTE_EVENT_ETH_RX_ADAPTER_CAP_OVERRIDE_FLOW_ID 0x4 1200 #define RTE_EVENT_ETH_RX_ADAPTER_CAP_EVENT_VECTOR 0x8 1226 #define RTE_EVENT_TIMER_ADAPTER_CAP_INTERNAL_PORT (1ULL << 0) 1229 #define RTE_EVENT_TIMER_ADAPTER_CAP_PERIODIC (1ULL << 1) 1249 #define RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_NEW 0x1 1256 #define RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_FWD 0x2 1263 #define RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_QP_EV_BIND 0x4 1268 #define RTE_EVENT_CRYPTO_ADAPTER_CAP_SESSION_PRIVATE_DATA 0x8 1298 #define RTE_EVENT_ETH_TX_ADAPTER_CAP_INTERNAL_PORT 0x1 1301 #define RTE_EVENT_ETH_TX_ADAPTER_CAP_EVENT_VECTOR 0x2 1327 struct rte_eventdev_ops;
1328 struct rte_eventdev;
1330 typedef uint16_t (*event_enqueue_t)(
void *port,
const struct rte_event *ev);
1333 typedef uint16_t (*event_enqueue_burst_t)(
void *port,
1334 const struct rte_event ev[], uint16_t nb_events);
1337 typedef uint16_t (*event_dequeue_t)(
void *port,
struct rte_event *ev,
1338 uint64_t timeout_ticks);
1341 typedef uint16_t (*event_dequeue_burst_t)(
void *port,
struct rte_event ev[],
1342 uint16_t nb_events, uint64_t timeout_ticks);
1345 typedef uint16_t (*event_tx_adapter_enqueue)(
void *port,
1346 struct rte_event ev[], uint16_t nb_events);
1349 typedef uint16_t (*event_tx_adapter_enqueue_same_dest)(
void *port,
1350 struct rte_event ev[], uint16_t nb_events);
1355 typedef uint16_t (*event_crypto_adapter_enqueue)(
void *port,
1356 struct rte_event ev[], uint16_t nb_events);
1359 #define RTE_EVENTDEV_NAME_MAX_LEN (64) 1369 struct rte_eventdev_data {
1384 uint16_t *links_map;
1392 uint8_t service_inited;
1394 uint32_t service_id;
1396 void *dev_stop_flush_arg;
1400 uint8_t dev_started : 1;
1403 char name[RTE_EVENTDEV_NAME_MAX_LEN];
1406 uint64_t reserved_64s[4];
1407 void *reserved_ptrs[4];
1411 struct rte_eventdev {
1412 event_enqueue_t enqueue;
1414 event_enqueue_burst_t enqueue_burst;
1416 event_enqueue_burst_t enqueue_new_burst;
1418 event_enqueue_burst_t enqueue_forward_burst;
1420 event_dequeue_t dequeue;
1422 event_dequeue_burst_t dequeue_burst;
1424 event_tx_adapter_enqueue_same_dest txa_enqueue_same_dest;
1428 event_tx_adapter_enqueue txa_enqueue;
1430 struct rte_eventdev_data *data;
1432 struct rte_eventdev_ops *dev_ops;
1438 uint8_t attached : 1;
1441 event_crypto_adapter_enqueue ca_enqueue;
1444 uint64_t reserved_64s[4];
1445 void *reserved_ptrs[3];
1448 extern struct rte_eventdev *rte_eventdevs;
1452 __rte_event_enqueue_burst(uint8_t dev_id, uint8_t port_id,
1453 const struct rte_event ev[], uint16_t nb_events,
1454 const event_enqueue_burst_t fn)
1456 const struct rte_eventdev *
dev = &rte_eventdevs[dev_id];
1458 #ifdef RTE_LIBRTE_EVENTDEV_DEBUG 1459 if (dev_id >= RTE_EVENT_MAX_DEVS || !rte_eventdevs[dev_id].attached) {
1464 if (port_id >= dev->data->nb_ports) {
1469 rte_eventdev_trace_enq_burst(dev_id, port_id, ev, nb_events, fn);
1475 return (*dev->enqueue)(dev->data->ports[port_id], ev);
1477 return fn(dev->data->ports[port_id], ev, nb_events);
1523 static inline uint16_t
1525 const struct rte_event ev[], uint16_t nb_events)
1527 const struct rte_eventdev *dev = &rte_eventdevs[dev_id];
1529 return __rte_event_enqueue_burst(dev_id, port_id, ev, nb_events,
1530 dev->enqueue_burst);
1574 static inline uint16_t
1576 const struct rte_event ev[], uint16_t nb_events)
1578 const struct rte_eventdev *dev = &rte_eventdevs[dev_id];
1580 return __rte_event_enqueue_burst(dev_id, port_id, ev, nb_events,
1581 dev->enqueue_new_burst);
1625 static inline uint16_t
1627 const struct rte_event ev[], uint16_t nb_events)
1629 const struct rte_eventdev *dev = &rte_eventdevs[dev_id];
1631 return __rte_event_enqueue_burst(dev_id, port_id, ev, nb_events,
1632 dev->enqueue_forward_burst);
1662 uint64_t *timeout_ticks);
1730 static inline uint16_t
1732 uint16_t nb_events, uint64_t timeout_ticks)
1734 struct rte_eventdev *dev = &rte_eventdevs[dev_id];
1736 #ifdef RTE_LIBRTE_EVENTDEV_DEBUG 1737 if (dev_id >= RTE_EVENT_MAX_DEVS || !rte_eventdevs[dev_id].attached) {
1742 if (port_id >= dev->data->nb_ports) {
1747 rte_eventdev_trace_deq_burst(dev_id, port_id, ev, nb_events);
1753 return (*dev->dequeue)(
1754 dev->data->ports[port_id], ev, timeout_ticks);
1756 return (*dev->dequeue_burst)(
1757 dev->data->ports[port_id], ev, nb_events,
1823 const uint8_t queues[],
const uint8_t priorities[],
1867 uint8_t queues[], uint16_t nb_unlinks);
1922 uint8_t queues[], uint8_t priorities[]);
1959 #define RTE_EVENT_DEV_XSTATS_NAME_SIZE 64 1965 RTE_EVENT_DEV_XSTATS_DEVICE,
1966 RTE_EVENT_DEV_XSTATS_PORT,
1967 RTE_EVENT_DEV_XSTATS_QUEUE,
2015 uint8_t queue_port_id,
2049 uint8_t queue_port_id,
2050 const unsigned int ids[],
2051 uint64_t values[],
unsigned int n);
2096 int16_t queue_port_id,
2097 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)
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
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)
__rte_experimental 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)
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_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)
#define __rte_cache_aligned
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)
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)
__extension__ struct rte_eth_link __rte_aligned(8)
int rte_event_dev_dump(uint8_t dev_id, FILE *f)
uint8_t nb_single_link_event_port_queues
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