xref: /dpdk/lib/eventdev/eventdev_pmd.h (revision 99a2dd955fba6e4cc23b77d590a033650ced9c45)
1*99a2dd95SBruce Richardson /* SPDX-License-Identifier: BSD-3-Clause
2*99a2dd95SBruce Richardson  * Copyright(c) 2016 Cavium, Inc
3*99a2dd95SBruce Richardson  */
4*99a2dd95SBruce Richardson 
5*99a2dd95SBruce Richardson #ifndef _RTE_EVENTDEV_PMD_H_
6*99a2dd95SBruce Richardson #define _RTE_EVENTDEV_PMD_H_
7*99a2dd95SBruce Richardson 
8*99a2dd95SBruce Richardson /** @file
9*99a2dd95SBruce Richardson  * RTE Event PMD APIs
10*99a2dd95SBruce Richardson  *
11*99a2dd95SBruce Richardson  * @note
12*99a2dd95SBruce Richardson  * These API are from event PMD only and user applications should not call
13*99a2dd95SBruce Richardson  * them directly.
14*99a2dd95SBruce Richardson  */
15*99a2dd95SBruce Richardson 
16*99a2dd95SBruce Richardson #ifdef __cplusplus
17*99a2dd95SBruce Richardson extern "C" {
18*99a2dd95SBruce Richardson #endif
19*99a2dd95SBruce Richardson 
20*99a2dd95SBruce Richardson #include <string.h>
21*99a2dd95SBruce Richardson 
22*99a2dd95SBruce Richardson #include <rte_common.h>
23*99a2dd95SBruce Richardson #include <rte_compat.h>
24*99a2dd95SBruce Richardson #include <rte_config.h>
25*99a2dd95SBruce Richardson #include <rte_dev.h>
26*99a2dd95SBruce Richardson #include <rte_log.h>
27*99a2dd95SBruce Richardson #include <rte_malloc.h>
28*99a2dd95SBruce Richardson #include <rte_mbuf.h>
29*99a2dd95SBruce Richardson #include <rte_mbuf_dyn.h>
30*99a2dd95SBruce Richardson 
31*99a2dd95SBruce Richardson #include "rte_eventdev.h"
32*99a2dd95SBruce Richardson #include "rte_event_timer_adapter_pmd.h"
33*99a2dd95SBruce Richardson 
34*99a2dd95SBruce Richardson /* Logging Macros */
35*99a2dd95SBruce Richardson #define RTE_EDEV_LOG_ERR(...) \
36*99a2dd95SBruce Richardson 	RTE_LOG(ERR, EVENTDEV, \
37*99a2dd95SBruce Richardson 		RTE_FMT("%s() line %u: " RTE_FMT_HEAD(__VA_ARGS__,) "\n", \
38*99a2dd95SBruce Richardson 			__func__, __LINE__, RTE_FMT_TAIL(__VA_ARGS__,)))
39*99a2dd95SBruce Richardson 
40*99a2dd95SBruce Richardson #ifdef RTE_LIBRTE_EVENTDEV_DEBUG
41*99a2dd95SBruce Richardson #define RTE_EDEV_LOG_DEBUG(...) \
42*99a2dd95SBruce Richardson 	RTE_LOG(DEBUG, EVENTDEV, \
43*99a2dd95SBruce Richardson 		RTE_FMT("%s() line %u: " RTE_FMT_HEAD(__VA_ARGS__,) "\n", \
44*99a2dd95SBruce Richardson 			__func__, __LINE__, RTE_FMT_TAIL(__VA_ARGS__,)))
45*99a2dd95SBruce Richardson #else
46*99a2dd95SBruce Richardson #define RTE_EDEV_LOG_DEBUG(...) (void)0
47*99a2dd95SBruce Richardson #endif
48*99a2dd95SBruce Richardson 
49*99a2dd95SBruce Richardson /* Macros to check for valid device */
50*99a2dd95SBruce Richardson #define RTE_EVENTDEV_VALID_DEVID_OR_ERR_RET(dev_id, retval) do { \
51*99a2dd95SBruce Richardson 	if (!rte_event_pmd_is_valid_dev((dev_id))) { \
52*99a2dd95SBruce Richardson 		RTE_EDEV_LOG_ERR("Invalid dev_id=%d\n", dev_id); \
53*99a2dd95SBruce Richardson 		return retval; \
54*99a2dd95SBruce Richardson 	} \
55*99a2dd95SBruce Richardson } while (0)
56*99a2dd95SBruce Richardson 
57*99a2dd95SBruce Richardson #define RTE_EVENTDEV_VALID_DEVID_OR_ERRNO_RET(dev_id, errno, retval) do { \
58*99a2dd95SBruce Richardson 	if (!rte_event_pmd_is_valid_dev((dev_id))) { \
59*99a2dd95SBruce Richardson 		RTE_EDEV_LOG_ERR("Invalid dev_id=%d\n", dev_id); \
60*99a2dd95SBruce Richardson 		rte_errno = errno; \
61*99a2dd95SBruce Richardson 		return retval; \
62*99a2dd95SBruce Richardson 	} \
63*99a2dd95SBruce Richardson } while (0)
64*99a2dd95SBruce Richardson 
65*99a2dd95SBruce Richardson #define RTE_EVENTDEV_VALID_DEVID_OR_RET(dev_id) do { \
66*99a2dd95SBruce Richardson 	if (!rte_event_pmd_is_valid_dev((dev_id))) { \
67*99a2dd95SBruce Richardson 		RTE_EDEV_LOG_ERR("Invalid dev_id=%d\n", dev_id); \
68*99a2dd95SBruce Richardson 		return; \
69*99a2dd95SBruce Richardson 	} \
70*99a2dd95SBruce Richardson } while (0)
71*99a2dd95SBruce Richardson 
72*99a2dd95SBruce Richardson #define RTE_EVENT_ETH_RX_ADAPTER_SW_CAP                                        \
73*99a2dd95SBruce Richardson 	((RTE_EVENT_ETH_RX_ADAPTER_CAP_OVERRIDE_FLOW_ID) |                     \
74*99a2dd95SBruce Richardson 	 (RTE_EVENT_ETH_RX_ADAPTER_CAP_MULTI_EVENTQ) |                         \
75*99a2dd95SBruce Richardson 	 (RTE_EVENT_ETH_RX_ADAPTER_CAP_EVENT_VECTOR))
76*99a2dd95SBruce Richardson 
77*99a2dd95SBruce Richardson #define RTE_EVENT_CRYPTO_ADAPTER_SW_CAP \
78*99a2dd95SBruce Richardson 		RTE_EVENT_CRYPTO_ADAPTER_CAP_SESSION_PRIVATE_DATA
79*99a2dd95SBruce Richardson 
80*99a2dd95SBruce Richardson /**< Ethernet Rx adapter cap to return If the packet transfers from
81*99a2dd95SBruce Richardson  * the ethdev to eventdev use a SW service function
82*99a2dd95SBruce Richardson  */
83*99a2dd95SBruce Richardson 
84*99a2dd95SBruce Richardson #define RTE_EVENTDEV_DETACHED  (0)
85*99a2dd95SBruce Richardson #define RTE_EVENTDEV_ATTACHED  (1)
86*99a2dd95SBruce Richardson 
87*99a2dd95SBruce Richardson struct rte_eth_dev;
88*99a2dd95SBruce Richardson 
89*99a2dd95SBruce Richardson /** Global structure used for maintaining state of allocated event devices */
90*99a2dd95SBruce Richardson struct rte_eventdev_global {
91*99a2dd95SBruce Richardson 	uint8_t nb_devs;	/**< Number of devices found */
92*99a2dd95SBruce Richardson };
93*99a2dd95SBruce Richardson 
94*99a2dd95SBruce Richardson extern struct rte_eventdev *rte_eventdevs;
95*99a2dd95SBruce Richardson /** The pool of rte_eventdev structures. */
96*99a2dd95SBruce Richardson 
97*99a2dd95SBruce Richardson /**
98*99a2dd95SBruce Richardson  * Get the rte_eventdev structure device pointer for the named device.
99*99a2dd95SBruce Richardson  *
100*99a2dd95SBruce Richardson  * @param name
101*99a2dd95SBruce Richardson  *   device name to select the device structure.
102*99a2dd95SBruce Richardson  *
103*99a2dd95SBruce Richardson  * @return
104*99a2dd95SBruce Richardson  *   - The rte_eventdev structure pointer for the given device ID.
105*99a2dd95SBruce Richardson  */
106*99a2dd95SBruce Richardson static inline struct rte_eventdev *
107*99a2dd95SBruce Richardson rte_event_pmd_get_named_dev(const char *name)
108*99a2dd95SBruce Richardson {
109*99a2dd95SBruce Richardson 	struct rte_eventdev *dev;
110*99a2dd95SBruce Richardson 	unsigned int i;
111*99a2dd95SBruce Richardson 
112*99a2dd95SBruce Richardson 	if (name == NULL)
113*99a2dd95SBruce Richardson 		return NULL;
114*99a2dd95SBruce Richardson 
115*99a2dd95SBruce Richardson 	for (i = 0; i < RTE_EVENT_MAX_DEVS; i++) {
116*99a2dd95SBruce Richardson 		dev = &rte_eventdevs[i];
117*99a2dd95SBruce Richardson 		if ((dev->attached == RTE_EVENTDEV_ATTACHED) &&
118*99a2dd95SBruce Richardson 				(strcmp(dev->data->name, name) == 0))
119*99a2dd95SBruce Richardson 			return dev;
120*99a2dd95SBruce Richardson 	}
121*99a2dd95SBruce Richardson 
122*99a2dd95SBruce Richardson 	return NULL;
123*99a2dd95SBruce Richardson }
124*99a2dd95SBruce Richardson 
125*99a2dd95SBruce Richardson /**
126*99a2dd95SBruce Richardson  * Validate if the event device index is valid attached event device.
127*99a2dd95SBruce Richardson  *
128*99a2dd95SBruce Richardson  * @param dev_id
129*99a2dd95SBruce Richardson  *   Event device index.
130*99a2dd95SBruce Richardson  *
131*99a2dd95SBruce Richardson  * @return
132*99a2dd95SBruce Richardson  *   - If the device index is valid (1) or not (0).
133*99a2dd95SBruce Richardson  */
134*99a2dd95SBruce Richardson static inline unsigned
135*99a2dd95SBruce Richardson rte_event_pmd_is_valid_dev(uint8_t dev_id)
136*99a2dd95SBruce Richardson {
137*99a2dd95SBruce Richardson 	struct rte_eventdev *dev;
138*99a2dd95SBruce Richardson 
139*99a2dd95SBruce Richardson 	if (dev_id >= RTE_EVENT_MAX_DEVS)
140*99a2dd95SBruce Richardson 		return 0;
141*99a2dd95SBruce Richardson 
142*99a2dd95SBruce Richardson 	dev = &rte_eventdevs[dev_id];
143*99a2dd95SBruce Richardson 	if (dev->attached != RTE_EVENTDEV_ATTACHED)
144*99a2dd95SBruce Richardson 		return 0;
145*99a2dd95SBruce Richardson 	else
146*99a2dd95SBruce Richardson 		return 1;
147*99a2dd95SBruce Richardson }
148*99a2dd95SBruce Richardson 
149*99a2dd95SBruce Richardson /**
150*99a2dd95SBruce Richardson  * Definitions of all functions exported by a driver through the
151*99a2dd95SBruce Richardson  * the generic structure of type *event_dev_ops* supplied in the
152*99a2dd95SBruce Richardson  * *rte_eventdev* structure associated with a device.
153*99a2dd95SBruce Richardson  */
154*99a2dd95SBruce Richardson 
155*99a2dd95SBruce Richardson /**
156*99a2dd95SBruce Richardson  * Get device information of a device.
157*99a2dd95SBruce Richardson  *
158*99a2dd95SBruce Richardson  * @param dev
159*99a2dd95SBruce Richardson  *   Event device pointer
160*99a2dd95SBruce Richardson  * @param dev_info
161*99a2dd95SBruce Richardson  *   Event device information structure
162*99a2dd95SBruce Richardson  */
163*99a2dd95SBruce Richardson typedef void (*eventdev_info_get_t)(struct rte_eventdev *dev,
164*99a2dd95SBruce Richardson 		struct rte_event_dev_info *dev_info);
165*99a2dd95SBruce Richardson 
166*99a2dd95SBruce Richardson /**
167*99a2dd95SBruce Richardson  * Configure a device.
168*99a2dd95SBruce Richardson  *
169*99a2dd95SBruce Richardson  * @param dev
170*99a2dd95SBruce Richardson  *   Event device pointer
171*99a2dd95SBruce Richardson  *
172*99a2dd95SBruce Richardson  * @return
173*99a2dd95SBruce Richardson  *   Returns 0 on success
174*99a2dd95SBruce Richardson  */
175*99a2dd95SBruce Richardson typedef int (*eventdev_configure_t)(const struct rte_eventdev *dev);
176*99a2dd95SBruce Richardson 
177*99a2dd95SBruce Richardson /**
178*99a2dd95SBruce Richardson  * Start a configured device.
179*99a2dd95SBruce Richardson  *
180*99a2dd95SBruce Richardson  * @param dev
181*99a2dd95SBruce Richardson  *   Event device pointer
182*99a2dd95SBruce Richardson  *
183*99a2dd95SBruce Richardson  * @return
184*99a2dd95SBruce Richardson  *   Returns 0 on success
185*99a2dd95SBruce Richardson  */
186*99a2dd95SBruce Richardson typedef int (*eventdev_start_t)(struct rte_eventdev *dev);
187*99a2dd95SBruce Richardson 
188*99a2dd95SBruce Richardson /**
189*99a2dd95SBruce Richardson  * Stop a configured device.
190*99a2dd95SBruce Richardson  *
191*99a2dd95SBruce Richardson  * @param dev
192*99a2dd95SBruce Richardson  *   Event device pointer
193*99a2dd95SBruce Richardson  */
194*99a2dd95SBruce Richardson typedef void (*eventdev_stop_t)(struct rte_eventdev *dev);
195*99a2dd95SBruce Richardson 
196*99a2dd95SBruce Richardson /**
197*99a2dd95SBruce Richardson  * Close a configured device.
198*99a2dd95SBruce Richardson  *
199*99a2dd95SBruce Richardson  * @param dev
200*99a2dd95SBruce Richardson  *   Event device pointer
201*99a2dd95SBruce Richardson  *
202*99a2dd95SBruce Richardson  * @return
203*99a2dd95SBruce Richardson  * - 0 on success
204*99a2dd95SBruce Richardson  * - (-EAGAIN) if can't close as device is busy
205*99a2dd95SBruce Richardson  */
206*99a2dd95SBruce Richardson typedef int (*eventdev_close_t)(struct rte_eventdev *dev);
207*99a2dd95SBruce Richardson 
208*99a2dd95SBruce Richardson /**
209*99a2dd95SBruce Richardson  * Retrieve the default event queue configuration.
210*99a2dd95SBruce Richardson  *
211*99a2dd95SBruce Richardson  * @param dev
212*99a2dd95SBruce Richardson  *   Event device pointer
213*99a2dd95SBruce Richardson  * @param queue_id
214*99a2dd95SBruce Richardson  *   Event queue index
215*99a2dd95SBruce Richardson  * @param[out] queue_conf
216*99a2dd95SBruce Richardson  *   Event queue configuration structure
217*99a2dd95SBruce Richardson  *
218*99a2dd95SBruce Richardson  */
219*99a2dd95SBruce Richardson typedef void (*eventdev_queue_default_conf_get_t)(struct rte_eventdev *dev,
220*99a2dd95SBruce Richardson 		uint8_t queue_id, struct rte_event_queue_conf *queue_conf);
221*99a2dd95SBruce Richardson 
222*99a2dd95SBruce Richardson /**
223*99a2dd95SBruce Richardson  * Setup an event queue.
224*99a2dd95SBruce Richardson  *
225*99a2dd95SBruce Richardson  * @param dev
226*99a2dd95SBruce Richardson  *   Event device pointer
227*99a2dd95SBruce Richardson  * @param queue_id
228*99a2dd95SBruce Richardson  *   Event queue index
229*99a2dd95SBruce Richardson  * @param queue_conf
230*99a2dd95SBruce Richardson  *   Event queue configuration structure
231*99a2dd95SBruce Richardson  *
232*99a2dd95SBruce Richardson  * @return
233*99a2dd95SBruce Richardson  *   Returns 0 on success.
234*99a2dd95SBruce Richardson  */
235*99a2dd95SBruce Richardson typedef int (*eventdev_queue_setup_t)(struct rte_eventdev *dev,
236*99a2dd95SBruce Richardson 		uint8_t queue_id,
237*99a2dd95SBruce Richardson 		const struct rte_event_queue_conf *queue_conf);
238*99a2dd95SBruce Richardson 
239*99a2dd95SBruce Richardson /**
240*99a2dd95SBruce Richardson  * Release resources allocated by given event queue.
241*99a2dd95SBruce Richardson  *
242*99a2dd95SBruce Richardson  * @param dev
243*99a2dd95SBruce Richardson  *   Event device pointer
244*99a2dd95SBruce Richardson  * @param queue_id
245*99a2dd95SBruce Richardson  *   Event queue index
246*99a2dd95SBruce Richardson  *
247*99a2dd95SBruce Richardson  */
248*99a2dd95SBruce Richardson typedef void (*eventdev_queue_release_t)(struct rte_eventdev *dev,
249*99a2dd95SBruce Richardson 		uint8_t queue_id);
250*99a2dd95SBruce Richardson 
251*99a2dd95SBruce Richardson /**
252*99a2dd95SBruce Richardson  * Retrieve the default event port configuration.
253*99a2dd95SBruce Richardson  *
254*99a2dd95SBruce Richardson  * @param dev
255*99a2dd95SBruce Richardson  *   Event device pointer
256*99a2dd95SBruce Richardson  * @param port_id
257*99a2dd95SBruce Richardson  *   Event port index
258*99a2dd95SBruce Richardson  * @param[out] port_conf
259*99a2dd95SBruce Richardson  *   Event port configuration structure
260*99a2dd95SBruce Richardson  *
261*99a2dd95SBruce Richardson  */
262*99a2dd95SBruce Richardson typedef void (*eventdev_port_default_conf_get_t)(struct rte_eventdev *dev,
263*99a2dd95SBruce Richardson 		uint8_t port_id, struct rte_event_port_conf *port_conf);
264*99a2dd95SBruce Richardson 
265*99a2dd95SBruce Richardson /**
266*99a2dd95SBruce Richardson  * Setup an event port.
267*99a2dd95SBruce Richardson  *
268*99a2dd95SBruce Richardson  * @param dev
269*99a2dd95SBruce Richardson  *   Event device pointer
270*99a2dd95SBruce Richardson  * @param port_id
271*99a2dd95SBruce Richardson  *   Event port index
272*99a2dd95SBruce Richardson  * @param port_conf
273*99a2dd95SBruce Richardson  *   Event port configuration structure
274*99a2dd95SBruce Richardson  *
275*99a2dd95SBruce Richardson  * @return
276*99a2dd95SBruce Richardson  *   Returns 0 on success.
277*99a2dd95SBruce Richardson  */
278*99a2dd95SBruce Richardson typedef int (*eventdev_port_setup_t)(struct rte_eventdev *dev,
279*99a2dd95SBruce Richardson 		uint8_t port_id,
280*99a2dd95SBruce Richardson 		const struct rte_event_port_conf *port_conf);
281*99a2dd95SBruce Richardson 
282*99a2dd95SBruce Richardson /**
283*99a2dd95SBruce Richardson  * Release memory resources allocated by given event port.
284*99a2dd95SBruce Richardson  *
285*99a2dd95SBruce Richardson  * @param port
286*99a2dd95SBruce Richardson  *   Event port pointer
287*99a2dd95SBruce Richardson  *
288*99a2dd95SBruce Richardson  */
289*99a2dd95SBruce Richardson typedef void (*eventdev_port_release_t)(void *port);
290*99a2dd95SBruce Richardson 
291*99a2dd95SBruce Richardson /**
292*99a2dd95SBruce Richardson  * Link multiple source event queues to destination event port.
293*99a2dd95SBruce Richardson  *
294*99a2dd95SBruce Richardson  * @param dev
295*99a2dd95SBruce Richardson  *   Event device pointer
296*99a2dd95SBruce Richardson  * @param port
297*99a2dd95SBruce Richardson  *   Event port pointer
298*99a2dd95SBruce Richardson  * @param queues
299*99a2dd95SBruce Richardson  *   Points to an array of *nb_links* event queues to be linked
300*99a2dd95SBruce Richardson  *   to the event port.
301*99a2dd95SBruce Richardson  * @param priorities
302*99a2dd95SBruce Richardson  *   Points to an array of *nb_links* service priorities associated with each
303*99a2dd95SBruce Richardson  *   event queue link to event port.
304*99a2dd95SBruce Richardson  * @param nb_links
305*99a2dd95SBruce Richardson  *   The number of links to establish
306*99a2dd95SBruce Richardson  *
307*99a2dd95SBruce Richardson  * @return
308*99a2dd95SBruce Richardson  *   Returns 0 on success.
309*99a2dd95SBruce Richardson  *
310*99a2dd95SBruce Richardson  */
311*99a2dd95SBruce Richardson typedef int (*eventdev_port_link_t)(struct rte_eventdev *dev, void *port,
312*99a2dd95SBruce Richardson 		const uint8_t queues[], const uint8_t priorities[],
313*99a2dd95SBruce Richardson 		uint16_t nb_links);
314*99a2dd95SBruce Richardson 
315*99a2dd95SBruce Richardson /**
316*99a2dd95SBruce Richardson  * Unlink multiple source event queues from destination event port.
317*99a2dd95SBruce Richardson  *
318*99a2dd95SBruce Richardson  * @param dev
319*99a2dd95SBruce Richardson  *   Event device pointer
320*99a2dd95SBruce Richardson  * @param port
321*99a2dd95SBruce Richardson  *   Event port pointer
322*99a2dd95SBruce Richardson  * @param queues
323*99a2dd95SBruce Richardson  *   An array of *nb_unlinks* event queues to be unlinked from the event port.
324*99a2dd95SBruce Richardson  * @param nb_unlinks
325*99a2dd95SBruce Richardson  *   The number of unlinks to establish
326*99a2dd95SBruce Richardson  *
327*99a2dd95SBruce Richardson  * @return
328*99a2dd95SBruce Richardson  *   Returns 0 on success.
329*99a2dd95SBruce Richardson  *
330*99a2dd95SBruce Richardson  */
331*99a2dd95SBruce Richardson typedef int (*eventdev_port_unlink_t)(struct rte_eventdev *dev, void *port,
332*99a2dd95SBruce Richardson 		uint8_t queues[], uint16_t nb_unlinks);
333*99a2dd95SBruce Richardson 
334*99a2dd95SBruce Richardson /**
335*99a2dd95SBruce Richardson  * Unlinks in progress. Returns number of unlinks that the PMD is currently
336*99a2dd95SBruce Richardson  * performing, but have not yet been completed.
337*99a2dd95SBruce Richardson  *
338*99a2dd95SBruce Richardson  * @param dev
339*99a2dd95SBruce Richardson  *   Event device pointer
340*99a2dd95SBruce Richardson  *
341*99a2dd95SBruce Richardson  * @param port
342*99a2dd95SBruce Richardson  *   Event port pointer
343*99a2dd95SBruce Richardson  *
344*99a2dd95SBruce Richardson  * @return
345*99a2dd95SBruce Richardson  *   Returns the number of in-progress unlinks. Zero is returned if none are
346*99a2dd95SBruce Richardson  *   in progress.
347*99a2dd95SBruce Richardson  */
348*99a2dd95SBruce Richardson typedef int (*eventdev_port_unlinks_in_progress_t)(struct rte_eventdev *dev,
349*99a2dd95SBruce Richardson 		void *port);
350*99a2dd95SBruce Richardson 
351*99a2dd95SBruce Richardson /**
352*99a2dd95SBruce Richardson  * Converts nanoseconds to *timeout_ticks* value for rte_event_dequeue()
353*99a2dd95SBruce Richardson  *
354*99a2dd95SBruce Richardson  * @param dev
355*99a2dd95SBruce Richardson  *   Event device pointer
356*99a2dd95SBruce Richardson  * @param ns
357*99a2dd95SBruce Richardson  *   Wait time in nanosecond
358*99a2dd95SBruce Richardson  * @param[out] timeout_ticks
359*99a2dd95SBruce Richardson  *   Value for the *timeout_ticks* parameter in rte_event_dequeue() function
360*99a2dd95SBruce Richardson  *
361*99a2dd95SBruce Richardson  * @return
362*99a2dd95SBruce Richardson  *   Returns 0 on success.
363*99a2dd95SBruce Richardson  *
364*99a2dd95SBruce Richardson  */
365*99a2dd95SBruce Richardson typedef int (*eventdev_dequeue_timeout_ticks_t)(struct rte_eventdev *dev,
366*99a2dd95SBruce Richardson 		uint64_t ns, uint64_t *timeout_ticks);
367*99a2dd95SBruce Richardson 
368*99a2dd95SBruce Richardson /**
369*99a2dd95SBruce Richardson  * Dump internal information
370*99a2dd95SBruce Richardson  *
371*99a2dd95SBruce Richardson  * @param dev
372*99a2dd95SBruce Richardson  *   Event device pointer
373*99a2dd95SBruce Richardson  * @param f
374*99a2dd95SBruce Richardson  *   A pointer to a file for output
375*99a2dd95SBruce Richardson  *
376*99a2dd95SBruce Richardson  */
377*99a2dd95SBruce Richardson typedef void (*eventdev_dump_t)(struct rte_eventdev *dev, FILE *f);
378*99a2dd95SBruce Richardson 
379*99a2dd95SBruce Richardson /**
380*99a2dd95SBruce Richardson  * Retrieve a set of statistics from device
381*99a2dd95SBruce Richardson  *
382*99a2dd95SBruce Richardson  * @param dev
383*99a2dd95SBruce Richardson  *   Event device pointer
384*99a2dd95SBruce Richardson  * @param mode
385*99a2dd95SBruce Richardson  *   Level (device, port or queue)
386*99a2dd95SBruce Richardson  * @param queue_port_id
387*99a2dd95SBruce Richardson  *   Queue or port number depending on mode
388*99a2dd95SBruce Richardson  * @param ids
389*99a2dd95SBruce Richardson  *   The stat ids to retrieve
390*99a2dd95SBruce Richardson  * @param values
391*99a2dd95SBruce Richardson  *   The returned stat values
392*99a2dd95SBruce Richardson  * @param n
393*99a2dd95SBruce Richardson  *   The number of id values and entries in the values array
394*99a2dd95SBruce Richardson  * @return
395*99a2dd95SBruce Richardson  *   The number of stat values successfully filled into the values array
396*99a2dd95SBruce Richardson  */
397*99a2dd95SBruce Richardson typedef int (*eventdev_xstats_get_t)(const struct rte_eventdev *dev,
398*99a2dd95SBruce Richardson 		enum rte_event_dev_xstats_mode mode, uint8_t queue_port_id,
399*99a2dd95SBruce Richardson 		const unsigned int ids[], uint64_t values[], unsigned int n);
400*99a2dd95SBruce Richardson 
401*99a2dd95SBruce Richardson /**
402*99a2dd95SBruce Richardson  * Resets the statistic values in xstats for the device, based on mode.
403*99a2dd95SBruce Richardson  */
404*99a2dd95SBruce Richardson typedef int (*eventdev_xstats_reset_t)(struct rte_eventdev *dev,
405*99a2dd95SBruce Richardson 		enum rte_event_dev_xstats_mode mode,
406*99a2dd95SBruce Richardson 		int16_t queue_port_id,
407*99a2dd95SBruce Richardson 		const uint32_t ids[],
408*99a2dd95SBruce Richardson 		uint32_t nb_ids);
409*99a2dd95SBruce Richardson 
410*99a2dd95SBruce Richardson /**
411*99a2dd95SBruce Richardson  * Get names of extended stats of an event device
412*99a2dd95SBruce Richardson  *
413*99a2dd95SBruce Richardson  * @param dev
414*99a2dd95SBruce Richardson  *   Event device pointer
415*99a2dd95SBruce Richardson  * @param mode
416*99a2dd95SBruce Richardson  *   Level (device, port or queue)
417*99a2dd95SBruce Richardson  * @param queue_port_id
418*99a2dd95SBruce Richardson  *   Queue or port number depending on mode
419*99a2dd95SBruce Richardson  * @param xstats_names
420*99a2dd95SBruce Richardson  *   Array of name values to be filled in
421*99a2dd95SBruce Richardson  * @param ids
422*99a2dd95SBruce Richardson  *   The stat ids to retrieve
423*99a2dd95SBruce Richardson  * @param size
424*99a2dd95SBruce Richardson  *   Number of values in the xstats_names array
425*99a2dd95SBruce Richardson  * @return
426*99a2dd95SBruce Richardson  *   When size >= the number of stats, return the number of stat values filled
427*99a2dd95SBruce Richardson  *   into the array.
428*99a2dd95SBruce Richardson  *   When size < the number of available stats, return the number of stats
429*99a2dd95SBruce Richardson  *   values, and do not fill in any data into xstats_names.
430*99a2dd95SBruce Richardson  */
431*99a2dd95SBruce Richardson typedef int (*eventdev_xstats_get_names_t)(const struct rte_eventdev *dev,
432*99a2dd95SBruce Richardson 		enum rte_event_dev_xstats_mode mode, uint8_t queue_port_id,
433*99a2dd95SBruce Richardson 		struct rte_event_dev_xstats_name *xstats_names,
434*99a2dd95SBruce Richardson 		unsigned int *ids, unsigned int size);
435*99a2dd95SBruce Richardson 
436*99a2dd95SBruce Richardson /**
437*99a2dd95SBruce Richardson  * Get value of one stats and optionally return its id
438*99a2dd95SBruce Richardson  *
439*99a2dd95SBruce Richardson  * @param dev
440*99a2dd95SBruce Richardson  *   Event device pointer
441*99a2dd95SBruce Richardson  * @param name
442*99a2dd95SBruce Richardson  *   The name of the stat to retrieve
443*99a2dd95SBruce Richardson  * @param id
444*99a2dd95SBruce Richardson  *   Pointer to an unsigned int where we store the stat-id for future reference.
445*99a2dd95SBruce Richardson  *   This pointer may be null if the id is not required.
446*99a2dd95SBruce Richardson  * @return
447*99a2dd95SBruce Richardson  *   The value of the stat, or (uint64_t)-1 if the stat is not found.
448*99a2dd95SBruce Richardson  *   If the stat is not found, the id value will be returned as (unsigned)-1,
449*99a2dd95SBruce Richardson  *   if id pointer is non-NULL
450*99a2dd95SBruce Richardson  */
451*99a2dd95SBruce Richardson typedef uint64_t (*eventdev_xstats_get_by_name)(const struct rte_eventdev *dev,
452*99a2dd95SBruce Richardson 		const char *name, unsigned int *id);
453*99a2dd95SBruce Richardson 
454*99a2dd95SBruce Richardson 
455*99a2dd95SBruce Richardson /**
456*99a2dd95SBruce Richardson  * Retrieve the event device's ethdev Rx adapter capabilities for the
457*99a2dd95SBruce Richardson  * specified ethernet port
458*99a2dd95SBruce Richardson  *
459*99a2dd95SBruce Richardson  * @param dev
460*99a2dd95SBruce Richardson  *   Event device pointer
461*99a2dd95SBruce Richardson  *
462*99a2dd95SBruce Richardson  * @param eth_dev
463*99a2dd95SBruce Richardson  *   Ethernet device pointer
464*99a2dd95SBruce Richardson  *
465*99a2dd95SBruce Richardson  * @param[out] caps
466*99a2dd95SBruce Richardson  *   A pointer to memory filled with Rx event adapter capabilities.
467*99a2dd95SBruce Richardson  *
468*99a2dd95SBruce Richardson  * @return
469*99a2dd95SBruce Richardson  *   - 0: Success, driver provides Rx event adapter capabilities for the
470*99a2dd95SBruce Richardson  *	ethernet device.
471*99a2dd95SBruce Richardson  *   - <0: Error code returned by the driver function.
472*99a2dd95SBruce Richardson  *
473*99a2dd95SBruce Richardson  */
474*99a2dd95SBruce Richardson typedef int (*eventdev_eth_rx_adapter_caps_get_t)
475*99a2dd95SBruce Richardson 					(const struct rte_eventdev *dev,
476*99a2dd95SBruce Richardson 					const struct rte_eth_dev *eth_dev,
477*99a2dd95SBruce Richardson 					uint32_t *caps);
478*99a2dd95SBruce Richardson 
479*99a2dd95SBruce Richardson struct rte_event_eth_rx_adapter_queue_conf;
480*99a2dd95SBruce Richardson 
481*99a2dd95SBruce Richardson /**
482*99a2dd95SBruce Richardson  * Retrieve the event device's timer adapter capabilities, as well as the ops
483*99a2dd95SBruce Richardson  * structure that an event timer adapter should call through to enter the
484*99a2dd95SBruce Richardson  * driver
485*99a2dd95SBruce Richardson  *
486*99a2dd95SBruce Richardson  * @param dev
487*99a2dd95SBruce Richardson  *   Event device pointer
488*99a2dd95SBruce Richardson  *
489*99a2dd95SBruce Richardson  * @param flags
490*99a2dd95SBruce Richardson  *   Flags that can be used to determine how to select an event timer
491*99a2dd95SBruce Richardson  *   adapter ops structure
492*99a2dd95SBruce Richardson  *
493*99a2dd95SBruce Richardson  * @param[out] caps
494*99a2dd95SBruce Richardson  *   A pointer to memory filled with Rx event adapter capabilities.
495*99a2dd95SBruce Richardson  *
496*99a2dd95SBruce Richardson  * @param[out] ops
497*99a2dd95SBruce Richardson  *   A pointer to the ops pointer to set with the address of the desired ops
498*99a2dd95SBruce Richardson  *   structure
499*99a2dd95SBruce Richardson  *
500*99a2dd95SBruce Richardson  * @return
501*99a2dd95SBruce Richardson  *   - 0: Success, driver provides Rx event adapter capabilities for the
502*99a2dd95SBruce Richardson  *	ethernet device.
503*99a2dd95SBruce Richardson  *   - <0: Error code returned by the driver function.
504*99a2dd95SBruce Richardson  *
505*99a2dd95SBruce Richardson  */
506*99a2dd95SBruce Richardson typedef int (*eventdev_timer_adapter_caps_get_t)(
507*99a2dd95SBruce Richardson 				const struct rte_eventdev *dev,
508*99a2dd95SBruce Richardson 				uint64_t flags,
509*99a2dd95SBruce Richardson 				uint32_t *caps,
510*99a2dd95SBruce Richardson 				const struct rte_event_timer_adapter_ops **ops);
511*99a2dd95SBruce Richardson 
512*99a2dd95SBruce Richardson /**
513*99a2dd95SBruce Richardson  * Add ethernet Rx queues to event device. This callback is invoked if
514*99a2dd95SBruce Richardson  * the caps returned from rte_eventdev_eth_rx_adapter_caps_get(, eth_port_id)
515*99a2dd95SBruce Richardson  * has RTE_EVENT_ETH_RX_ADAPTER_CAP_INTERNAL_PORT set.
516*99a2dd95SBruce Richardson  *
517*99a2dd95SBruce Richardson  * @param dev
518*99a2dd95SBruce Richardson  *   Event device pointer
519*99a2dd95SBruce Richardson  *
520*99a2dd95SBruce Richardson  * @param eth_dev
521*99a2dd95SBruce Richardson  *   Ethernet device pointer
522*99a2dd95SBruce Richardson  *
523*99a2dd95SBruce Richardson  * @param rx_queue_id
524*99a2dd95SBruce Richardson  *   Ethernet device receive queue index
525*99a2dd95SBruce Richardson  *
526*99a2dd95SBruce Richardson  * @param queue_conf
527*99a2dd95SBruce Richardson  *  Additional configuration structure
528*99a2dd95SBruce Richardson 
529*99a2dd95SBruce Richardson  * @return
530*99a2dd95SBruce Richardson  *   - 0: Success, ethernet receive queue added successfully.
531*99a2dd95SBruce Richardson  *   - <0: Error code returned by the driver function.
532*99a2dd95SBruce Richardson  *
533*99a2dd95SBruce Richardson  */
534*99a2dd95SBruce Richardson typedef int (*eventdev_eth_rx_adapter_queue_add_t)(
535*99a2dd95SBruce Richardson 		const struct rte_eventdev *dev,
536*99a2dd95SBruce Richardson 		const struct rte_eth_dev *eth_dev,
537*99a2dd95SBruce Richardson 		int32_t rx_queue_id,
538*99a2dd95SBruce Richardson 		const struct rte_event_eth_rx_adapter_queue_conf *queue_conf);
539*99a2dd95SBruce Richardson 
540*99a2dd95SBruce Richardson /**
541*99a2dd95SBruce Richardson  * Delete ethernet Rx queues from event device. This callback is invoked if
542*99a2dd95SBruce Richardson  * the caps returned from eventdev_eth_rx_adapter_caps_get(, eth_port_id)
543*99a2dd95SBruce Richardson  * has RTE_EVENT_ETH_RX_ADAPTER_CAP_INTERNAL_PORT set.
544*99a2dd95SBruce Richardson  *
545*99a2dd95SBruce Richardson  * @param dev
546*99a2dd95SBruce Richardson  *   Event device pointer
547*99a2dd95SBruce Richardson  *
548*99a2dd95SBruce Richardson  * @param eth_dev
549*99a2dd95SBruce Richardson  *   Ethernet device pointer
550*99a2dd95SBruce Richardson  *
551*99a2dd95SBruce Richardson  * @param rx_queue_id
552*99a2dd95SBruce Richardson  *   Ethernet device receive queue index
553*99a2dd95SBruce Richardson  *
554*99a2dd95SBruce Richardson  * @return
555*99a2dd95SBruce Richardson  *   - 0: Success, ethernet receive queue deleted successfully.
556*99a2dd95SBruce Richardson  *   - <0: Error code returned by the driver function.
557*99a2dd95SBruce Richardson  *
558*99a2dd95SBruce Richardson  */
559*99a2dd95SBruce Richardson typedef int (*eventdev_eth_rx_adapter_queue_del_t)
560*99a2dd95SBruce Richardson 					(const struct rte_eventdev *dev,
561*99a2dd95SBruce Richardson 					const struct rte_eth_dev *eth_dev,
562*99a2dd95SBruce Richardson 					int32_t rx_queue_id);
563*99a2dd95SBruce Richardson 
564*99a2dd95SBruce Richardson /**
565*99a2dd95SBruce Richardson  * Start ethernet Rx adapter. This callback is invoked if
566*99a2dd95SBruce Richardson  * the caps returned from eventdev_eth_rx_adapter_caps_get(.., eth_port_id)
567*99a2dd95SBruce Richardson  * has RTE_EVENT_ETH_RX_ADAPTER_CAP_INTERNAL_PORT set and Rx queues
568*99a2dd95SBruce Richardson  * from eth_port_id have been added to the event device.
569*99a2dd95SBruce Richardson  *
570*99a2dd95SBruce Richardson  * @param dev
571*99a2dd95SBruce Richardson  *   Event device pointer
572*99a2dd95SBruce Richardson  *
573*99a2dd95SBruce Richardson  * @param eth_dev
574*99a2dd95SBruce Richardson  *   Ethernet device pointer
575*99a2dd95SBruce Richardson  *
576*99a2dd95SBruce Richardson  * @return
577*99a2dd95SBruce Richardson  *   - 0: Success, ethernet Rx adapter started successfully.
578*99a2dd95SBruce Richardson  *   - <0: Error code returned by the driver function.
579*99a2dd95SBruce Richardson  */
580*99a2dd95SBruce Richardson typedef int (*eventdev_eth_rx_adapter_start_t)
581*99a2dd95SBruce Richardson 					(const struct rte_eventdev *dev,
582*99a2dd95SBruce Richardson 					const struct rte_eth_dev *eth_dev);
583*99a2dd95SBruce Richardson 
584*99a2dd95SBruce Richardson /**
585*99a2dd95SBruce Richardson  * Stop ethernet Rx adapter. This callback is invoked if
586*99a2dd95SBruce Richardson  * the caps returned from eventdev_eth_rx_adapter_caps_get(..,eth_port_id)
587*99a2dd95SBruce Richardson  * has RTE_EVENT_ETH_RX_ADAPTER_CAP_INTERNAL_PORT set and Rx queues
588*99a2dd95SBruce Richardson  * from eth_port_id have been added to the event device.
589*99a2dd95SBruce Richardson  *
590*99a2dd95SBruce Richardson  * @param dev
591*99a2dd95SBruce Richardson  *   Event device pointer
592*99a2dd95SBruce Richardson  *
593*99a2dd95SBruce Richardson  * @param eth_dev
594*99a2dd95SBruce Richardson  *   Ethernet device pointer
595*99a2dd95SBruce Richardson  *
596*99a2dd95SBruce Richardson  * @return
597*99a2dd95SBruce Richardson  *   - 0: Success, ethernet Rx adapter stopped successfully.
598*99a2dd95SBruce Richardson  *   - <0: Error code returned by the driver function.
599*99a2dd95SBruce Richardson  */
600*99a2dd95SBruce Richardson typedef int (*eventdev_eth_rx_adapter_stop_t)
601*99a2dd95SBruce Richardson 					(const struct rte_eventdev *dev,
602*99a2dd95SBruce Richardson 					const struct rte_eth_dev *eth_dev);
603*99a2dd95SBruce Richardson 
604*99a2dd95SBruce Richardson struct rte_event_eth_rx_adapter_stats;
605*99a2dd95SBruce Richardson 
606*99a2dd95SBruce Richardson /**
607*99a2dd95SBruce Richardson  * Retrieve ethernet Rx adapter statistics.
608*99a2dd95SBruce Richardson  *
609*99a2dd95SBruce Richardson  * @param dev
610*99a2dd95SBruce Richardson  *   Event device pointer
611*99a2dd95SBruce Richardson  *
612*99a2dd95SBruce Richardson  * @param eth_dev
613*99a2dd95SBruce Richardson  *   Ethernet device pointer
614*99a2dd95SBruce Richardson  *
615*99a2dd95SBruce Richardson  * @param[out] stats
616*99a2dd95SBruce Richardson  *   Pointer to stats structure
617*99a2dd95SBruce Richardson  *
618*99a2dd95SBruce Richardson  * @return
619*99a2dd95SBruce Richardson  *   Return 0 on success.
620*99a2dd95SBruce Richardson  */
621*99a2dd95SBruce Richardson 
622*99a2dd95SBruce Richardson typedef int (*eventdev_eth_rx_adapter_stats_get)
623*99a2dd95SBruce Richardson 			(const struct rte_eventdev *dev,
624*99a2dd95SBruce Richardson 			const struct rte_eth_dev *eth_dev,
625*99a2dd95SBruce Richardson 			struct rte_event_eth_rx_adapter_stats *stats);
626*99a2dd95SBruce Richardson /**
627*99a2dd95SBruce Richardson  * Reset ethernet Rx adapter statistics.
628*99a2dd95SBruce Richardson  *
629*99a2dd95SBruce Richardson  * @param dev
630*99a2dd95SBruce Richardson  *   Event device pointer
631*99a2dd95SBruce Richardson  *
632*99a2dd95SBruce Richardson  * @param eth_dev
633*99a2dd95SBruce Richardson  *   Ethernet device pointer
634*99a2dd95SBruce Richardson  *
635*99a2dd95SBruce Richardson  * @return
636*99a2dd95SBruce Richardson  *   Return 0 on success.
637*99a2dd95SBruce Richardson  */
638*99a2dd95SBruce Richardson typedef int (*eventdev_eth_rx_adapter_stats_reset)
639*99a2dd95SBruce Richardson 			(const struct rte_eventdev *dev,
640*99a2dd95SBruce Richardson 			const struct rte_eth_dev *eth_dev);
641*99a2dd95SBruce Richardson /**
642*99a2dd95SBruce Richardson  * Start eventdev selftest.
643*99a2dd95SBruce Richardson  *
644*99a2dd95SBruce Richardson  * @return
645*99a2dd95SBruce Richardson  *   Return 0 on success.
646*99a2dd95SBruce Richardson  */
647*99a2dd95SBruce Richardson typedef int (*eventdev_selftest)(void);
648*99a2dd95SBruce Richardson 
649*99a2dd95SBruce Richardson struct rte_event_eth_rx_adapter_vector_limits;
650*99a2dd95SBruce Richardson /**
651*99a2dd95SBruce Richardson  * Get event vector limits for a given event, ethernet device pair.
652*99a2dd95SBruce Richardson  *
653*99a2dd95SBruce Richardson  * @param dev
654*99a2dd95SBruce Richardson  *   Event device pointer
655*99a2dd95SBruce Richardson  *
656*99a2dd95SBruce Richardson  * @param eth_dev
657*99a2dd95SBruce Richardson  *   Ethernet device pointer
658*99a2dd95SBruce Richardson  *
659*99a2dd95SBruce Richardson  * @param[out] limits
660*99a2dd95SBruce Richardson  *   Pointer to the limits structure to be filled.
661*99a2dd95SBruce Richardson  *
662*99a2dd95SBruce Richardson  * @return
663*99a2dd95SBruce Richardson  *   - 0: Success.
664*99a2dd95SBruce Richardson  *   - <0: Error code returned by the driver function.
665*99a2dd95SBruce Richardson  */
666*99a2dd95SBruce Richardson typedef int (*eventdev_eth_rx_adapter_vector_limits_get_t)(
667*99a2dd95SBruce Richardson 	const struct rte_eventdev *dev, const struct rte_eth_dev *eth_dev,
668*99a2dd95SBruce Richardson 	struct rte_event_eth_rx_adapter_vector_limits *limits);
669*99a2dd95SBruce Richardson 
670*99a2dd95SBruce Richardson struct rte_event_eth_rx_adapter_event_vector_config;
671*99a2dd95SBruce Richardson /**
672*99a2dd95SBruce Richardson  * Enable event vector on an given Rx queue of a ethernet devices belonging to
673*99a2dd95SBruce Richardson  * the Rx adapter.
674*99a2dd95SBruce Richardson  *
675*99a2dd95SBruce Richardson  * @param dev
676*99a2dd95SBruce Richardson  *   Event device pointer
677*99a2dd95SBruce Richardson  *
678*99a2dd95SBruce Richardson  * @param eth_dev
679*99a2dd95SBruce Richardson  *   Ethernet device pointer
680*99a2dd95SBruce Richardson  *
681*99a2dd95SBruce Richardson  * @param rx_queue_id
682*99a2dd95SBruce Richardson  *   The Rx queue identifier
683*99a2dd95SBruce Richardson  *
684*99a2dd95SBruce Richardson  * @param config
685*99a2dd95SBruce Richardson  *   Pointer to the event vector configuration structure.
686*99a2dd95SBruce Richardson  *
687*99a2dd95SBruce Richardson  * @return
688*99a2dd95SBruce Richardson  *   - 0: Success.
689*99a2dd95SBruce Richardson  *   - <0: Error code returned by the driver function.
690*99a2dd95SBruce Richardson  */
691*99a2dd95SBruce Richardson typedef int (*eventdev_eth_rx_adapter_event_vector_config_t)(
692*99a2dd95SBruce Richardson 	const struct rte_eventdev *dev, const struct rte_eth_dev *eth_dev,
693*99a2dd95SBruce Richardson 	int32_t rx_queue_id,
694*99a2dd95SBruce Richardson 	const struct rte_event_eth_rx_adapter_event_vector_config *config);
695*99a2dd95SBruce Richardson 
696*99a2dd95SBruce Richardson typedef uint32_t rte_event_pmd_selftest_seqn_t;
697*99a2dd95SBruce Richardson extern int rte_event_pmd_selftest_seqn_dynfield_offset;
698*99a2dd95SBruce Richardson 
699*99a2dd95SBruce Richardson /**
700*99a2dd95SBruce Richardson  * Read test sequence number from mbuf.
701*99a2dd95SBruce Richardson  *
702*99a2dd95SBruce Richardson  * @param mbuf Structure to read from.
703*99a2dd95SBruce Richardson  * @return pointer to test sequence number.
704*99a2dd95SBruce Richardson  */
705*99a2dd95SBruce Richardson __rte_internal
706*99a2dd95SBruce Richardson static inline rte_event_pmd_selftest_seqn_t *
707*99a2dd95SBruce Richardson rte_event_pmd_selftest_seqn(struct rte_mbuf *mbuf)
708*99a2dd95SBruce Richardson {
709*99a2dd95SBruce Richardson 	return RTE_MBUF_DYNFIELD(mbuf,
710*99a2dd95SBruce Richardson 		rte_event_pmd_selftest_seqn_dynfield_offset,
711*99a2dd95SBruce Richardson 		rte_event_pmd_selftest_seqn_t *);
712*99a2dd95SBruce Richardson }
713*99a2dd95SBruce Richardson 
714*99a2dd95SBruce Richardson struct rte_cryptodev;
715*99a2dd95SBruce Richardson 
716*99a2dd95SBruce Richardson /**
717*99a2dd95SBruce Richardson  * This API may change without prior notice
718*99a2dd95SBruce Richardson  *
719*99a2dd95SBruce Richardson  * Retrieve the event device's crypto adapter capabilities for the
720*99a2dd95SBruce Richardson  * specified cryptodev
721*99a2dd95SBruce Richardson  *
722*99a2dd95SBruce Richardson  * @param dev
723*99a2dd95SBruce Richardson  *   Event device pointer
724*99a2dd95SBruce Richardson  *
725*99a2dd95SBruce Richardson  * @param cdev
726*99a2dd95SBruce Richardson  *   cryptodev pointer
727*99a2dd95SBruce Richardson  *
728*99a2dd95SBruce Richardson  * @param[out] caps
729*99a2dd95SBruce Richardson  *   A pointer to memory filled with event adapter capabilities.
730*99a2dd95SBruce Richardson  *   It is expected to be pre-allocated & initialized by caller.
731*99a2dd95SBruce Richardson  *
732*99a2dd95SBruce Richardson  * @return
733*99a2dd95SBruce Richardson  *   - 0: Success, driver provides event adapter capabilities for the
734*99a2dd95SBruce Richardson  *	cryptodev.
735*99a2dd95SBruce Richardson  *   - <0: Error code returned by the driver function.
736*99a2dd95SBruce Richardson  *
737*99a2dd95SBruce Richardson  */
738*99a2dd95SBruce Richardson typedef int (*eventdev_crypto_adapter_caps_get_t)
739*99a2dd95SBruce Richardson 					(const struct rte_eventdev *dev,
740*99a2dd95SBruce Richardson 					 const struct rte_cryptodev *cdev,
741*99a2dd95SBruce Richardson 					 uint32_t *caps);
742*99a2dd95SBruce Richardson 
743*99a2dd95SBruce Richardson /**
744*99a2dd95SBruce Richardson  * This API may change without prior notice
745*99a2dd95SBruce Richardson  *
746*99a2dd95SBruce Richardson  * Add crypto queue pair to event device. This callback is invoked if
747*99a2dd95SBruce Richardson  * the caps returned from rte_event_crypto_adapter_caps_get(, cdev_id)
748*99a2dd95SBruce Richardson  * has RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_* set.
749*99a2dd95SBruce Richardson  *
750*99a2dd95SBruce Richardson  * @param dev
751*99a2dd95SBruce Richardson  *   Event device pointer
752*99a2dd95SBruce Richardson  *
753*99a2dd95SBruce Richardson  * @param cdev
754*99a2dd95SBruce Richardson  *   cryptodev pointer
755*99a2dd95SBruce Richardson  *
756*99a2dd95SBruce Richardson  * @param queue_pair_id
757*99a2dd95SBruce Richardson  *   cryptodev queue pair identifier.
758*99a2dd95SBruce Richardson  *
759*99a2dd95SBruce Richardson  * @param event
760*99a2dd95SBruce Richardson  *  Event information required for binding cryptodev queue pair to event queue.
761*99a2dd95SBruce Richardson  *  This structure will have a valid value for only those HW PMDs supporting
762*99a2dd95SBruce Richardson  *  @see RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_QP_EV_BIND capability.
763*99a2dd95SBruce Richardson  *
764*99a2dd95SBruce Richardson  * @return
765*99a2dd95SBruce Richardson  *   - 0: Success, cryptodev queue pair added successfully.
766*99a2dd95SBruce Richardson  *   - <0: Error code returned by the driver function.
767*99a2dd95SBruce Richardson  *
768*99a2dd95SBruce Richardson  */
769*99a2dd95SBruce Richardson typedef int (*eventdev_crypto_adapter_queue_pair_add_t)
770*99a2dd95SBruce Richardson 			(const struct rte_eventdev *dev,
771*99a2dd95SBruce Richardson 			 const struct rte_cryptodev *cdev,
772*99a2dd95SBruce Richardson 			 int32_t queue_pair_id,
773*99a2dd95SBruce Richardson 			 const struct rte_event *event);
774*99a2dd95SBruce Richardson 
775*99a2dd95SBruce Richardson 
776*99a2dd95SBruce Richardson /**
777*99a2dd95SBruce Richardson  * This API may change without prior notice
778*99a2dd95SBruce Richardson  *
779*99a2dd95SBruce Richardson  * Delete crypto queue pair to event device. This callback is invoked if
780*99a2dd95SBruce Richardson  * the caps returned from rte_event_crypto_adapter_caps_get(, cdev_id)
781*99a2dd95SBruce Richardson  * has RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_* set.
782*99a2dd95SBruce Richardson  *
783*99a2dd95SBruce Richardson  * @param dev
784*99a2dd95SBruce Richardson  *   Event device pointer
785*99a2dd95SBruce Richardson  *
786*99a2dd95SBruce Richardson  * @param cdev
787*99a2dd95SBruce Richardson  *   cryptodev pointer
788*99a2dd95SBruce Richardson  *
789*99a2dd95SBruce Richardson  * @param queue_pair_id
790*99a2dd95SBruce Richardson  *   cryptodev queue pair identifier.
791*99a2dd95SBruce Richardson  *
792*99a2dd95SBruce Richardson  * @return
793*99a2dd95SBruce Richardson  *   - 0: Success, cryptodev queue pair deleted successfully.
794*99a2dd95SBruce Richardson  *   - <0: Error code returned by the driver function.
795*99a2dd95SBruce Richardson  *
796*99a2dd95SBruce Richardson  */
797*99a2dd95SBruce Richardson typedef int (*eventdev_crypto_adapter_queue_pair_del_t)
798*99a2dd95SBruce Richardson 					(const struct rte_eventdev *dev,
799*99a2dd95SBruce Richardson 					 const struct rte_cryptodev *cdev,
800*99a2dd95SBruce Richardson 					 int32_t queue_pair_id);
801*99a2dd95SBruce Richardson 
802*99a2dd95SBruce Richardson /**
803*99a2dd95SBruce Richardson  * Start crypto adapter. This callback is invoked if
804*99a2dd95SBruce Richardson  * the caps returned from rte_event_crypto_adapter_caps_get(.., cdev_id)
805*99a2dd95SBruce Richardson  * has RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_* set and queue pairs
806*99a2dd95SBruce Richardson  * from cdev_id have been added to the event device.
807*99a2dd95SBruce Richardson  *
808*99a2dd95SBruce Richardson  * @param dev
809*99a2dd95SBruce Richardson  *   Event device pointer
810*99a2dd95SBruce Richardson  *
811*99a2dd95SBruce Richardson  * @param cdev
812*99a2dd95SBruce Richardson  *   Crypto device pointer
813*99a2dd95SBruce Richardson  *
814*99a2dd95SBruce Richardson  * @return
815*99a2dd95SBruce Richardson  *   - 0: Success, crypto adapter started successfully.
816*99a2dd95SBruce Richardson  *   - <0: Error code returned by the driver function.
817*99a2dd95SBruce Richardson  */
818*99a2dd95SBruce Richardson typedef int (*eventdev_crypto_adapter_start_t)
819*99a2dd95SBruce Richardson 					(const struct rte_eventdev *dev,
820*99a2dd95SBruce Richardson 					 const struct rte_cryptodev *cdev);
821*99a2dd95SBruce Richardson 
822*99a2dd95SBruce Richardson /**
823*99a2dd95SBruce Richardson  * Stop crypto adapter. This callback is invoked if
824*99a2dd95SBruce Richardson  * the caps returned from rte_event_crypto_adapter_caps_get(.., cdev_id)
825*99a2dd95SBruce Richardson  * has RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_* set and queue pairs
826*99a2dd95SBruce Richardson  * from cdev_id have been added to the event device.
827*99a2dd95SBruce Richardson  *
828*99a2dd95SBruce Richardson  * @param dev
829*99a2dd95SBruce Richardson  *   Event device pointer
830*99a2dd95SBruce Richardson  *
831*99a2dd95SBruce Richardson  * @param cdev
832*99a2dd95SBruce Richardson  *   Crypto device pointer
833*99a2dd95SBruce Richardson  *
834*99a2dd95SBruce Richardson  * @return
835*99a2dd95SBruce Richardson  *   - 0: Success, crypto adapter stopped successfully.
836*99a2dd95SBruce Richardson  *   - <0: Error code returned by the driver function.
837*99a2dd95SBruce Richardson  */
838*99a2dd95SBruce Richardson typedef int (*eventdev_crypto_adapter_stop_t)
839*99a2dd95SBruce Richardson 					(const struct rte_eventdev *dev,
840*99a2dd95SBruce Richardson 					 const struct rte_cryptodev *cdev);
841*99a2dd95SBruce Richardson 
842*99a2dd95SBruce Richardson struct rte_event_crypto_adapter_stats;
843*99a2dd95SBruce Richardson 
844*99a2dd95SBruce Richardson /**
845*99a2dd95SBruce Richardson  * Retrieve crypto adapter statistics.
846*99a2dd95SBruce Richardson  *
847*99a2dd95SBruce Richardson  * @param dev
848*99a2dd95SBruce Richardson  *   Event device pointer
849*99a2dd95SBruce Richardson  *
850*99a2dd95SBruce Richardson  * @param cdev
851*99a2dd95SBruce Richardson  *   Crypto device pointer
852*99a2dd95SBruce Richardson  *
853*99a2dd95SBruce Richardson  * @param[out] stats
854*99a2dd95SBruce Richardson  *   Pointer to stats structure
855*99a2dd95SBruce Richardson  *
856*99a2dd95SBruce Richardson  * @return
857*99a2dd95SBruce Richardson  *   Return 0 on success.
858*99a2dd95SBruce Richardson  */
859*99a2dd95SBruce Richardson 
860*99a2dd95SBruce Richardson typedef int (*eventdev_crypto_adapter_stats_get)
861*99a2dd95SBruce Richardson 			(const struct rte_eventdev *dev,
862*99a2dd95SBruce Richardson 			 const struct rte_cryptodev *cdev,
863*99a2dd95SBruce Richardson 			 struct rte_event_crypto_adapter_stats *stats);
864*99a2dd95SBruce Richardson 
865*99a2dd95SBruce Richardson /**
866*99a2dd95SBruce Richardson  * Reset crypto adapter statistics.
867*99a2dd95SBruce Richardson  *
868*99a2dd95SBruce Richardson  * @param dev
869*99a2dd95SBruce Richardson  *   Event device pointer
870*99a2dd95SBruce Richardson  *
871*99a2dd95SBruce Richardson  * @param cdev
872*99a2dd95SBruce Richardson  *   Crypto device pointer
873*99a2dd95SBruce Richardson  *
874*99a2dd95SBruce Richardson  * @return
875*99a2dd95SBruce Richardson  *   Return 0 on success.
876*99a2dd95SBruce Richardson  */
877*99a2dd95SBruce Richardson 
878*99a2dd95SBruce Richardson typedef int (*eventdev_crypto_adapter_stats_reset)
879*99a2dd95SBruce Richardson 			(const struct rte_eventdev *dev,
880*99a2dd95SBruce Richardson 			 const struct rte_cryptodev *cdev);
881*99a2dd95SBruce Richardson 
882*99a2dd95SBruce Richardson /**
883*99a2dd95SBruce Richardson  * Retrieve the event device's eth Tx adapter capabilities.
884*99a2dd95SBruce Richardson  *
885*99a2dd95SBruce Richardson  * @param dev
886*99a2dd95SBruce Richardson  *   Event device pointer
887*99a2dd95SBruce Richardson  *
888*99a2dd95SBruce Richardson  * @param eth_dev
889*99a2dd95SBruce Richardson  *   Ethernet device pointer
890*99a2dd95SBruce Richardson  *
891*99a2dd95SBruce Richardson  * @param[out] caps
892*99a2dd95SBruce Richardson  *   A pointer to memory filled with eth Tx adapter capabilities.
893*99a2dd95SBruce Richardson  *
894*99a2dd95SBruce Richardson  * @return
895*99a2dd95SBruce Richardson  *   - 0: Success, driver provides eth Tx adapter capabilities
896*99a2dd95SBruce Richardson  *   - <0: Error code returned by the driver function.
897*99a2dd95SBruce Richardson  *
898*99a2dd95SBruce Richardson  */
899*99a2dd95SBruce Richardson typedef int (*eventdev_eth_tx_adapter_caps_get_t)
900*99a2dd95SBruce Richardson 					(const struct rte_eventdev *dev,
901*99a2dd95SBruce Richardson 					const struct rte_eth_dev *eth_dev,
902*99a2dd95SBruce Richardson 					uint32_t *caps);
903*99a2dd95SBruce Richardson 
904*99a2dd95SBruce Richardson /**
905*99a2dd95SBruce Richardson  * Create adapter callback.
906*99a2dd95SBruce Richardson  *
907*99a2dd95SBruce Richardson  * @param id
908*99a2dd95SBruce Richardson  *   Adapter identifier
909*99a2dd95SBruce Richardson  *
910*99a2dd95SBruce Richardson  * @param dev
911*99a2dd95SBruce Richardson  *   Event device pointer
912*99a2dd95SBruce Richardson  *
913*99a2dd95SBruce Richardson  * @return
914*99a2dd95SBruce Richardson  *   - 0: Success.
915*99a2dd95SBruce Richardson  *   - <0: Error code on failure.
916*99a2dd95SBruce Richardson  */
917*99a2dd95SBruce Richardson typedef int (*eventdev_eth_tx_adapter_create_t)(uint8_t id,
918*99a2dd95SBruce Richardson 					const struct rte_eventdev *dev);
919*99a2dd95SBruce Richardson 
920*99a2dd95SBruce Richardson /**
921*99a2dd95SBruce Richardson  * Free adapter callback.
922*99a2dd95SBruce Richardson  *
923*99a2dd95SBruce Richardson  * @param id
924*99a2dd95SBruce Richardson  *   Adapter identifier
925*99a2dd95SBruce Richardson  *
926*99a2dd95SBruce Richardson  * @param dev
927*99a2dd95SBruce Richardson  *   Event device pointer
928*99a2dd95SBruce Richardson  *
929*99a2dd95SBruce Richardson  * @return
930*99a2dd95SBruce Richardson  *   - 0: Success.
931*99a2dd95SBruce Richardson  *   - <0: Error code on failure.
932*99a2dd95SBruce Richardson  */
933*99a2dd95SBruce Richardson typedef int (*eventdev_eth_tx_adapter_free_t)(uint8_t id,
934*99a2dd95SBruce Richardson 					const struct rte_eventdev *dev);
935*99a2dd95SBruce Richardson 
936*99a2dd95SBruce Richardson /**
937*99a2dd95SBruce Richardson  * Add a Tx queue to the adapter.
938*99a2dd95SBruce Richardson  * A queue value of -1 is used to indicate all
939*99a2dd95SBruce Richardson  * queues within the device.
940*99a2dd95SBruce Richardson  *
941*99a2dd95SBruce Richardson  * @param id
942*99a2dd95SBruce Richardson  *   Adapter identifier
943*99a2dd95SBruce Richardson  *
944*99a2dd95SBruce Richardson  * @param dev
945*99a2dd95SBruce Richardson  *   Event device pointer
946*99a2dd95SBruce Richardson  *
947*99a2dd95SBruce Richardson  * @param eth_dev
948*99a2dd95SBruce Richardson  *   Ethernet device pointer
949*99a2dd95SBruce Richardson  *
950*99a2dd95SBruce Richardson  * @param tx_queue_id
951*99a2dd95SBruce Richardson  *   Transmit queue index
952*99a2dd95SBruce Richardson  *
953*99a2dd95SBruce Richardson  * @return
954*99a2dd95SBruce Richardson  *   - 0: Success.
955*99a2dd95SBruce Richardson  *   - <0: Error code on failure.
956*99a2dd95SBruce Richardson  */
957*99a2dd95SBruce Richardson typedef int (*eventdev_eth_tx_adapter_queue_add_t)(
958*99a2dd95SBruce Richardson 					uint8_t id,
959*99a2dd95SBruce Richardson 					const struct rte_eventdev *dev,
960*99a2dd95SBruce Richardson 					const struct rte_eth_dev *eth_dev,
961*99a2dd95SBruce Richardson 					int32_t tx_queue_id);
962*99a2dd95SBruce Richardson 
963*99a2dd95SBruce Richardson /**
964*99a2dd95SBruce Richardson  * Delete a Tx queue from the adapter.
965*99a2dd95SBruce Richardson  * A queue value of -1 is used to indicate all
966*99a2dd95SBruce Richardson  * queues within the device, that have been added to this
967*99a2dd95SBruce Richardson  * adapter.
968*99a2dd95SBruce Richardson  *
969*99a2dd95SBruce Richardson  * @param id
970*99a2dd95SBruce Richardson  *   Adapter identifier
971*99a2dd95SBruce Richardson  *
972*99a2dd95SBruce Richardson  * @param dev
973*99a2dd95SBruce Richardson  *   Event device pointer
974*99a2dd95SBruce Richardson  *
975*99a2dd95SBruce Richardson  * @param eth_dev
976*99a2dd95SBruce Richardson  *   Ethernet device pointer
977*99a2dd95SBruce Richardson  *
978*99a2dd95SBruce Richardson  * @param tx_queue_id
979*99a2dd95SBruce Richardson  *   Transmit queue index
980*99a2dd95SBruce Richardson  *
981*99a2dd95SBruce Richardson  * @return
982*99a2dd95SBruce Richardson  *  - 0: Success, Queues deleted successfully.
983*99a2dd95SBruce Richardson  *  - <0: Error code on failure.
984*99a2dd95SBruce Richardson  */
985*99a2dd95SBruce Richardson typedef int (*eventdev_eth_tx_adapter_queue_del_t)(
986*99a2dd95SBruce Richardson 					uint8_t id,
987*99a2dd95SBruce Richardson 					const struct rte_eventdev *dev,
988*99a2dd95SBruce Richardson 					const struct rte_eth_dev *eth_dev,
989*99a2dd95SBruce Richardson 					int32_t tx_queue_id);
990*99a2dd95SBruce Richardson 
991*99a2dd95SBruce Richardson /**
992*99a2dd95SBruce Richardson  * Start the adapter.
993*99a2dd95SBruce Richardson  *
994*99a2dd95SBruce Richardson  * @param id
995*99a2dd95SBruce Richardson  *   Adapter identifier
996*99a2dd95SBruce Richardson  *
997*99a2dd95SBruce Richardson  * @param dev
998*99a2dd95SBruce Richardson  *   Event device pointer
999*99a2dd95SBruce Richardson  *
1000*99a2dd95SBruce Richardson  * @return
1001*99a2dd95SBruce Richardson  *  - 0: Success, Adapter started correctly.
1002*99a2dd95SBruce Richardson  *  - <0: Error code on failure.
1003*99a2dd95SBruce Richardson  */
1004*99a2dd95SBruce Richardson typedef int (*eventdev_eth_tx_adapter_start_t)(uint8_t id,
1005*99a2dd95SBruce Richardson 					const struct rte_eventdev *dev);
1006*99a2dd95SBruce Richardson 
1007*99a2dd95SBruce Richardson /**
1008*99a2dd95SBruce Richardson  * Stop the adapter.
1009*99a2dd95SBruce Richardson  *
1010*99a2dd95SBruce Richardson  * @param id
1011*99a2dd95SBruce Richardson  *  Adapter identifier
1012*99a2dd95SBruce Richardson  *
1013*99a2dd95SBruce Richardson  * @param dev
1014*99a2dd95SBruce Richardson  *   Event device pointer
1015*99a2dd95SBruce Richardson  *
1016*99a2dd95SBruce Richardson  * @return
1017*99a2dd95SBruce Richardson  *  - 0: Success.
1018*99a2dd95SBruce Richardson  *  - <0: Error code on failure.
1019*99a2dd95SBruce Richardson  */
1020*99a2dd95SBruce Richardson typedef int (*eventdev_eth_tx_adapter_stop_t)(uint8_t id,
1021*99a2dd95SBruce Richardson 					const struct rte_eventdev *dev);
1022*99a2dd95SBruce Richardson 
1023*99a2dd95SBruce Richardson struct rte_event_eth_tx_adapter_stats;
1024*99a2dd95SBruce Richardson 
1025*99a2dd95SBruce Richardson /**
1026*99a2dd95SBruce Richardson  * Retrieve statistics for an adapter
1027*99a2dd95SBruce Richardson  *
1028*99a2dd95SBruce Richardson  * @param id
1029*99a2dd95SBruce Richardson  *  Adapter identifier
1030*99a2dd95SBruce Richardson  *
1031*99a2dd95SBruce Richardson  * @param dev
1032*99a2dd95SBruce Richardson  *   Event device pointer
1033*99a2dd95SBruce Richardson  *
1034*99a2dd95SBruce Richardson  * @param [out] stats
1035*99a2dd95SBruce Richardson  *  A pointer to structure used to retrieve statistics for an adapter
1036*99a2dd95SBruce Richardson  *
1037*99a2dd95SBruce Richardson  * @return
1038*99a2dd95SBruce Richardson  *  - 0: Success, statistics retrieved successfully.
1039*99a2dd95SBruce Richardson  *  - <0: Error code on failure.
1040*99a2dd95SBruce Richardson  */
1041*99a2dd95SBruce Richardson typedef int (*eventdev_eth_tx_adapter_stats_get_t)(
1042*99a2dd95SBruce Richardson 				uint8_t id,
1043*99a2dd95SBruce Richardson 				const struct rte_eventdev *dev,
1044*99a2dd95SBruce Richardson 				struct rte_event_eth_tx_adapter_stats *stats);
1045*99a2dd95SBruce Richardson 
1046*99a2dd95SBruce Richardson /**
1047*99a2dd95SBruce Richardson  * Reset statistics for an adapter
1048*99a2dd95SBruce Richardson  *
1049*99a2dd95SBruce Richardson  * @param id
1050*99a2dd95SBruce Richardson  *  Adapter identifier
1051*99a2dd95SBruce Richardson  *
1052*99a2dd95SBruce Richardson  * @param dev
1053*99a2dd95SBruce Richardson  *   Event device pointer
1054*99a2dd95SBruce Richardson  *
1055*99a2dd95SBruce Richardson  * @return
1056*99a2dd95SBruce Richardson  *  - 0: Success, statistics retrieved successfully.
1057*99a2dd95SBruce Richardson  *  - <0: Error code on failure.
1058*99a2dd95SBruce Richardson  */
1059*99a2dd95SBruce Richardson typedef int (*eventdev_eth_tx_adapter_stats_reset_t)(uint8_t id,
1060*99a2dd95SBruce Richardson 					const struct rte_eventdev *dev);
1061*99a2dd95SBruce Richardson 
1062*99a2dd95SBruce Richardson /** Event device operations function pointer table */
1063*99a2dd95SBruce Richardson struct rte_eventdev_ops {
1064*99a2dd95SBruce Richardson 	eventdev_info_get_t dev_infos_get;	/**< Get device info. */
1065*99a2dd95SBruce Richardson 	eventdev_configure_t dev_configure;	/**< Configure device. */
1066*99a2dd95SBruce Richardson 	eventdev_start_t dev_start;		/**< Start device. */
1067*99a2dd95SBruce Richardson 	eventdev_stop_t dev_stop;		/**< Stop device. */
1068*99a2dd95SBruce Richardson 	eventdev_close_t dev_close;		/**< Close device. */
1069*99a2dd95SBruce Richardson 
1070*99a2dd95SBruce Richardson 	eventdev_queue_default_conf_get_t queue_def_conf;
1071*99a2dd95SBruce Richardson 	/**< Get default queue configuration. */
1072*99a2dd95SBruce Richardson 	eventdev_queue_setup_t queue_setup;
1073*99a2dd95SBruce Richardson 	/**< Set up an event queue. */
1074*99a2dd95SBruce Richardson 	eventdev_queue_release_t queue_release;
1075*99a2dd95SBruce Richardson 	/**< Release an event queue. */
1076*99a2dd95SBruce Richardson 
1077*99a2dd95SBruce Richardson 	eventdev_port_default_conf_get_t port_def_conf;
1078*99a2dd95SBruce Richardson 	/**< Get default port configuration. */
1079*99a2dd95SBruce Richardson 	eventdev_port_setup_t port_setup;
1080*99a2dd95SBruce Richardson 	/**< Set up an event port. */
1081*99a2dd95SBruce Richardson 	eventdev_port_release_t port_release;
1082*99a2dd95SBruce Richardson 	/**< Release an event port. */
1083*99a2dd95SBruce Richardson 
1084*99a2dd95SBruce Richardson 	eventdev_port_link_t port_link;
1085*99a2dd95SBruce Richardson 	/**< Link event queues to an event port. */
1086*99a2dd95SBruce Richardson 	eventdev_port_unlink_t port_unlink;
1087*99a2dd95SBruce Richardson 	/**< Unlink event queues from an event port. */
1088*99a2dd95SBruce Richardson 	eventdev_port_unlinks_in_progress_t port_unlinks_in_progress;
1089*99a2dd95SBruce Richardson 	/**< Unlinks in progress on an event port. */
1090*99a2dd95SBruce Richardson 	eventdev_dequeue_timeout_ticks_t timeout_ticks;
1091*99a2dd95SBruce Richardson 	/**< Converts ns to *timeout_ticks* value for rte_event_dequeue() */
1092*99a2dd95SBruce Richardson 	eventdev_dump_t dump;
1093*99a2dd95SBruce Richardson 	/* Dump internal information */
1094*99a2dd95SBruce Richardson 
1095*99a2dd95SBruce Richardson 	eventdev_xstats_get_t xstats_get;
1096*99a2dd95SBruce Richardson 	/**< Get extended device statistics. */
1097*99a2dd95SBruce Richardson 	eventdev_xstats_get_names_t xstats_get_names;
1098*99a2dd95SBruce Richardson 	/**< Get names of extended stats. */
1099*99a2dd95SBruce Richardson 	eventdev_xstats_get_by_name xstats_get_by_name;
1100*99a2dd95SBruce Richardson 	/**< Get one value by name. */
1101*99a2dd95SBruce Richardson 	eventdev_xstats_reset_t xstats_reset;
1102*99a2dd95SBruce Richardson 	/**< Reset the statistics values in xstats. */
1103*99a2dd95SBruce Richardson 
1104*99a2dd95SBruce Richardson 	eventdev_eth_rx_adapter_caps_get_t eth_rx_adapter_caps_get;
1105*99a2dd95SBruce Richardson 	/**< Get ethernet Rx adapter capabilities */
1106*99a2dd95SBruce Richardson 	eventdev_eth_rx_adapter_queue_add_t eth_rx_adapter_queue_add;
1107*99a2dd95SBruce Richardson 	/**< Add Rx queues to ethernet Rx adapter */
1108*99a2dd95SBruce Richardson 	eventdev_eth_rx_adapter_queue_del_t eth_rx_adapter_queue_del;
1109*99a2dd95SBruce Richardson 	/**< Delete Rx queues from ethernet Rx adapter */
1110*99a2dd95SBruce Richardson 	eventdev_eth_rx_adapter_start_t eth_rx_adapter_start;
1111*99a2dd95SBruce Richardson 	/**< Start ethernet Rx adapter */
1112*99a2dd95SBruce Richardson 	eventdev_eth_rx_adapter_stop_t eth_rx_adapter_stop;
1113*99a2dd95SBruce Richardson 	/**< Stop ethernet Rx adapter */
1114*99a2dd95SBruce Richardson 	eventdev_eth_rx_adapter_stats_get eth_rx_adapter_stats_get;
1115*99a2dd95SBruce Richardson 	/**< Get ethernet Rx stats */
1116*99a2dd95SBruce Richardson 	eventdev_eth_rx_adapter_stats_reset eth_rx_adapter_stats_reset;
1117*99a2dd95SBruce Richardson 	/**< Reset ethernet Rx stats */
1118*99a2dd95SBruce Richardson 	eventdev_eth_rx_adapter_vector_limits_get_t
1119*99a2dd95SBruce Richardson 		eth_rx_adapter_vector_limits_get;
1120*99a2dd95SBruce Richardson 	/**< Get event vector limits for the Rx adapter */
1121*99a2dd95SBruce Richardson 	eventdev_eth_rx_adapter_event_vector_config_t
1122*99a2dd95SBruce Richardson 		eth_rx_adapter_event_vector_config;
1123*99a2dd95SBruce Richardson 	/**< Configure Rx adapter with event vector */
1124*99a2dd95SBruce Richardson 
1125*99a2dd95SBruce Richardson 	eventdev_timer_adapter_caps_get_t timer_adapter_caps_get;
1126*99a2dd95SBruce Richardson 	/**< Get timer adapter capabilities */
1127*99a2dd95SBruce Richardson 
1128*99a2dd95SBruce Richardson 	eventdev_crypto_adapter_caps_get_t crypto_adapter_caps_get;
1129*99a2dd95SBruce Richardson 	/**< Get crypto adapter capabilities */
1130*99a2dd95SBruce Richardson 	eventdev_crypto_adapter_queue_pair_add_t crypto_adapter_queue_pair_add;
1131*99a2dd95SBruce Richardson 	/**< Add queue pair to crypto adapter */
1132*99a2dd95SBruce Richardson 	eventdev_crypto_adapter_queue_pair_del_t crypto_adapter_queue_pair_del;
1133*99a2dd95SBruce Richardson 	/**< Delete queue pair from crypto adapter */
1134*99a2dd95SBruce Richardson 	eventdev_crypto_adapter_start_t crypto_adapter_start;
1135*99a2dd95SBruce Richardson 	/**< Start crypto adapter */
1136*99a2dd95SBruce Richardson 	eventdev_crypto_adapter_stop_t crypto_adapter_stop;
1137*99a2dd95SBruce Richardson 	/**< Stop crypto adapter */
1138*99a2dd95SBruce Richardson 	eventdev_crypto_adapter_stats_get crypto_adapter_stats_get;
1139*99a2dd95SBruce Richardson 	/**< Get crypto stats */
1140*99a2dd95SBruce Richardson 	eventdev_crypto_adapter_stats_reset crypto_adapter_stats_reset;
1141*99a2dd95SBruce Richardson 	/**< Reset crypto stats */
1142*99a2dd95SBruce Richardson 
1143*99a2dd95SBruce Richardson 	eventdev_eth_tx_adapter_caps_get_t eth_tx_adapter_caps_get;
1144*99a2dd95SBruce Richardson 	/**< Get ethernet Tx adapter capabilities */
1145*99a2dd95SBruce Richardson 
1146*99a2dd95SBruce Richardson 	eventdev_eth_tx_adapter_create_t eth_tx_adapter_create;
1147*99a2dd95SBruce Richardson 	/**< Create adapter callback */
1148*99a2dd95SBruce Richardson 	eventdev_eth_tx_adapter_free_t eth_tx_adapter_free;
1149*99a2dd95SBruce Richardson 	/**< Free adapter callback */
1150*99a2dd95SBruce Richardson 	eventdev_eth_tx_adapter_queue_add_t eth_tx_adapter_queue_add;
1151*99a2dd95SBruce Richardson 	/**< Add Tx queues to the eth Tx adapter */
1152*99a2dd95SBruce Richardson 	eventdev_eth_tx_adapter_queue_del_t eth_tx_adapter_queue_del;
1153*99a2dd95SBruce Richardson 	/**< Delete Tx queues from the eth Tx adapter */
1154*99a2dd95SBruce Richardson 	eventdev_eth_tx_adapter_start_t eth_tx_adapter_start;
1155*99a2dd95SBruce Richardson 	/**< Start eth Tx adapter */
1156*99a2dd95SBruce Richardson 	eventdev_eth_tx_adapter_stop_t eth_tx_adapter_stop;
1157*99a2dd95SBruce Richardson 	/**< Stop eth Tx adapter */
1158*99a2dd95SBruce Richardson 	eventdev_eth_tx_adapter_stats_get_t eth_tx_adapter_stats_get;
1159*99a2dd95SBruce Richardson 	/**< Get eth Tx adapter statistics */
1160*99a2dd95SBruce Richardson 	eventdev_eth_tx_adapter_stats_reset_t eth_tx_adapter_stats_reset;
1161*99a2dd95SBruce Richardson 	/**< Reset eth Tx adapter statistics */
1162*99a2dd95SBruce Richardson 
1163*99a2dd95SBruce Richardson 	eventdev_selftest dev_selftest;
1164*99a2dd95SBruce Richardson 	/**< Start eventdev Selftest */
1165*99a2dd95SBruce Richardson 
1166*99a2dd95SBruce Richardson 	eventdev_stop_flush_t dev_stop_flush;
1167*99a2dd95SBruce Richardson 	/**< User-provided event flush function */
1168*99a2dd95SBruce Richardson };
1169*99a2dd95SBruce Richardson 
1170*99a2dd95SBruce Richardson /**
1171*99a2dd95SBruce Richardson  * Allocates a new eventdev slot for an event device and returns the pointer
1172*99a2dd95SBruce Richardson  * to that slot for the driver to use.
1173*99a2dd95SBruce Richardson  *
1174*99a2dd95SBruce Richardson  * @param name
1175*99a2dd95SBruce Richardson  *   Unique identifier name for each device
1176*99a2dd95SBruce Richardson  * @param socket_id
1177*99a2dd95SBruce Richardson  *   Socket to allocate resources on.
1178*99a2dd95SBruce Richardson  * @return
1179*99a2dd95SBruce Richardson  *   - Slot in the rte_dev_devices array for a new device;
1180*99a2dd95SBruce Richardson  */
1181*99a2dd95SBruce Richardson struct rte_eventdev *
1182*99a2dd95SBruce Richardson rte_event_pmd_allocate(const char *name, int socket_id);
1183*99a2dd95SBruce Richardson 
1184*99a2dd95SBruce Richardson /**
1185*99a2dd95SBruce Richardson  * Release the specified eventdev device.
1186*99a2dd95SBruce Richardson  *
1187*99a2dd95SBruce Richardson  * @param eventdev
1188*99a2dd95SBruce Richardson  * The *eventdev* pointer is the address of the *rte_eventdev* structure.
1189*99a2dd95SBruce Richardson  * @return
1190*99a2dd95SBruce Richardson  *   - 0 on success, negative on error
1191*99a2dd95SBruce Richardson  */
1192*99a2dd95SBruce Richardson int
1193*99a2dd95SBruce Richardson rte_event_pmd_release(struct rte_eventdev *eventdev);
1194*99a2dd95SBruce Richardson 
1195*99a2dd95SBruce Richardson #ifdef __cplusplus
1196*99a2dd95SBruce Richardson }
1197*99a2dd95SBruce Richardson #endif
1198*99a2dd95SBruce Richardson 
1199*99a2dd95SBruce Richardson #endif /* _RTE_EVENTDEV_PMD_H_ */
1200