35 #ifndef _RTE_EVENTDEV_H_
36 #define _RTE_EVENTDEV_H_
248 #define RTE_EVENT_DEV_CAP_QUEUE_QOS (1ULL << 0)
254 #define RTE_EVENT_DEV_CAP_EVENT_QOS (1ULL << 1)
261 #define RTE_EVENT_DEV_CAP_DISTRIBUTED_SCHED (1ULL << 2)
270 #define RTE_EVENT_DEV_CAP_QUEUE_ALL_TYPES (1ULL << 3)
277 #define RTE_EVENT_DEV_CAP_BURST_MODE (1ULL << 4)
287 #define RTE_EVENT_DEV_PRIORITY_HIGHEST 0
292 #define RTE_EVENT_DEV_PRIORITY_NORMAL 128
297 #define RTE_EVENT_DEV_PRIORITY_LOWEST 255
405 #define RTE_EVENT_DEV_ATTR_PORT_COUNT 0
409 #define RTE_EVENT_DEV_ATTR_QUEUE_COUNT 1
413 #define RTE_EVENT_DEV_ATTR_STARTED 2
429 uint32_t *attr_value);
433 #define RTE_EVENT_DEV_CFG_PER_DEQUEUE_TIMEOUT (1ULL << 0)
518 #define RTE_EVENT_QUEUE_CFG_ALL_TYPES (1ULL << 0)
524 #define RTE_EVENT_QUEUE_CFG_SINGLE_LINK (1ULL << 1)
622 #define RTE_EVENT_QUEUE_ATTR_PRIORITY 0
626 #define RTE_EVENT_QUEUE_ATTR_NB_ATOMIC_FLOWS 1
630 #define RTE_EVENT_QUEUE_ATTR_NB_ATOMIC_ORDER_SEQUENCES 2
634 #define RTE_EVENT_QUEUE_ATTR_EVENT_QUEUE_CFG 3
638 #define RTE_EVENT_QUEUE_ATTR_SCHEDULE_TYPE 4
658 uint32_t *attr_value);
744 #define RTE_EVENT_PORT_ATTR_ENQ_DEPTH 0
748 #define RTE_EVENT_PORT_ATTR_DEQ_DEPTH 1
752 #define RTE_EVENT_PORT_ATTR_NEW_EVENT_THRESHOLD 2
768 uint32_t *attr_value);
814 #define RTE_SCHED_TYPE_ORDERED 0
841 #define RTE_SCHED_TYPE_ATOMIC 1
860 #define RTE_SCHED_TYPE_PARALLEL 2
874 #define RTE_EVENT_TYPE_ETHDEV 0x0
876 #define RTE_EVENT_TYPE_CRYPTODEV 0x1
878 #define RTE_EVENT_TYPE_TIMERDEV 0x2
880 #define RTE_EVENT_TYPE_CPU 0x3
884 #define RTE_EVENT_TYPE_ETH_RX_ADAPTER 0x4
886 #define RTE_EVENT_TYPE_MAX 0x10
890 #define RTE_EVENT_OP_NEW 0
894 #define RTE_EVENT_OP_FORWARD 1
902 #define RTE_EVENT_OP_RELEASE 2
1012 #define RTE_EVENT_ETH_RX_ADAPTER_CAP_INTERNAL_PORT 0x1
1016 #define RTE_EVENT_ETH_RX_ADAPTER_CAP_MULTI_EVENTQ 0x2
1020 #define RTE_EVENT_ETH_RX_ADAPTER_CAP_OVERRIDE_FLOW_ID 0x4
1051 struct rte_eventdev_driver;
1053 struct rte_eventdev;
1055 typedef uint16_t (*event_enqueue_t)(
void *
port,
const struct rte_event *ev);
1058 typedef uint16_t (*event_enqueue_burst_t)(
void *port,
1059 const struct rte_event ev[], uint16_t nb_events);
1062 typedef uint16_t (*event_dequeue_t)(
void *port,
struct rte_event *ev,
1063 uint64_t timeout_ticks);
1066 typedef uint16_t (*event_dequeue_burst_t)(
void *port,
struct rte_event ev[],
1067 uint16_t nb_events, uint64_t timeout_ticks);
1070 #define RTE_EVENTDEV_NAME_MAX_LEN (64)
1080 struct rte_eventdev_data {
1095 uint16_t *links_map;
1099 uint32_t event_dev_cap;
1103 uint8_t service_inited;
1105 uint32_t service_id;
1109 uint8_t dev_started : 1;
1112 char name[RTE_EVENTDEV_NAME_MAX_LEN];
1117 struct rte_eventdev {
1118 event_enqueue_t enqueue;
1120 event_enqueue_burst_t enqueue_burst;
1122 event_enqueue_burst_t enqueue_new_burst;
1124 event_enqueue_burst_t enqueue_forward_burst;
1126 event_dequeue_t dequeue;
1128 event_dequeue_burst_t dequeue_burst;
1131 struct rte_eventdev_data *data;
1139 uint8_t attached : 1;
1147 __rte_event_enqueue_burst(uint8_t dev_id, uint8_t port_id,
1148 const struct rte_event ev[], uint16_t nb_events,
1149 const event_enqueue_burst_t fn)
1151 const struct rte_eventdev *dev = &rte_eventdevs[dev_id];
1153 #ifdef RTE_LIBRTE_EVENTDEV_DEBUG
1154 if (dev_id >= RTE_EVENT_MAX_DEVS || !rte_eventdevs[dev_id].attached) {
1159 if (port_id >= dev->data->nb_ports) {
1169 return (*dev->enqueue)(dev->data->ports[port_id], ev);
1171 return fn(dev->data->ports[port_id], ev, nb_events);
1216 static inline uint16_t
1218 const struct rte_event ev[], uint16_t nb_events)
1220 const struct rte_eventdev *dev = &rte_eventdevs[dev_id];
1222 return __rte_event_enqueue_burst(dev_id, port_id, ev, nb_events,
1223 dev->enqueue_burst);
1265 static inline uint16_t
1267 const struct rte_event ev[], uint16_t nb_events)
1269 const struct rte_eventdev *dev = &rte_eventdevs[dev_id];
1271 return __rte_event_enqueue_burst(dev_id, port_id, ev, nb_events,
1272 dev->enqueue_new_burst);
1314 static inline uint16_t
1316 const struct rte_event ev[], uint16_t nb_events)
1318 const struct rte_eventdev *dev = &rte_eventdevs[dev_id];
1320 return __rte_event_enqueue_burst(dev_id, port_id, ev, nb_events,
1321 dev->enqueue_forward_burst);
1351 uint64_t *timeout_ticks);
1419 static inline uint16_t
1421 uint16_t nb_events, uint64_t timeout_ticks)
1423 struct rte_eventdev *dev = &rte_eventdevs[dev_id];
1425 #ifdef RTE_LIBRTE_EVENTDEV_DEBUG
1426 if (dev_id >= RTE_EVENT_MAX_DEVS || !rte_eventdevs[dev_id].attached) {
1431 if (port_id >= dev->data->nb_ports) {
1442 return (*dev->dequeue)(
1443 dev->data->ports[port_id], ev, timeout_ticks);
1445 return (*dev->dequeue_burst)(
1446 dev->data->ports[port_id], ev, nb_events,
1512 const uint8_t queues[],
const uint8_t priorities[],
1556 uint8_t queues[], uint16_t nb_unlinks);
1587 uint8_t queues[], uint8_t priorities[]);
1624 #define RTE_EVENT_DEV_XSTATS_NAME_SIZE 64
1630 RTE_EVENT_DEV_XSTATS_DEVICE,
1631 RTE_EVENT_DEV_XSTATS_PORT,
1632 RTE_EVENT_DEV_XSTATS_QUEUE,
1680 uint8_t queue_port_id,
1714 uint8_t queue_port_id,
1715 const unsigned int ids[],
1716 uint64_t values[],
unsigned int n);
1761 int16_t queue_port_id,
1762 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