35 #ifndef _RTE_EVENTDEV_H_
36 #define _RTE_EVENTDEV_H_
242 #include <rte_config.h>
249 #define RTE_EVENT_DEV_CAP_QUEUE_QOS (1ULL << 0)
255 #define RTE_EVENT_DEV_CAP_EVENT_QOS (1ULL << 1)
262 #define RTE_EVENT_DEV_CAP_DISTRIBUTED_SCHED (1ULL << 2)
271 #define RTE_EVENT_DEV_CAP_QUEUE_ALL_TYPES (1ULL << 3)
278 #define RTE_EVENT_DEV_CAP_BURST_MODE (1ULL << 4)
288 #define RTE_EVENT_DEV_PRIORITY_HIGHEST 0
293 #define RTE_EVENT_DEV_PRIORITY_NORMAL 128
298 #define RTE_EVENT_DEV_PRIORITY_LOWEST 255
406 #define RTE_EVENT_DEV_ATTR_PORT_COUNT 0
410 #define RTE_EVENT_DEV_ATTR_QUEUE_COUNT 1
414 #define RTE_EVENT_DEV_ATTR_STARTED 2
430 uint32_t *attr_value);
434 #define RTE_EVENT_DEV_CFG_PER_DEQUEUE_TIMEOUT (1ULL << 0)
519 #define RTE_EVENT_QUEUE_CFG_ALL_TYPES (1ULL << 0)
525 #define RTE_EVENT_QUEUE_CFG_SINGLE_LINK (1ULL << 1)
623 #define RTE_EVENT_QUEUE_ATTR_PRIORITY 0
627 #define RTE_EVENT_QUEUE_ATTR_NB_ATOMIC_FLOWS 1
631 #define RTE_EVENT_QUEUE_ATTR_NB_ATOMIC_ORDER_SEQUENCES 2
635 #define RTE_EVENT_QUEUE_ATTR_EVENT_QUEUE_CFG 3
639 #define RTE_EVENT_QUEUE_ATTR_SCHEDULE_TYPE 4
663 uint32_t *attr_value);
749 #define RTE_EVENT_PORT_ATTR_ENQ_DEPTH 0
753 #define RTE_EVENT_PORT_ATTR_DEQ_DEPTH 1
757 #define RTE_EVENT_PORT_ATTR_NEW_EVENT_THRESHOLD 2
777 uint32_t *attr_value);
823 #define RTE_SCHED_TYPE_ORDERED 0
850 #define RTE_SCHED_TYPE_ATOMIC 1
869 #define RTE_SCHED_TYPE_PARALLEL 2
883 #define RTE_EVENT_TYPE_ETHDEV 0x0
885 #define RTE_EVENT_TYPE_CRYPTODEV 0x1
887 #define RTE_EVENT_TYPE_TIMERDEV 0x2
889 #define RTE_EVENT_TYPE_CPU 0x3
893 #define RTE_EVENT_TYPE_ETH_RX_ADAPTER 0x4
895 #define RTE_EVENT_TYPE_MAX 0x10
899 #define RTE_EVENT_OP_NEW 0
903 #define RTE_EVENT_OP_FORWARD 1
911 #define RTE_EVENT_OP_RELEASE 2
1021 #define RTE_EVENT_ETH_RX_ADAPTER_CAP_INTERNAL_PORT 0x1
1025 #define RTE_EVENT_ETH_RX_ADAPTER_CAP_MULTI_EVENTQ 0x2
1029 #define RTE_EVENT_ETH_RX_ADAPTER_CAP_OVERRIDE_FLOW_ID 0x4
1060 struct rte_eventdev_driver;
1062 struct rte_eventdev;
1064 typedef uint16_t (*event_enqueue_t)(
void *
port,
const struct rte_event *ev);
1067 typedef uint16_t (*event_enqueue_burst_t)(
void *port,
1068 const struct rte_event ev[], uint16_t nb_events);
1071 typedef uint16_t (*event_dequeue_t)(
void *port,
struct rte_event *ev,
1072 uint64_t timeout_ticks);
1075 typedef uint16_t (*event_dequeue_burst_t)(
void *port,
struct rte_event ev[],
1076 uint16_t nb_events, uint64_t timeout_ticks);
1079 #define RTE_EVENTDEV_NAME_MAX_LEN (64)
1089 struct rte_eventdev_data {
1104 uint16_t *links_map;
1108 uint32_t event_dev_cap;
1112 uint8_t service_inited;
1114 uint32_t service_id;
1118 uint8_t dev_started : 1;
1121 char name[RTE_EVENTDEV_NAME_MAX_LEN];
1126 struct rte_eventdev {
1127 event_enqueue_t enqueue;
1129 event_enqueue_burst_t enqueue_burst;
1131 event_enqueue_burst_t enqueue_new_burst;
1133 event_enqueue_burst_t enqueue_forward_burst;
1135 event_dequeue_t dequeue;
1137 event_dequeue_burst_t dequeue_burst;
1140 struct rte_eventdev_data *data;
1148 uint8_t attached : 1;
1156 __rte_event_enqueue_burst(uint8_t dev_id, uint8_t port_id,
1157 const struct rte_event ev[], uint16_t nb_events,
1158 const event_enqueue_burst_t fn)
1160 const struct rte_eventdev *dev = &rte_eventdevs[dev_id];
1162 #ifdef RTE_LIBRTE_EVENTDEV_DEBUG
1163 if (dev_id >= RTE_EVENT_MAX_DEVS || !rte_eventdevs[dev_id].attached) {
1168 if (port_id >= dev->data->nb_ports) {
1178 return (*dev->enqueue)(dev->data->ports[port_id], ev);
1180 return fn(dev->data->ports[port_id], ev, nb_events);
1225 static inline uint16_t
1227 const struct rte_event ev[], uint16_t nb_events)
1229 const struct rte_eventdev *dev = &rte_eventdevs[dev_id];
1231 return __rte_event_enqueue_burst(dev_id, port_id, ev, nb_events,
1232 dev->enqueue_burst);
1274 static inline uint16_t
1276 const struct rte_event ev[], uint16_t nb_events)
1278 const struct rte_eventdev *dev = &rte_eventdevs[dev_id];
1280 return __rte_event_enqueue_burst(dev_id, port_id, ev, nb_events,
1281 dev->enqueue_new_burst);
1323 static inline uint16_t
1325 const struct rte_event ev[], uint16_t nb_events)
1327 const struct rte_eventdev *dev = &rte_eventdevs[dev_id];
1329 return __rte_event_enqueue_burst(dev_id, port_id, ev, nb_events,
1330 dev->enqueue_forward_burst);
1360 uint64_t *timeout_ticks);
1428 static inline uint16_t
1430 uint16_t nb_events, uint64_t timeout_ticks)
1432 struct rte_eventdev *dev = &rte_eventdevs[dev_id];
1434 #ifdef RTE_LIBRTE_EVENTDEV_DEBUG
1435 if (dev_id >= RTE_EVENT_MAX_DEVS || !rte_eventdevs[dev_id].attached) {
1440 if (port_id >= dev->data->nb_ports) {
1451 return (*dev->dequeue)(
1452 dev->data->ports[port_id], ev, timeout_ticks);
1454 return (*dev->dequeue_burst)(
1455 dev->data->ports[port_id], ev, nb_events,
1521 const uint8_t queues[],
const uint8_t priorities[],
1565 uint8_t queues[], uint16_t nb_unlinks);
1596 uint8_t queues[], uint8_t priorities[]);
1633 #define RTE_EVENT_DEV_XSTATS_NAME_SIZE 64
1639 RTE_EVENT_DEV_XSTATS_DEVICE,
1640 RTE_EVENT_DEV_XSTATS_PORT,
1641 RTE_EVENT_DEV_XSTATS_QUEUE,
1689 uint8_t queue_port_id,
1723 uint8_t queue_port_id,
1724 const unsigned int ids[],
1725 uint64_t values[],
unsigned int n);
1770 int16_t queue_port_id,
1771 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_eth_rx_adapter_caps_get(uint8_t dev_id, uint8_t eth_port_id, uint32_t *caps)
struct rte_eventdev * rte_eventdevs
int rte_event_dev_attr_get(uint8_t dev_id, uint32_t attr_id, uint32_t *attr_value)
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
struct rte_mbuf __rte_cache_aligned
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)
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[])
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)
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)
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)
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_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