2 * SPDX-License-Identifier: BSD-3-Clause
8 #ifndef __DPAA2_EVENTDEV_H__
9 #define __DPAA2_EVENTDEV_H__
11 #include <rte_eventdev_pmd.h>
12 #include <rte_eventdev_pmd_vdev.h>
13 #include <rte_atomic.h>
14 #include <mc/fsl_dpcon.h>
15 #include <mc/fsl_mc_sys.h>
17 #define EVENTDEV_NAME_DPAA2_PMD event_dpaa2
19 #define DPAA2_EVENT_DEFAULT_DPCI_PRIO 0
21 #define DPAA2_EVENT_MAX_QUEUES 16
22 #define DPAA2_EVENT_MIN_DEQUEUE_TIMEOUT 1
23 #define DPAA2_EVENT_MAX_DEQUEUE_TIMEOUT (UINT32_MAX - 1)
24 #define DPAA2_EVENT_PORT_DEQUEUE_TIMEOUT_NS 100UL
25 #define DPAA2_EVENT_MAX_QUEUE_FLOWS 2048
26 #define DPAA2_EVENT_MAX_QUEUE_PRIORITY_LEVELS 8
27 #define DPAA2_EVENT_MAX_EVENT_PRIORITY_LEVELS 0
28 #define DPAA2_EVENT_MAX_PORT_DEQUEUE_DEPTH 8
29 #define DPAA2_EVENT_MAX_PORT_ENQUEUE_DEPTH 8
30 #define DPAA2_EVENT_MAX_NUM_EVENTS (INT32_MAX - 1)
32 #define DPAA2_EVENT_QUEUE_ATOMIC_FLOWS 2048
33 #define DPAA2_EVENT_QUEUE_ORDER_SEQUENCES 2048
36 DPAA2_EVENT_DPCI_PARALLEL_QUEUE,
37 DPAA2_EVENT_DPCI_ATOMIC_QUEUE,
38 DPAA2_EVENT_DPCI_MAX_QUEUES
41 #define RTE_EVENT_ETH_RX_ADAPTER_DPAA2_CAP \
42 (RTE_EVENT_ETH_RX_ADAPTER_CAP_INTERNAL_PORT | \
43 RTE_EVENT_ETH_RX_ADAPTER_CAP_MULTI_EVENTQ | \
44 RTE_EVENT_ETH_RX_ADAPTER_CAP_OVERRIDE_FLOW_ID)
45 /**< Ethernet Rx adapter cap to return If the packet transfers from
46 * the ethdev to eventdev with DPAA2 devices.
49 struct dpaa2_dpcon_dev {
50 TAILQ_ENTRY(dpaa2_dpcon_dev) next;
51 struct fsl_mc_io dpcon;
53 rte_atomic16_t in_use;
56 uint8_t num_priorities;
57 uint8_t channel_index;
62 struct dpaa2_dpcon_dev *dpcon;
63 /* Attached DPCI device */
64 struct dpaa2_dpci_dev *dpci;
65 /* Configuration provided by the user */
66 uint32_t event_queue_cfg;
67 uint32_t event_queue_id;
70 struct dpaa2_eventdev {
71 struct dpaa2_eventq evq_info[DPAA2_EVENT_MAX_QUEUES];
72 uint32_t dequeue_timeout_ns;
73 uint8_t max_event_queues;
74 uint8_t nb_event_queues;
75 uint8_t nb_event_ports;
77 uint32_t nb_event_queue_flows;
78 uint32_t nb_event_port_dequeue_depth;
79 uint32_t nb_event_port_enqueue_depth;
80 uint32_t event_dev_cfg;
83 struct dpaa2_dpcon_dev *rte_dpaa2_alloc_dpcon_dev(void);
84 void rte_dpaa2_free_dpcon_dev(struct dpaa2_dpcon_dev *dpcon);
86 #endif /* __DPAA2_EVENTDEV_H__ */