xref: /dpdk/lib/eventdev/eventdev_pmd.h (revision c1749bc5ee10ee1f13fcf084efffec585dc31d14)
199a2dd95SBruce Richardson /* SPDX-License-Identifier: BSD-3-Clause
299a2dd95SBruce Richardson  * Copyright(c) 2016 Cavium, Inc
399a2dd95SBruce Richardson  */
499a2dd95SBruce Richardson 
599a2dd95SBruce Richardson #ifndef _RTE_EVENTDEV_PMD_H_
699a2dd95SBruce Richardson #define _RTE_EVENTDEV_PMD_H_
799a2dd95SBruce Richardson 
82c552933SBrian Dooley #ifdef __cplusplus
92c552933SBrian Dooley extern "C" {
102c552933SBrian Dooley #endif
112c552933SBrian Dooley 
1299a2dd95SBruce Richardson /** @file
1399a2dd95SBruce Richardson  * RTE Event PMD APIs
1499a2dd95SBruce Richardson  *
1599a2dd95SBruce Richardson  * @note
1699a2dd95SBruce Richardson  * These API are from event PMD only and user applications should not call
1799a2dd95SBruce Richardson  * them directly.
1899a2dd95SBruce Richardson  */
1999a2dd95SBruce Richardson 
2099a2dd95SBruce Richardson #include <string.h>
2199a2dd95SBruce Richardson 
2299a2dd95SBruce Richardson #include <rte_common.h>
2399a2dd95SBruce Richardson #include <rte_compat.h>
2499a2dd95SBruce Richardson #include <rte_config.h>
251acb7f54SDavid Marchand #include <dev_driver.h>
2699a2dd95SBruce Richardson #include <rte_log.h>
2799a2dd95SBruce Richardson #include <rte_malloc.h>
2899a2dd95SBruce Richardson #include <rte_mbuf.h>
2999a2dd95SBruce Richardson #include <rte_mbuf_dyn.h>
3099a2dd95SBruce Richardson 
3153548ad3SPavan Nikhilesh #include "event_timer_adapter_pmd.h"
3299a2dd95SBruce Richardson #include "rte_eventdev.h"
3399a2dd95SBruce Richardson 
3499a2dd95SBruce Richardson /* Logging Macros */
3599a2dd95SBruce Richardson #define RTE_EDEV_LOG_ERR(...) \
3699a2dd95SBruce Richardson 	RTE_LOG(ERR, EVENTDEV, \
3799a2dd95SBruce Richardson 		RTE_FMT("%s() line %u: " RTE_FMT_HEAD(__VA_ARGS__,) "\n", \
3899a2dd95SBruce Richardson 			__func__, __LINE__, RTE_FMT_TAIL(__VA_ARGS__,)))
3999a2dd95SBruce Richardson 
4099a2dd95SBruce Richardson #ifdef RTE_LIBRTE_EVENTDEV_DEBUG
4199a2dd95SBruce Richardson #define RTE_EDEV_LOG_DEBUG(...) \
4299a2dd95SBruce Richardson 	RTE_LOG(DEBUG, EVENTDEV, \
4399a2dd95SBruce Richardson 		RTE_FMT("%s() line %u: " RTE_FMT_HEAD(__VA_ARGS__,) "\n", \
4499a2dd95SBruce Richardson 			__func__, __LINE__, RTE_FMT_TAIL(__VA_ARGS__,)))
4599a2dd95SBruce Richardson #else
4699a2dd95SBruce Richardson #define RTE_EDEV_LOG_DEBUG(...) (void)0
4799a2dd95SBruce Richardson #endif
4899a2dd95SBruce Richardson 
4999a2dd95SBruce Richardson /* Macros to check for valid device */
5099a2dd95SBruce Richardson #define RTE_EVENTDEV_VALID_DEVID_OR_ERR_RET(dev_id, retval) do { \
5199a2dd95SBruce Richardson 	if (!rte_event_pmd_is_valid_dev((dev_id))) { \
5299a2dd95SBruce Richardson 		RTE_EDEV_LOG_ERR("Invalid dev_id=%d\n", dev_id); \
5399a2dd95SBruce Richardson 		return retval; \
5499a2dd95SBruce Richardson 	} \
5599a2dd95SBruce Richardson } while (0)
5699a2dd95SBruce Richardson 
5799a2dd95SBruce Richardson #define RTE_EVENTDEV_VALID_DEVID_OR_ERRNO_RET(dev_id, errno, retval) do { \
5899a2dd95SBruce Richardson 	if (!rte_event_pmd_is_valid_dev((dev_id))) { \
5999a2dd95SBruce Richardson 		RTE_EDEV_LOG_ERR("Invalid dev_id=%d\n", dev_id); \
6099a2dd95SBruce Richardson 		rte_errno = errno; \
6199a2dd95SBruce Richardson 		return retval; \
6299a2dd95SBruce Richardson 	} \
6399a2dd95SBruce Richardson } while (0)
6499a2dd95SBruce Richardson 
6599a2dd95SBruce Richardson #define RTE_EVENTDEV_VALID_DEVID_OR_RET(dev_id) do { \
6699a2dd95SBruce Richardson 	if (!rte_event_pmd_is_valid_dev((dev_id))) { \
6799a2dd95SBruce Richardson 		RTE_EDEV_LOG_ERR("Invalid dev_id=%d\n", dev_id); \
6899a2dd95SBruce Richardson 		return; \
6999a2dd95SBruce Richardson 	} \
7099a2dd95SBruce Richardson } while (0)
7199a2dd95SBruce Richardson 
7299a2dd95SBruce Richardson #define RTE_EVENT_ETH_RX_ADAPTER_SW_CAP                                        \
7399a2dd95SBruce Richardson 	((RTE_EVENT_ETH_RX_ADAPTER_CAP_OVERRIDE_FLOW_ID) |                     \
7499a2dd95SBruce Richardson 	 (RTE_EVENT_ETH_RX_ADAPTER_CAP_MULTI_EVENTQ) |                         \
7599a2dd95SBruce Richardson 	 (RTE_EVENT_ETH_RX_ADAPTER_CAP_EVENT_VECTOR))
7699a2dd95SBruce Richardson 
7799a2dd95SBruce Richardson #define RTE_EVENT_CRYPTO_ADAPTER_SW_CAP \
7899a2dd95SBruce Richardson 		RTE_EVENT_CRYPTO_ADAPTER_CAP_SESSION_PRIVATE_DATA
7999a2dd95SBruce Richardson 
8099a2dd95SBruce Richardson /**< Ethernet Rx adapter cap to return If the packet transfers from
8199a2dd95SBruce Richardson  * the ethdev to eventdev use a SW service function
8299a2dd95SBruce Richardson  */
8399a2dd95SBruce Richardson 
843d9d8adfSNaga Harish K S V #define RTE_EVENT_TIMER_ADAPTER_SW_CAP \
853d9d8adfSNaga Harish K S V 		RTE_EVENT_TIMER_ADAPTER_CAP_PERIODIC
863d9d8adfSNaga Harish K S V 
8799a2dd95SBruce Richardson #define RTE_EVENTDEV_DETACHED  (0)
8899a2dd95SBruce Richardson #define RTE_EVENTDEV_ATTACHED  (1)
8999a2dd95SBruce Richardson 
90295c053fSPavan Nikhilesh #define RTE_EVENTDEV_NAME_MAX_LEN (64)
91295c053fSPavan Nikhilesh /**< @internal Max length of name of event PMD */
92295c053fSPavan Nikhilesh 
9399a2dd95SBruce Richardson struct rte_eth_dev;
9499a2dd95SBruce Richardson 
9599a2dd95SBruce Richardson /** Global structure used for maintaining state of allocated event devices */
9699a2dd95SBruce Richardson struct rte_eventdev_global {
9799a2dd95SBruce Richardson 	uint8_t nb_devs;	/**< Number of devices found */
9899a2dd95SBruce Richardson };
9999a2dd95SBruce Richardson 
10099a2dd95SBruce Richardson /**
101295c053fSPavan Nikhilesh  * @internal
102295c053fSPavan Nikhilesh  * The data part, with no function pointers, associated with each device.
103295c053fSPavan Nikhilesh  *
104295c053fSPavan Nikhilesh  * This structure is safe to place in shared memory to be common among
105295c053fSPavan Nikhilesh  * different processes in a multi-process configuration.
106295c053fSPavan Nikhilesh  */
107295c053fSPavan Nikhilesh struct rte_eventdev_data {
108295c053fSPavan Nikhilesh 	int socket_id;
109295c053fSPavan Nikhilesh 	/**< Socket ID where memory is allocated */
110295c053fSPavan Nikhilesh 	uint8_t dev_id;
111295c053fSPavan Nikhilesh 	/**< Device ID for this instance */
112295c053fSPavan Nikhilesh 	uint8_t nb_queues;
113295c053fSPavan Nikhilesh 	/**< Number of event queues. */
114295c053fSPavan Nikhilesh 	uint8_t nb_ports;
115295c053fSPavan Nikhilesh 	/**< Number of event ports. */
116295c053fSPavan Nikhilesh 	void *ports[RTE_EVENT_MAX_PORTS_PER_DEV];
117295c053fSPavan Nikhilesh 	/**< Array of pointers to ports. */
118295c053fSPavan Nikhilesh 	struct rte_event_port_conf ports_cfg[RTE_EVENT_MAX_PORTS_PER_DEV];
119295c053fSPavan Nikhilesh 	/**< Array of port configuration structures. */
120295c053fSPavan Nikhilesh 	struct rte_event_queue_conf queues_cfg[RTE_EVENT_MAX_QUEUES_PER_DEV];
121295c053fSPavan Nikhilesh 	/**< Array of queue configuration structures. */
122295c053fSPavan Nikhilesh 	uint16_t links_map[RTE_EVENT_MAX_PORTS_PER_DEV *
123295c053fSPavan Nikhilesh 			   RTE_EVENT_MAX_QUEUES_PER_DEV];
124295c053fSPavan Nikhilesh 	/**< Memory to store queues to port connections. */
125295c053fSPavan Nikhilesh 	void *dev_private;
126295c053fSPavan Nikhilesh 	/**< PMD-specific private data */
127295c053fSPavan Nikhilesh 	uint32_t event_dev_cap;
128295c053fSPavan Nikhilesh 	/**< Event device capabilities(RTE_EVENT_DEV_CAP_)*/
129295c053fSPavan Nikhilesh 	struct rte_event_dev_config dev_conf;
130295c053fSPavan Nikhilesh 	/**< Configuration applied to device. */
131295c053fSPavan Nikhilesh 	uint8_t service_inited;
132295c053fSPavan Nikhilesh 	/* Service initialization state */
133295c053fSPavan Nikhilesh 	uint32_t service_id;
134295c053fSPavan Nikhilesh 	/* Service ID*/
135295c053fSPavan Nikhilesh 	void *dev_stop_flush_arg;
136295c053fSPavan Nikhilesh 	/**< User-provided argument for event flush function */
137295c053fSPavan Nikhilesh 
138295c053fSPavan Nikhilesh 	RTE_STD_C11
139295c053fSPavan Nikhilesh 	uint8_t dev_started : 1;
140295c053fSPavan Nikhilesh 	/**< Device state: STARTED(1)/STOPPED(0) */
141295c053fSPavan Nikhilesh 
142295c053fSPavan Nikhilesh 	char name[RTE_EVENTDEV_NAME_MAX_LEN];
143295c053fSPavan Nikhilesh 	/**< Unique identifier name */
144295c053fSPavan Nikhilesh 
145295c053fSPavan Nikhilesh 	uint64_t reserved_64s[4]; /**< Reserved for future fields */
146295c053fSPavan Nikhilesh 	void *reserved_ptrs[4];	  /**< Reserved for future fields */
147295c053fSPavan Nikhilesh } __rte_cache_aligned;
148295c053fSPavan Nikhilesh 
149295c053fSPavan Nikhilesh /** @internal The data structure associated with each event device. */
150295c053fSPavan Nikhilesh struct rte_eventdev {
151295c053fSPavan Nikhilesh 	struct rte_eventdev_data *data;
152295c053fSPavan Nikhilesh 	/**< Pointer to device data */
153295c053fSPavan Nikhilesh 	struct eventdev_ops *dev_ops;
154295c053fSPavan Nikhilesh 	/**< Functions exported by PMD */
155295c053fSPavan Nikhilesh 	struct rte_device *dev;
156295c053fSPavan Nikhilesh 	/**< Device info. supplied by probing */
157295c053fSPavan Nikhilesh 
158295c053fSPavan Nikhilesh 	RTE_STD_C11
159295c053fSPavan Nikhilesh 	uint8_t attached : 1;
160295c053fSPavan Nikhilesh 	/**< Flag indicating the device is attached */
161295c053fSPavan Nikhilesh 
162295c053fSPavan Nikhilesh 	event_enqueue_t enqueue;
163295c053fSPavan Nikhilesh 	/**< Pointer to PMD enqueue function. */
164295c053fSPavan Nikhilesh 	event_enqueue_burst_t enqueue_burst;
165295c053fSPavan Nikhilesh 	/**< Pointer to PMD enqueue burst function. */
166295c053fSPavan Nikhilesh 	event_enqueue_burst_t enqueue_new_burst;
167295c053fSPavan Nikhilesh 	/**< Pointer to PMD enqueue burst function(op new variant) */
168295c053fSPavan Nikhilesh 	event_enqueue_burst_t enqueue_forward_burst;
169295c053fSPavan Nikhilesh 	/**< Pointer to PMD enqueue burst function(op forward variant) */
170295c053fSPavan Nikhilesh 	event_dequeue_t dequeue;
171295c053fSPavan Nikhilesh 	/**< Pointer to PMD dequeue function. */
172295c053fSPavan Nikhilesh 	event_dequeue_burst_t dequeue_burst;
173295c053fSPavan Nikhilesh 	/**< Pointer to PMD dequeue burst function. */
17454f17843SMattias Rönnblom 	event_maintain_t maintain;
17554f17843SMattias Rönnblom 	/**< Pointer to PMD port maintenance function. */
176295c053fSPavan Nikhilesh 	event_tx_adapter_enqueue_t txa_enqueue_same_dest;
177295c053fSPavan Nikhilesh 	/**< Pointer to PMD eth Tx adapter burst enqueue function with
178295c053fSPavan Nikhilesh 	 * events destined to same Eth port & Tx queue.
179295c053fSPavan Nikhilesh 	 */
180295c053fSPavan Nikhilesh 	event_tx_adapter_enqueue_t txa_enqueue;
181295c053fSPavan Nikhilesh 	/**< Pointer to PMD eth Tx adapter enqueue function. */
182295c053fSPavan Nikhilesh 	event_crypto_adapter_enqueue_t ca_enqueue;
183295c053fSPavan Nikhilesh 
184295c053fSPavan Nikhilesh 	uint64_t reserved_64s[4]; /**< Reserved for future fields */
185295c053fSPavan Nikhilesh 	void *reserved_ptrs[3];	  /**< Reserved for future fields */
186295c053fSPavan Nikhilesh } __rte_cache_aligned;
187295c053fSPavan Nikhilesh 
188295c053fSPavan Nikhilesh extern struct rte_eventdev *rte_eventdevs;
189295c053fSPavan Nikhilesh /** @internal The pool of rte_eventdev structures. */
190295c053fSPavan Nikhilesh 
191295c053fSPavan Nikhilesh /**
19299a2dd95SBruce Richardson  * Get the rte_eventdev structure device pointer for the named device.
19399a2dd95SBruce Richardson  *
19499a2dd95SBruce Richardson  * @param name
19599a2dd95SBruce Richardson  *   device name to select the device structure.
19699a2dd95SBruce Richardson  *
19799a2dd95SBruce Richardson  * @return
19899a2dd95SBruce Richardson  *   - The rte_eventdev structure pointer for the given device ID.
19999a2dd95SBruce Richardson  */
20023d06e37SPavan Nikhilesh __rte_internal
20199a2dd95SBruce Richardson static inline struct rte_eventdev *
20299a2dd95SBruce Richardson rte_event_pmd_get_named_dev(const char *name)
20399a2dd95SBruce Richardson {
20499a2dd95SBruce Richardson 	struct rte_eventdev *dev;
20599a2dd95SBruce Richardson 	unsigned int i;
20699a2dd95SBruce Richardson 
20799a2dd95SBruce Richardson 	if (name == NULL)
20899a2dd95SBruce Richardson 		return NULL;
20999a2dd95SBruce Richardson 
21099a2dd95SBruce Richardson 	for (i = 0; i < RTE_EVENT_MAX_DEVS; i++) {
21199a2dd95SBruce Richardson 		dev = &rte_eventdevs[i];
21299a2dd95SBruce Richardson 		if ((dev->attached == RTE_EVENTDEV_ATTACHED) &&
21399a2dd95SBruce Richardson 				(strcmp(dev->data->name, name) == 0))
21499a2dd95SBruce Richardson 			return dev;
21599a2dd95SBruce Richardson 	}
21699a2dd95SBruce Richardson 
21799a2dd95SBruce Richardson 	return NULL;
21899a2dd95SBruce Richardson }
21999a2dd95SBruce Richardson 
22099a2dd95SBruce Richardson /**
22199a2dd95SBruce Richardson  * Validate if the event device index is valid attached event device.
22299a2dd95SBruce Richardson  *
22399a2dd95SBruce Richardson  * @param dev_id
22499a2dd95SBruce Richardson  *   Event device index.
22599a2dd95SBruce Richardson  *
22699a2dd95SBruce Richardson  * @return
22799a2dd95SBruce Richardson  *   - If the device index is valid (1) or not (0).
22899a2dd95SBruce Richardson  */
22923d06e37SPavan Nikhilesh __rte_internal
23099a2dd95SBruce Richardson static inline unsigned
23199a2dd95SBruce Richardson rte_event_pmd_is_valid_dev(uint8_t dev_id)
23299a2dd95SBruce Richardson {
23399a2dd95SBruce Richardson 	struct rte_eventdev *dev;
23499a2dd95SBruce Richardson 
23599a2dd95SBruce Richardson 	if (dev_id >= RTE_EVENT_MAX_DEVS)
23699a2dd95SBruce Richardson 		return 0;
23799a2dd95SBruce Richardson 
23899a2dd95SBruce Richardson 	dev = &rte_eventdevs[dev_id];
23999a2dd95SBruce Richardson 	if (dev->attached != RTE_EVENTDEV_ATTACHED)
24099a2dd95SBruce Richardson 		return 0;
24199a2dd95SBruce Richardson 	else
24299a2dd95SBruce Richardson 		return 1;
24399a2dd95SBruce Richardson }
24499a2dd95SBruce Richardson 
24599a2dd95SBruce Richardson /**
24699a2dd95SBruce Richardson  * Definitions of all functions exported by a driver through the
247b53d106dSSean Morrissey  * generic structure of type *event_dev_ops* supplied in the
24899a2dd95SBruce Richardson  * *rte_eventdev* structure associated with a device.
24999a2dd95SBruce Richardson  */
25099a2dd95SBruce Richardson 
25199a2dd95SBruce Richardson /**
25299a2dd95SBruce Richardson  * Get device information of a device.
25399a2dd95SBruce Richardson  *
25499a2dd95SBruce Richardson  * @param dev
25599a2dd95SBruce Richardson  *   Event device pointer
25699a2dd95SBruce Richardson  * @param dev_info
25799a2dd95SBruce Richardson  *   Event device information structure
25899a2dd95SBruce Richardson  */
25999a2dd95SBruce Richardson typedef void (*eventdev_info_get_t)(struct rte_eventdev *dev,
26099a2dd95SBruce Richardson 		struct rte_event_dev_info *dev_info);
26199a2dd95SBruce Richardson 
26299a2dd95SBruce Richardson /**
26399a2dd95SBruce Richardson  * Configure a device.
26499a2dd95SBruce Richardson  *
26599a2dd95SBruce Richardson  * @param dev
26699a2dd95SBruce Richardson  *   Event device pointer
26799a2dd95SBruce Richardson  *
26899a2dd95SBruce Richardson  * @return
26999a2dd95SBruce Richardson  *   Returns 0 on success
27099a2dd95SBruce Richardson  */
27199a2dd95SBruce Richardson typedef int (*eventdev_configure_t)(const struct rte_eventdev *dev);
27299a2dd95SBruce Richardson 
27399a2dd95SBruce Richardson /**
27499a2dd95SBruce Richardson  * Start a configured device.
27599a2dd95SBruce Richardson  *
27699a2dd95SBruce Richardson  * @param dev
27799a2dd95SBruce Richardson  *   Event device pointer
27899a2dd95SBruce Richardson  *
27999a2dd95SBruce Richardson  * @return
28099a2dd95SBruce Richardson  *   Returns 0 on success
28199a2dd95SBruce Richardson  */
28299a2dd95SBruce Richardson typedef int (*eventdev_start_t)(struct rte_eventdev *dev);
28399a2dd95SBruce Richardson 
28499a2dd95SBruce Richardson /**
28599a2dd95SBruce Richardson  * Stop a configured device.
28699a2dd95SBruce Richardson  *
28799a2dd95SBruce Richardson  * @param dev
28899a2dd95SBruce Richardson  *   Event device pointer
28999a2dd95SBruce Richardson  */
29099a2dd95SBruce Richardson typedef void (*eventdev_stop_t)(struct rte_eventdev *dev);
29199a2dd95SBruce Richardson 
29299a2dd95SBruce Richardson /**
29399a2dd95SBruce Richardson  * Close a configured device.
29499a2dd95SBruce Richardson  *
29599a2dd95SBruce Richardson  * @param dev
29699a2dd95SBruce Richardson  *   Event device pointer
29799a2dd95SBruce Richardson  *
29899a2dd95SBruce Richardson  * @return
29999a2dd95SBruce Richardson  * - 0 on success
30099a2dd95SBruce Richardson  * - (-EAGAIN) if can't close as device is busy
30199a2dd95SBruce Richardson  */
30299a2dd95SBruce Richardson typedef int (*eventdev_close_t)(struct rte_eventdev *dev);
30399a2dd95SBruce Richardson 
30499a2dd95SBruce Richardson /**
30599a2dd95SBruce Richardson  * Retrieve the default event queue configuration.
30699a2dd95SBruce Richardson  *
30799a2dd95SBruce Richardson  * @param dev
30899a2dd95SBruce Richardson  *   Event device pointer
30999a2dd95SBruce Richardson  * @param queue_id
31099a2dd95SBruce Richardson  *   Event queue index
31199a2dd95SBruce Richardson  * @param[out] queue_conf
31299a2dd95SBruce Richardson  *   Event queue configuration structure
31399a2dd95SBruce Richardson  *
31499a2dd95SBruce Richardson  */
31599a2dd95SBruce Richardson typedef void (*eventdev_queue_default_conf_get_t)(struct rte_eventdev *dev,
31699a2dd95SBruce Richardson 		uint8_t queue_id, struct rte_event_queue_conf *queue_conf);
31799a2dd95SBruce Richardson 
31899a2dd95SBruce Richardson /**
31999a2dd95SBruce Richardson  * Setup an event queue.
32099a2dd95SBruce Richardson  *
32199a2dd95SBruce Richardson  * @param dev
32299a2dd95SBruce Richardson  *   Event device pointer
32399a2dd95SBruce Richardson  * @param queue_id
32499a2dd95SBruce Richardson  *   Event queue index
32599a2dd95SBruce Richardson  * @param queue_conf
32699a2dd95SBruce Richardson  *   Event queue configuration structure
32799a2dd95SBruce Richardson  *
32899a2dd95SBruce Richardson  * @return
32999a2dd95SBruce Richardson  *   Returns 0 on success.
33099a2dd95SBruce Richardson  */
33199a2dd95SBruce Richardson typedef int (*eventdev_queue_setup_t)(struct rte_eventdev *dev,
33299a2dd95SBruce Richardson 		uint8_t queue_id,
33399a2dd95SBruce Richardson 		const struct rte_event_queue_conf *queue_conf);
33499a2dd95SBruce Richardson 
33599a2dd95SBruce Richardson /**
33699a2dd95SBruce Richardson  * Release resources allocated by given event queue.
33799a2dd95SBruce Richardson  *
33899a2dd95SBruce Richardson  * @param dev
33999a2dd95SBruce Richardson  *   Event device pointer
34099a2dd95SBruce Richardson  * @param queue_id
34199a2dd95SBruce Richardson  *   Event queue index
34299a2dd95SBruce Richardson  *
34399a2dd95SBruce Richardson  */
34499a2dd95SBruce Richardson typedef void (*eventdev_queue_release_t)(struct rte_eventdev *dev,
34599a2dd95SBruce Richardson 		uint8_t queue_id);
34699a2dd95SBruce Richardson 
34799a2dd95SBruce Richardson /**
34897b914f4SShijith Thotton  * Set an event queue attribute at runtime.
34997b914f4SShijith Thotton  *
35097b914f4SShijith Thotton  * @param dev
35197b914f4SShijith Thotton  *   Event device pointer
35297b914f4SShijith Thotton  * @param queue_id
35397b914f4SShijith Thotton  *   Event queue index
35497b914f4SShijith Thotton  * @param attr_id
35597b914f4SShijith Thotton  *   Event queue attribute id
35697b914f4SShijith Thotton  * @param attr_value
35797b914f4SShijith Thotton  *   Event queue attribute value
35897b914f4SShijith Thotton  *
35997b914f4SShijith Thotton  * @return
36097b914f4SShijith Thotton  *  - 0: Success.
36197b914f4SShijith Thotton  *  - <0: Error code on failure.
36297b914f4SShijith Thotton  */
36397b914f4SShijith Thotton typedef int (*eventdev_queue_attr_set_t)(struct rte_eventdev *dev,
36497b914f4SShijith Thotton 					 uint8_t queue_id, uint32_t attr_id,
36597b914f4SShijith Thotton 					 uint64_t attr_value);
36697b914f4SShijith Thotton 
36797b914f4SShijith Thotton /**
36899a2dd95SBruce Richardson  * Retrieve the default event port configuration.
36999a2dd95SBruce Richardson  *
37099a2dd95SBruce Richardson  * @param dev
37199a2dd95SBruce Richardson  *   Event device pointer
37299a2dd95SBruce Richardson  * @param port_id
37399a2dd95SBruce Richardson  *   Event port index
37499a2dd95SBruce Richardson  * @param[out] port_conf
37599a2dd95SBruce Richardson  *   Event port configuration structure
37699a2dd95SBruce Richardson  *
37799a2dd95SBruce Richardson  */
37899a2dd95SBruce Richardson typedef void (*eventdev_port_default_conf_get_t)(struct rte_eventdev *dev,
37999a2dd95SBruce Richardson 		uint8_t port_id, struct rte_event_port_conf *port_conf);
38099a2dd95SBruce Richardson 
38199a2dd95SBruce Richardson /**
38299a2dd95SBruce Richardson  * Setup an event port.
38399a2dd95SBruce Richardson  *
38499a2dd95SBruce Richardson  * @param dev
38599a2dd95SBruce Richardson  *   Event device pointer
38699a2dd95SBruce Richardson  * @param port_id
38799a2dd95SBruce Richardson  *   Event port index
38899a2dd95SBruce Richardson  * @param port_conf
38999a2dd95SBruce Richardson  *   Event port configuration structure
39099a2dd95SBruce Richardson  *
39199a2dd95SBruce Richardson  * @return
39299a2dd95SBruce Richardson  *   Returns 0 on success.
39399a2dd95SBruce Richardson  */
39499a2dd95SBruce Richardson typedef int (*eventdev_port_setup_t)(struct rte_eventdev *dev,
39599a2dd95SBruce Richardson 		uint8_t port_id,
39699a2dd95SBruce Richardson 		const struct rte_event_port_conf *port_conf);
39799a2dd95SBruce Richardson 
39899a2dd95SBruce Richardson /**
39999a2dd95SBruce Richardson  * Release memory resources allocated by given event port.
40099a2dd95SBruce Richardson  *
40199a2dd95SBruce Richardson  * @param port
40299a2dd95SBruce Richardson  *   Event port pointer
40399a2dd95SBruce Richardson  *
40499a2dd95SBruce Richardson  */
40599a2dd95SBruce Richardson typedef void (*eventdev_port_release_t)(void *port);
40699a2dd95SBruce Richardson 
40799a2dd95SBruce Richardson /**
4081ff23ce6SPavan Nikhilesh  * Quiesce any core specific resources consumed by the event port
4091ff23ce6SPavan Nikhilesh  *
4101ff23ce6SPavan Nikhilesh  * @param dev
4111ff23ce6SPavan Nikhilesh  *   Event device pointer.
4121ff23ce6SPavan Nikhilesh  * @param port
4131ff23ce6SPavan Nikhilesh  *   Event port pointer.
4141ff23ce6SPavan Nikhilesh  * @param flush_cb
4151ff23ce6SPavan Nikhilesh  *   User-provided event flush function.
4161ff23ce6SPavan Nikhilesh  * @param args
4171ff23ce6SPavan Nikhilesh  *   Arguments to be passed to the user-provided event flush function.
4181ff23ce6SPavan Nikhilesh  *
4191ff23ce6SPavan Nikhilesh  */
4201ff23ce6SPavan Nikhilesh typedef void (*eventdev_port_quiesce_t)(struct rte_eventdev *dev, void *port,
4211ff23ce6SPavan Nikhilesh 					rte_eventdev_port_flush_t flush_cb,
4221ff23ce6SPavan Nikhilesh 					void *args);
4231ff23ce6SPavan Nikhilesh 
4241ff23ce6SPavan Nikhilesh /**
42599a2dd95SBruce Richardson  * Link multiple source event queues to destination event port.
42699a2dd95SBruce Richardson  *
42799a2dd95SBruce Richardson  * @param dev
42899a2dd95SBruce Richardson  *   Event device pointer
42999a2dd95SBruce Richardson  * @param port
43099a2dd95SBruce Richardson  *   Event port pointer
43199a2dd95SBruce Richardson  * @param queues
43299a2dd95SBruce Richardson  *   Points to an array of *nb_links* event queues to be linked
43399a2dd95SBruce Richardson  *   to the event port.
43499a2dd95SBruce Richardson  * @param priorities
43599a2dd95SBruce Richardson  *   Points to an array of *nb_links* service priorities associated with each
43699a2dd95SBruce Richardson  *   event queue link to event port.
43799a2dd95SBruce Richardson  * @param nb_links
43899a2dd95SBruce Richardson  *   The number of links to establish
43999a2dd95SBruce Richardson  *
44099a2dd95SBruce Richardson  * @return
44199a2dd95SBruce Richardson  *   Returns 0 on success.
44299a2dd95SBruce Richardson  *
44399a2dd95SBruce Richardson  */
44499a2dd95SBruce Richardson typedef int (*eventdev_port_link_t)(struct rte_eventdev *dev, void *port,
44599a2dd95SBruce Richardson 		const uint8_t queues[], const uint8_t priorities[],
44699a2dd95SBruce Richardson 		uint16_t nb_links);
44799a2dd95SBruce Richardson 
44899a2dd95SBruce Richardson /**
44999a2dd95SBruce Richardson  * Unlink multiple source event queues from destination event port.
45099a2dd95SBruce Richardson  *
45199a2dd95SBruce Richardson  * @param dev
45299a2dd95SBruce Richardson  *   Event device pointer
45399a2dd95SBruce Richardson  * @param port
45499a2dd95SBruce Richardson  *   Event port pointer
45599a2dd95SBruce Richardson  * @param queues
45699a2dd95SBruce Richardson  *   An array of *nb_unlinks* event queues to be unlinked from the event port.
45799a2dd95SBruce Richardson  * @param nb_unlinks
45899a2dd95SBruce Richardson  *   The number of unlinks to establish
45999a2dd95SBruce Richardson  *
46099a2dd95SBruce Richardson  * @return
46199a2dd95SBruce Richardson  *   Returns 0 on success.
46299a2dd95SBruce Richardson  *
46399a2dd95SBruce Richardson  */
46499a2dd95SBruce Richardson typedef int (*eventdev_port_unlink_t)(struct rte_eventdev *dev, void *port,
46599a2dd95SBruce Richardson 		uint8_t queues[], uint16_t nb_unlinks);
46699a2dd95SBruce Richardson 
46799a2dd95SBruce Richardson /**
46899a2dd95SBruce Richardson  * Unlinks in progress. Returns number of unlinks that the PMD is currently
46999a2dd95SBruce Richardson  * performing, but have not yet been completed.
47099a2dd95SBruce Richardson  *
47199a2dd95SBruce Richardson  * @param dev
47299a2dd95SBruce Richardson  *   Event device pointer
47399a2dd95SBruce Richardson  *
47499a2dd95SBruce Richardson  * @param port
47599a2dd95SBruce Richardson  *   Event port pointer
47699a2dd95SBruce Richardson  *
47799a2dd95SBruce Richardson  * @return
47899a2dd95SBruce Richardson  *   Returns the number of in-progress unlinks. Zero is returned if none are
47999a2dd95SBruce Richardson  *   in progress.
48099a2dd95SBruce Richardson  */
48199a2dd95SBruce Richardson typedef int (*eventdev_port_unlinks_in_progress_t)(struct rte_eventdev *dev,
48299a2dd95SBruce Richardson 		void *port);
48399a2dd95SBruce Richardson 
48499a2dd95SBruce Richardson /**
48599a2dd95SBruce Richardson  * Converts nanoseconds to *timeout_ticks* value for rte_event_dequeue()
48699a2dd95SBruce Richardson  *
48799a2dd95SBruce Richardson  * @param dev
48899a2dd95SBruce Richardson  *   Event device pointer
48999a2dd95SBruce Richardson  * @param ns
49099a2dd95SBruce Richardson  *   Wait time in nanosecond
49199a2dd95SBruce Richardson  * @param[out] timeout_ticks
49299a2dd95SBruce Richardson  *   Value for the *timeout_ticks* parameter in rte_event_dequeue() function
49399a2dd95SBruce Richardson  *
49499a2dd95SBruce Richardson  * @return
49599a2dd95SBruce Richardson  *   Returns 0 on success.
49699a2dd95SBruce Richardson  *
49799a2dd95SBruce Richardson  */
49899a2dd95SBruce Richardson typedef int (*eventdev_dequeue_timeout_ticks_t)(struct rte_eventdev *dev,
49999a2dd95SBruce Richardson 		uint64_t ns, uint64_t *timeout_ticks);
50099a2dd95SBruce Richardson 
50199a2dd95SBruce Richardson /**
50299a2dd95SBruce Richardson  * Dump internal information
50399a2dd95SBruce Richardson  *
50499a2dd95SBruce Richardson  * @param dev
50599a2dd95SBruce Richardson  *   Event device pointer
50699a2dd95SBruce Richardson  * @param f
50799a2dd95SBruce Richardson  *   A pointer to a file for output
50899a2dd95SBruce Richardson  *
50999a2dd95SBruce Richardson  */
51099a2dd95SBruce Richardson typedef void (*eventdev_dump_t)(struct rte_eventdev *dev, FILE *f);
51199a2dd95SBruce Richardson 
51299a2dd95SBruce Richardson /**
51399a2dd95SBruce Richardson  * Retrieve a set of statistics from device
51499a2dd95SBruce Richardson  *
51599a2dd95SBruce Richardson  * @param dev
51699a2dd95SBruce Richardson  *   Event device pointer
51799a2dd95SBruce Richardson  * @param mode
51899a2dd95SBruce Richardson  *   Level (device, port or queue)
51999a2dd95SBruce Richardson  * @param queue_port_id
52099a2dd95SBruce Richardson  *   Queue or port number depending on mode
52199a2dd95SBruce Richardson  * @param ids
52299a2dd95SBruce Richardson  *   The stat ids to retrieve
52399a2dd95SBruce Richardson  * @param values
52499a2dd95SBruce Richardson  *   The returned stat values
52599a2dd95SBruce Richardson  * @param n
52699a2dd95SBruce Richardson  *   The number of id values and entries in the values array
52799a2dd95SBruce Richardson  * @return
52899a2dd95SBruce Richardson  *   The number of stat values successfully filled into the values array
52999a2dd95SBruce Richardson  */
53099a2dd95SBruce Richardson typedef int (*eventdev_xstats_get_t)(const struct rte_eventdev *dev,
53199a2dd95SBruce Richardson 		enum rte_event_dev_xstats_mode mode, uint8_t queue_port_id,
53299a2dd95SBruce Richardson 		const unsigned int ids[], uint64_t values[], unsigned int n);
53399a2dd95SBruce Richardson 
53499a2dd95SBruce Richardson /**
53599a2dd95SBruce Richardson  * Resets the statistic values in xstats for the device, based on mode.
53699a2dd95SBruce Richardson  */
53799a2dd95SBruce Richardson typedef int (*eventdev_xstats_reset_t)(struct rte_eventdev *dev,
53899a2dd95SBruce Richardson 		enum rte_event_dev_xstats_mode mode,
53999a2dd95SBruce Richardson 		int16_t queue_port_id,
54099a2dd95SBruce Richardson 		const uint32_t ids[],
54199a2dd95SBruce Richardson 		uint32_t nb_ids);
54299a2dd95SBruce Richardson 
54399a2dd95SBruce Richardson /**
54499a2dd95SBruce Richardson  * Get names of extended stats of an event device
54599a2dd95SBruce Richardson  *
54699a2dd95SBruce Richardson  * @param dev
54799a2dd95SBruce Richardson  *   Event device pointer
54899a2dd95SBruce Richardson  * @param mode
54999a2dd95SBruce Richardson  *   Level (device, port or queue)
55099a2dd95SBruce Richardson  * @param queue_port_id
55199a2dd95SBruce Richardson  *   Queue or port number depending on mode
55299a2dd95SBruce Richardson  * @param xstats_names
55399a2dd95SBruce Richardson  *   Array of name values to be filled in
55499a2dd95SBruce Richardson  * @param ids
55599a2dd95SBruce Richardson  *   The stat ids to retrieve
55699a2dd95SBruce Richardson  * @param size
55799a2dd95SBruce Richardson  *   Number of values in the xstats_names array
55899a2dd95SBruce Richardson  * @return
55999a2dd95SBruce Richardson  *   When size >= the number of stats, return the number of stat values filled
56099a2dd95SBruce Richardson  *   into the array.
56199a2dd95SBruce Richardson  *   When size < the number of available stats, return the number of stats
56299a2dd95SBruce Richardson  *   values, and do not fill in any data into xstats_names.
56399a2dd95SBruce Richardson  */
56499a2dd95SBruce Richardson typedef int (*eventdev_xstats_get_names_t)(const struct rte_eventdev *dev,
56599a2dd95SBruce Richardson 		enum rte_event_dev_xstats_mode mode, uint8_t queue_port_id,
56699a2dd95SBruce Richardson 		struct rte_event_dev_xstats_name *xstats_names,
56799a2dd95SBruce Richardson 		unsigned int *ids, unsigned int size);
56899a2dd95SBruce Richardson 
56999a2dd95SBruce Richardson /**
57099a2dd95SBruce Richardson  * Get value of one stats and optionally return its id
57199a2dd95SBruce Richardson  *
57299a2dd95SBruce Richardson  * @param dev
57399a2dd95SBruce Richardson  *   Event device pointer
57499a2dd95SBruce Richardson  * @param name
57599a2dd95SBruce Richardson  *   The name of the stat to retrieve
57699a2dd95SBruce Richardson  * @param id
57799a2dd95SBruce Richardson  *   Pointer to an unsigned int where we store the stat-id for future reference.
57899a2dd95SBruce Richardson  *   This pointer may be null if the id is not required.
57999a2dd95SBruce Richardson  * @return
58099a2dd95SBruce Richardson  *   The value of the stat, or (uint64_t)-1 if the stat is not found.
58199a2dd95SBruce Richardson  *   If the stat is not found, the id value will be returned as (unsigned)-1,
58299a2dd95SBruce Richardson  *   if id pointer is non-NULL
58399a2dd95SBruce Richardson  */
58499a2dd95SBruce Richardson typedef uint64_t (*eventdev_xstats_get_by_name)(const struct rte_eventdev *dev,
58599a2dd95SBruce Richardson 		const char *name, unsigned int *id);
58699a2dd95SBruce Richardson 
58799a2dd95SBruce Richardson 
58899a2dd95SBruce Richardson /**
58999a2dd95SBruce Richardson  * Retrieve the event device's ethdev Rx adapter capabilities for the
59099a2dd95SBruce Richardson  * specified ethernet port
59199a2dd95SBruce Richardson  *
59299a2dd95SBruce Richardson  * @param dev
59399a2dd95SBruce Richardson  *   Event device pointer
59499a2dd95SBruce Richardson  *
59599a2dd95SBruce Richardson  * @param eth_dev
59699a2dd95SBruce Richardson  *   Ethernet device pointer
59799a2dd95SBruce Richardson  *
59899a2dd95SBruce Richardson  * @param[out] caps
59999a2dd95SBruce Richardson  *   A pointer to memory filled with Rx event adapter capabilities.
60099a2dd95SBruce Richardson  *
60199a2dd95SBruce Richardson  * @return
60299a2dd95SBruce Richardson  *   - 0: Success, driver provides Rx event adapter capabilities for the
60399a2dd95SBruce Richardson  *	ethernet device.
60499a2dd95SBruce Richardson  *   - <0: Error code returned by the driver function.
60599a2dd95SBruce Richardson  *
60699a2dd95SBruce Richardson  */
60799a2dd95SBruce Richardson typedef int (*eventdev_eth_rx_adapter_caps_get_t)
60899a2dd95SBruce Richardson 					(const struct rte_eventdev *dev,
60999a2dd95SBruce Richardson 					const struct rte_eth_dev *eth_dev,
61099a2dd95SBruce Richardson 					uint32_t *caps);
61199a2dd95SBruce Richardson 
61299a2dd95SBruce Richardson struct rte_event_eth_rx_adapter_queue_conf;
61399a2dd95SBruce Richardson 
61499a2dd95SBruce Richardson /**
61599a2dd95SBruce Richardson  * Retrieve the event device's timer adapter capabilities, as well as the ops
61699a2dd95SBruce Richardson  * structure that an event timer adapter should call through to enter the
61799a2dd95SBruce Richardson  * driver
61899a2dd95SBruce Richardson  *
61999a2dd95SBruce Richardson  * @param dev
62099a2dd95SBruce Richardson  *   Event device pointer
62199a2dd95SBruce Richardson  *
62299a2dd95SBruce Richardson  * @param flags
62399a2dd95SBruce Richardson  *   Flags that can be used to determine how to select an event timer
62499a2dd95SBruce Richardson  *   adapter ops structure
62599a2dd95SBruce Richardson  *
62699a2dd95SBruce Richardson  * @param[out] caps
62799a2dd95SBruce Richardson  *   A pointer to memory filled with Rx event adapter capabilities.
62899a2dd95SBruce Richardson  *
62999a2dd95SBruce Richardson  * @param[out] ops
63099a2dd95SBruce Richardson  *   A pointer to the ops pointer to set with the address of the desired ops
63199a2dd95SBruce Richardson  *   structure
63299a2dd95SBruce Richardson  *
63399a2dd95SBruce Richardson  * @return
63499a2dd95SBruce Richardson  *   - 0: Success, driver provides Rx event adapter capabilities for the
63599a2dd95SBruce Richardson  *	ethernet device.
63699a2dd95SBruce Richardson  *   - <0: Error code returned by the driver function.
63799a2dd95SBruce Richardson  *
63899a2dd95SBruce Richardson  */
63999a2dd95SBruce Richardson typedef int (*eventdev_timer_adapter_caps_get_t)(
64053548ad3SPavan Nikhilesh 	const struct rte_eventdev *dev, uint64_t flags, uint32_t *caps,
64153548ad3SPavan Nikhilesh 	const struct event_timer_adapter_ops **ops);
64299a2dd95SBruce Richardson 
64399a2dd95SBruce Richardson /**
64499a2dd95SBruce Richardson  * Add ethernet Rx queues to event device. This callback is invoked if
64599a2dd95SBruce Richardson  * the caps returned from rte_eventdev_eth_rx_adapter_caps_get(, eth_port_id)
64699a2dd95SBruce Richardson  * has RTE_EVENT_ETH_RX_ADAPTER_CAP_INTERNAL_PORT set.
64799a2dd95SBruce Richardson  *
64899a2dd95SBruce Richardson  * @param dev
64999a2dd95SBruce Richardson  *   Event device pointer
65099a2dd95SBruce Richardson  *
65199a2dd95SBruce Richardson  * @param eth_dev
65299a2dd95SBruce Richardson  *   Ethernet device pointer
65399a2dd95SBruce Richardson  *
65499a2dd95SBruce Richardson  * @param rx_queue_id
65599a2dd95SBruce Richardson  *   Ethernet device receive queue index
65699a2dd95SBruce Richardson  *
65799a2dd95SBruce Richardson  * @param queue_conf
65899a2dd95SBruce Richardson  *  Additional configuration structure
65999a2dd95SBruce Richardson 
66099a2dd95SBruce Richardson  * @return
66199a2dd95SBruce Richardson  *   - 0: Success, ethernet receive queue added successfully.
66299a2dd95SBruce Richardson  *   - <0: Error code returned by the driver function.
66399a2dd95SBruce Richardson  *
66499a2dd95SBruce Richardson  */
66599a2dd95SBruce Richardson typedef int (*eventdev_eth_rx_adapter_queue_add_t)(
66699a2dd95SBruce Richardson 		const struct rte_eventdev *dev,
66799a2dd95SBruce Richardson 		const struct rte_eth_dev *eth_dev,
66899a2dd95SBruce Richardson 		int32_t rx_queue_id,
66999a2dd95SBruce Richardson 		const struct rte_event_eth_rx_adapter_queue_conf *queue_conf);
67099a2dd95SBruce Richardson 
67199a2dd95SBruce Richardson /**
67299a2dd95SBruce Richardson  * Delete ethernet Rx queues from event device. This callback is invoked if
67399a2dd95SBruce Richardson  * the caps returned from eventdev_eth_rx_adapter_caps_get(, eth_port_id)
67499a2dd95SBruce Richardson  * has RTE_EVENT_ETH_RX_ADAPTER_CAP_INTERNAL_PORT set.
67599a2dd95SBruce Richardson  *
67699a2dd95SBruce Richardson  * @param dev
67799a2dd95SBruce Richardson  *   Event device pointer
67899a2dd95SBruce Richardson  *
67999a2dd95SBruce Richardson  * @param eth_dev
68099a2dd95SBruce Richardson  *   Ethernet device pointer
68199a2dd95SBruce Richardson  *
68299a2dd95SBruce Richardson  * @param rx_queue_id
68399a2dd95SBruce Richardson  *   Ethernet device receive queue index
68499a2dd95SBruce Richardson  *
68599a2dd95SBruce Richardson  * @return
68699a2dd95SBruce Richardson  *   - 0: Success, ethernet receive queue deleted successfully.
68799a2dd95SBruce Richardson  *   - <0: Error code returned by the driver function.
68899a2dd95SBruce Richardson  *
68999a2dd95SBruce Richardson  */
69099a2dd95SBruce Richardson typedef int (*eventdev_eth_rx_adapter_queue_del_t)
69199a2dd95SBruce Richardson 					(const struct rte_eventdev *dev,
69299a2dd95SBruce Richardson 					const struct rte_eth_dev *eth_dev,
69399a2dd95SBruce Richardson 					int32_t rx_queue_id);
69499a2dd95SBruce Richardson 
69599a2dd95SBruce Richardson /**
696da781e64SGanapati Kundapura  * Retrieve Rx adapter queue config information for the specified
697da781e64SGanapati Kundapura  * rx queue ID.
698da781e64SGanapati Kundapura  *
699da781e64SGanapati Kundapura  * @param dev
700da781e64SGanapati Kundapura  *  Event device pointer
701da781e64SGanapati Kundapura  *
702da781e64SGanapati Kundapura  * @param eth_dev
703da781e64SGanapati Kundapura  *  Ethernet device pointer
704da781e64SGanapati Kundapura  *
705da781e64SGanapati Kundapura  * @param rx_queue_id
706da781e64SGanapati Kundapura  *  Ethernet device receive queue index.
707da781e64SGanapati Kundapura  *
708da781e64SGanapati Kundapura  * @param[out] queue_conf
709da781e64SGanapati Kundapura  *  Pointer to rte_event_eth_rx_adapter_queue_conf structure
710da781e64SGanapati Kundapura  *
711da781e64SGanapati Kundapura  * @return
712da781e64SGanapati Kundapura  *  - 0: Success
713da781e64SGanapati Kundapura  *  - <0: Error code on failure.
714da781e64SGanapati Kundapura  */
715da781e64SGanapati Kundapura typedef int (*eventdev_eth_rx_adapter_queue_conf_get_t)
716da781e64SGanapati Kundapura 			(const struct rte_eventdev *dev,
717da781e64SGanapati Kundapura 			const struct rte_eth_dev *eth_dev,
718da781e64SGanapati Kundapura 			uint16_t rx_queue_id,
719da781e64SGanapati Kundapura 			struct rte_event_eth_rx_adapter_queue_conf *queue_conf);
720da781e64SGanapati Kundapura 
721da781e64SGanapati Kundapura /**
72299a2dd95SBruce Richardson  * Start ethernet Rx adapter. This callback is invoked if
72399a2dd95SBruce Richardson  * the caps returned from eventdev_eth_rx_adapter_caps_get(.., eth_port_id)
72499a2dd95SBruce Richardson  * has RTE_EVENT_ETH_RX_ADAPTER_CAP_INTERNAL_PORT set and Rx queues
72599a2dd95SBruce Richardson  * from eth_port_id have been added to the event device.
72699a2dd95SBruce Richardson  *
72799a2dd95SBruce Richardson  * @param dev
72899a2dd95SBruce Richardson  *   Event device pointer
72999a2dd95SBruce Richardson  *
73099a2dd95SBruce Richardson  * @param eth_dev
73199a2dd95SBruce Richardson  *   Ethernet device pointer
73299a2dd95SBruce Richardson  *
73399a2dd95SBruce Richardson  * @return
73499a2dd95SBruce Richardson  *   - 0: Success, ethernet Rx adapter started successfully.
73599a2dd95SBruce Richardson  *   - <0: Error code returned by the driver function.
73699a2dd95SBruce Richardson  */
73799a2dd95SBruce Richardson typedef int (*eventdev_eth_rx_adapter_start_t)
73899a2dd95SBruce Richardson 					(const struct rte_eventdev *dev,
73999a2dd95SBruce Richardson 					const struct rte_eth_dev *eth_dev);
74099a2dd95SBruce Richardson 
74199a2dd95SBruce Richardson /**
74299a2dd95SBruce Richardson  * Stop ethernet Rx adapter. This callback is invoked if
74399a2dd95SBruce Richardson  * the caps returned from eventdev_eth_rx_adapter_caps_get(..,eth_port_id)
74499a2dd95SBruce Richardson  * has RTE_EVENT_ETH_RX_ADAPTER_CAP_INTERNAL_PORT set and Rx queues
74599a2dd95SBruce Richardson  * from eth_port_id have been added to the event device.
74699a2dd95SBruce Richardson  *
74799a2dd95SBruce Richardson  * @param dev
74899a2dd95SBruce Richardson  *   Event device pointer
74999a2dd95SBruce Richardson  *
75099a2dd95SBruce Richardson  * @param eth_dev
75199a2dd95SBruce Richardson  *   Ethernet device pointer
75299a2dd95SBruce Richardson  *
75399a2dd95SBruce Richardson  * @return
75499a2dd95SBruce Richardson  *   - 0: Success, ethernet Rx adapter stopped successfully.
75599a2dd95SBruce Richardson  *   - <0: Error code returned by the driver function.
75699a2dd95SBruce Richardson  */
75799a2dd95SBruce Richardson typedef int (*eventdev_eth_rx_adapter_stop_t)
75899a2dd95SBruce Richardson 					(const struct rte_eventdev *dev,
75999a2dd95SBruce Richardson 					const struct rte_eth_dev *eth_dev);
76099a2dd95SBruce Richardson 
76199a2dd95SBruce Richardson struct rte_event_eth_rx_adapter_stats;
76299a2dd95SBruce Richardson 
76399a2dd95SBruce Richardson /**
76499a2dd95SBruce Richardson  * Retrieve ethernet Rx adapter statistics.
76599a2dd95SBruce Richardson  *
76699a2dd95SBruce Richardson  * @param dev
76799a2dd95SBruce Richardson  *   Event device pointer
76899a2dd95SBruce Richardson  *
76999a2dd95SBruce Richardson  * @param eth_dev
77099a2dd95SBruce Richardson  *   Ethernet device pointer
77199a2dd95SBruce Richardson  *
77299a2dd95SBruce Richardson  * @param[out] stats
77399a2dd95SBruce Richardson  *   Pointer to stats structure
77499a2dd95SBruce Richardson  *
77599a2dd95SBruce Richardson  * @return
77699a2dd95SBruce Richardson  *   Return 0 on success.
77799a2dd95SBruce Richardson  */
77899a2dd95SBruce Richardson 
77999a2dd95SBruce Richardson typedef int (*eventdev_eth_rx_adapter_stats_get)
78099a2dd95SBruce Richardson 			(const struct rte_eventdev *dev,
78199a2dd95SBruce Richardson 			const struct rte_eth_dev *eth_dev,
78299a2dd95SBruce Richardson 			struct rte_event_eth_rx_adapter_stats *stats);
78399a2dd95SBruce Richardson /**
78499a2dd95SBruce Richardson  * Reset ethernet Rx adapter statistics.
78599a2dd95SBruce Richardson  *
78699a2dd95SBruce Richardson  * @param dev
78799a2dd95SBruce Richardson  *   Event device pointer
78899a2dd95SBruce Richardson  *
78999a2dd95SBruce Richardson  * @param eth_dev
79099a2dd95SBruce Richardson  *   Ethernet device pointer
79199a2dd95SBruce Richardson  *
79299a2dd95SBruce Richardson  * @return
79399a2dd95SBruce Richardson  *   Return 0 on success.
79499a2dd95SBruce Richardson  */
79599a2dd95SBruce Richardson typedef int (*eventdev_eth_rx_adapter_stats_reset)
79699a2dd95SBruce Richardson 			(const struct rte_eventdev *dev,
79799a2dd95SBruce Richardson 			const struct rte_eth_dev *eth_dev);
798995b150cSNaga Harish K S V 
799995b150cSNaga Harish K S V struct rte_event_eth_rx_adapter_queue_stats;
800995b150cSNaga Harish K S V 
801995b150cSNaga Harish K S V /**
802995b150cSNaga Harish K S V  * Retrieve ethernet Rx adapter queue statistics.
803995b150cSNaga Harish K S V  *
804995b150cSNaga Harish K S V  * @param dev
805995b150cSNaga Harish K S V  *   Event device pointer
806995b150cSNaga Harish K S V  *
807995b150cSNaga Harish K S V  * @param eth_dev
808995b150cSNaga Harish K S V  *   Ethernet device pointer
809995b150cSNaga Harish K S V  *
810995b150cSNaga Harish K S V  * @param rx_queue_id
811995b150cSNaga Harish K S V  *  Ethernet device receive queue index.
812995b150cSNaga Harish K S V  *
813995b150cSNaga Harish K S V  * @param[out] q_stats
814995b150cSNaga Harish K S V  *   Pointer to queue stats structure
815995b150cSNaga Harish K S V  *
816995b150cSNaga Harish K S V  * @return
817995b150cSNaga Harish K S V  *   Return 0 on success.
818995b150cSNaga Harish K S V  */
819995b150cSNaga Harish K S V typedef int (*eventdev_eth_rx_adapter_q_stats_get)
820995b150cSNaga Harish K S V 			(const struct rte_eventdev *dev,
821995b150cSNaga Harish K S V 			 const struct rte_eth_dev *eth_dev,
822995b150cSNaga Harish K S V 			 uint16_t rx_queue_id,
823995b150cSNaga Harish K S V 			 struct rte_event_eth_rx_adapter_queue_stats *q_stats);
824995b150cSNaga Harish K S V 
825995b150cSNaga Harish K S V /**
826995b150cSNaga Harish K S V  * Reset ethernet Rx adapter queue statistics.
827995b150cSNaga Harish K S V  *
828995b150cSNaga Harish K S V  * @param dev
829995b150cSNaga Harish K S V  *   Event device pointer
830995b150cSNaga Harish K S V  *
831995b150cSNaga Harish K S V  * @param eth_dev
832995b150cSNaga Harish K S V  *   Ethernet device pointer
833995b150cSNaga Harish K S V  *
834995b150cSNaga Harish K S V  * @param rx_queue_id
835995b150cSNaga Harish K S V  *  Ethernet device receive queue index.
836995b150cSNaga Harish K S V  *
837995b150cSNaga Harish K S V  * @return
838995b150cSNaga Harish K S V  *   Return 0 on success.
839995b150cSNaga Harish K S V  */
840995b150cSNaga Harish K S V typedef int (*eventdev_eth_rx_adapter_q_stats_reset)
841995b150cSNaga Harish K S V 			(const struct rte_eventdev *dev,
842995b150cSNaga Harish K S V 			 const struct rte_eth_dev *eth_dev,
843995b150cSNaga Harish K S V 			 uint16_t rx_queue_id);
844995b150cSNaga Harish K S V 
84599a2dd95SBruce Richardson /**
84699a2dd95SBruce Richardson  * Start eventdev selftest.
84799a2dd95SBruce Richardson  *
84899a2dd95SBruce Richardson  * @return
84999a2dd95SBruce Richardson  *   Return 0 on success.
85099a2dd95SBruce Richardson  */
85199a2dd95SBruce Richardson typedef int (*eventdev_selftest)(void);
85299a2dd95SBruce Richardson 
85399a2dd95SBruce Richardson struct rte_event_eth_rx_adapter_vector_limits;
85499a2dd95SBruce Richardson /**
85599a2dd95SBruce Richardson  * Get event vector limits for a given event, ethernet device pair.
85699a2dd95SBruce Richardson  *
85799a2dd95SBruce Richardson  * @param dev
85899a2dd95SBruce Richardson  *   Event device pointer
85999a2dd95SBruce Richardson  *
86099a2dd95SBruce Richardson  * @param eth_dev
86199a2dd95SBruce Richardson  *   Ethernet device pointer
86299a2dd95SBruce Richardson  *
86399a2dd95SBruce Richardson  * @param[out] limits
86499a2dd95SBruce Richardson  *   Pointer to the limits structure to be filled.
86599a2dd95SBruce Richardson  *
86699a2dd95SBruce Richardson  * @return
86799a2dd95SBruce Richardson  *   - 0: Success.
86899a2dd95SBruce Richardson  *   - <0: Error code returned by the driver function.
86999a2dd95SBruce Richardson  */
87099a2dd95SBruce Richardson typedef int (*eventdev_eth_rx_adapter_vector_limits_get_t)(
87199a2dd95SBruce Richardson 	const struct rte_eventdev *dev, const struct rte_eth_dev *eth_dev,
87299a2dd95SBruce Richardson 	struct rte_event_eth_rx_adapter_vector_limits *limits);
87399a2dd95SBruce Richardson 
874a1793ee8SGanapati Kundapura /**
875a1793ee8SGanapati Kundapura  * Get Rx adapter instance ID for Rx queue
876a1793ee8SGanapati Kundapura  *
877a1793ee8SGanapati Kundapura  * @param eth_dev_id
878a1793ee8SGanapati Kundapura  *  Port identifier of ethernet device
879a1793ee8SGanapati Kundapura  *
880a1793ee8SGanapati Kundapura  * @param rx_queue_id
881a1793ee8SGanapati Kundapura  *  Ethernet device Rx queue index
882a1793ee8SGanapati Kundapura  *
883a1793ee8SGanapati Kundapura  * @param[out] rxa_inst_id
884a1793ee8SGanapati Kundapura  *  Pointer to Rx adapter instance identifier.
885a1793ee8SGanapati Kundapura  *  Contains valid Rx adapter instance ID when return value is 0
886a1793ee8SGanapati Kundapura  *
887a1793ee8SGanapati Kundapura  * @return
888a1793ee8SGanapati Kundapura  *   -  0: Success
889a1793ee8SGanapati Kundapura  *   - <0: Error code on failure
890a1793ee8SGanapati Kundapura  */
891a1793ee8SGanapati Kundapura typedef int (*eventdev_eth_rx_adapter_instance_get_t)
892a1793ee8SGanapati Kundapura 	(uint16_t eth_dev_id, uint16_t rx_queue_id, uint8_t *rxa_inst_id);
893a1793ee8SGanapati Kundapura 
89499a2dd95SBruce Richardson typedef uint32_t rte_event_pmd_selftest_seqn_t;
89599a2dd95SBruce Richardson extern int rte_event_pmd_selftest_seqn_dynfield_offset;
89699a2dd95SBruce Richardson 
89799a2dd95SBruce Richardson /**
89899a2dd95SBruce Richardson  * Read test sequence number from mbuf.
89999a2dd95SBruce Richardson  *
90099a2dd95SBruce Richardson  * @param mbuf Structure to read from.
90199a2dd95SBruce Richardson  * @return pointer to test sequence number.
90299a2dd95SBruce Richardson  */
90399a2dd95SBruce Richardson __rte_internal
90499a2dd95SBruce Richardson static inline rte_event_pmd_selftest_seqn_t *
90599a2dd95SBruce Richardson rte_event_pmd_selftest_seqn(struct rte_mbuf *mbuf)
90699a2dd95SBruce Richardson {
90799a2dd95SBruce Richardson 	return RTE_MBUF_DYNFIELD(mbuf,
90899a2dd95SBruce Richardson 		rte_event_pmd_selftest_seqn_dynfield_offset,
90999a2dd95SBruce Richardson 		rte_event_pmd_selftest_seqn_t *);
91099a2dd95SBruce Richardson }
91199a2dd95SBruce Richardson 
91299a2dd95SBruce Richardson struct rte_cryptodev;
913*c1749bc5SVolodymyr Fialko struct rte_event_crypto_adapter_queue_conf;
91499a2dd95SBruce Richardson 
91599a2dd95SBruce Richardson /**
91699a2dd95SBruce Richardson  * This API may change without prior notice
91799a2dd95SBruce Richardson  *
91899a2dd95SBruce Richardson  * Retrieve the event device's crypto adapter capabilities for the
91999a2dd95SBruce Richardson  * specified cryptodev
92099a2dd95SBruce Richardson  *
92199a2dd95SBruce Richardson  * @param dev
92299a2dd95SBruce Richardson  *   Event device pointer
92399a2dd95SBruce Richardson  *
92499a2dd95SBruce Richardson  * @param cdev
92599a2dd95SBruce Richardson  *   cryptodev pointer
92699a2dd95SBruce Richardson  *
92799a2dd95SBruce Richardson  * @param[out] caps
92899a2dd95SBruce Richardson  *   A pointer to memory filled with event adapter capabilities.
92999a2dd95SBruce Richardson  *   It is expected to be pre-allocated & initialized by caller.
93099a2dd95SBruce Richardson  *
93199a2dd95SBruce Richardson  * @return
93299a2dd95SBruce Richardson  *   - 0: Success, driver provides event adapter capabilities for the
93399a2dd95SBruce Richardson  *	cryptodev.
93499a2dd95SBruce Richardson  *   - <0: Error code returned by the driver function.
93599a2dd95SBruce Richardson  *
93699a2dd95SBruce Richardson  */
93799a2dd95SBruce Richardson typedef int (*eventdev_crypto_adapter_caps_get_t)
93899a2dd95SBruce Richardson 					(const struct rte_eventdev *dev,
93999a2dd95SBruce Richardson 					 const struct rte_cryptodev *cdev,
94099a2dd95SBruce Richardson 					 uint32_t *caps);
94199a2dd95SBruce Richardson 
94299a2dd95SBruce Richardson /**
94399a2dd95SBruce Richardson  * This API may change without prior notice
94499a2dd95SBruce Richardson  *
94599a2dd95SBruce Richardson  * Add crypto queue pair to event device. This callback is invoked if
94699a2dd95SBruce Richardson  * the caps returned from rte_event_crypto_adapter_caps_get(, cdev_id)
94799a2dd95SBruce Richardson  * has RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_* set.
94899a2dd95SBruce Richardson  *
94999a2dd95SBruce Richardson  * @param dev
95099a2dd95SBruce Richardson  *   Event device pointer
95199a2dd95SBruce Richardson  *
95299a2dd95SBruce Richardson  * @param cdev
95399a2dd95SBruce Richardson  *   cryptodev pointer
95499a2dd95SBruce Richardson  *
95599a2dd95SBruce Richardson  * @param queue_pair_id
95699a2dd95SBruce Richardson  *   cryptodev queue pair identifier.
95799a2dd95SBruce Richardson  *
95899a2dd95SBruce Richardson  * @param event
95999a2dd95SBruce Richardson  *  Event information required for binding cryptodev queue pair to event queue.
96099a2dd95SBruce Richardson  *  This structure will have a valid value for only those HW PMDs supporting
96199a2dd95SBruce Richardson  *  @see RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_QP_EV_BIND capability.
96299a2dd95SBruce Richardson  *
96399a2dd95SBruce Richardson  * @return
96499a2dd95SBruce Richardson  *   - 0: Success, cryptodev queue pair added successfully.
96599a2dd95SBruce Richardson  *   - <0: Error code returned by the driver function.
96699a2dd95SBruce Richardson  *
96799a2dd95SBruce Richardson  */
968*c1749bc5SVolodymyr Fialko typedef int (*eventdev_crypto_adapter_queue_pair_add_t)(
969*c1749bc5SVolodymyr Fialko 		const struct rte_eventdev *dev,
97099a2dd95SBruce Richardson 		const struct rte_cryptodev *cdev,
97199a2dd95SBruce Richardson 		int32_t queue_pair_id,
972*c1749bc5SVolodymyr Fialko 		const struct rte_event_crypto_adapter_queue_conf *queue_conf);
97399a2dd95SBruce Richardson 
97499a2dd95SBruce Richardson 
97599a2dd95SBruce Richardson /**
97699a2dd95SBruce Richardson  * This API may change without prior notice
97799a2dd95SBruce Richardson  *
97899a2dd95SBruce Richardson  * Delete crypto queue pair to event device. This callback is invoked if
97999a2dd95SBruce Richardson  * the caps returned from rte_event_crypto_adapter_caps_get(, cdev_id)
98099a2dd95SBruce Richardson  * has RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_* set.
98199a2dd95SBruce Richardson  *
98299a2dd95SBruce Richardson  * @param dev
98399a2dd95SBruce Richardson  *   Event device pointer
98499a2dd95SBruce Richardson  *
98599a2dd95SBruce Richardson  * @param cdev
98699a2dd95SBruce Richardson  *   cryptodev pointer
98799a2dd95SBruce Richardson  *
98899a2dd95SBruce Richardson  * @param queue_pair_id
98999a2dd95SBruce Richardson  *   cryptodev queue pair identifier.
99099a2dd95SBruce Richardson  *
99199a2dd95SBruce Richardson  * @return
99299a2dd95SBruce Richardson  *   - 0: Success, cryptodev queue pair deleted successfully.
99399a2dd95SBruce Richardson  *   - <0: Error code returned by the driver function.
99499a2dd95SBruce Richardson  *
99599a2dd95SBruce Richardson  */
99699a2dd95SBruce Richardson typedef int (*eventdev_crypto_adapter_queue_pair_del_t)
99799a2dd95SBruce Richardson 					(const struct rte_eventdev *dev,
99899a2dd95SBruce Richardson 					 const struct rte_cryptodev *cdev,
99999a2dd95SBruce Richardson 					 int32_t queue_pair_id);
100099a2dd95SBruce Richardson 
100199a2dd95SBruce Richardson /**
100299a2dd95SBruce Richardson  * Start crypto adapter. This callback is invoked if
100399a2dd95SBruce Richardson  * the caps returned from rte_event_crypto_adapter_caps_get(.., cdev_id)
100499a2dd95SBruce Richardson  * has RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_* set and queue pairs
100599a2dd95SBruce Richardson  * from cdev_id have been added to the event device.
100699a2dd95SBruce Richardson  *
100799a2dd95SBruce Richardson  * @param dev
100899a2dd95SBruce Richardson  *   Event device pointer
100999a2dd95SBruce Richardson  *
101099a2dd95SBruce Richardson  * @param cdev
101199a2dd95SBruce Richardson  *   Crypto device pointer
101299a2dd95SBruce Richardson  *
101399a2dd95SBruce Richardson  * @return
101499a2dd95SBruce Richardson  *   - 0: Success, crypto adapter started successfully.
101599a2dd95SBruce Richardson  *   - <0: Error code returned by the driver function.
101699a2dd95SBruce Richardson  */
101799a2dd95SBruce Richardson typedef int (*eventdev_crypto_adapter_start_t)
101899a2dd95SBruce Richardson 					(const struct rte_eventdev *dev,
101999a2dd95SBruce Richardson 					 const struct rte_cryptodev *cdev);
102099a2dd95SBruce Richardson 
102199a2dd95SBruce Richardson /**
102299a2dd95SBruce Richardson  * Stop crypto adapter. This callback is invoked if
102399a2dd95SBruce Richardson  * the caps returned from rte_event_crypto_adapter_caps_get(.., cdev_id)
102499a2dd95SBruce Richardson  * has RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_* set and queue pairs
102599a2dd95SBruce Richardson  * from cdev_id have been added to the event device.
102699a2dd95SBruce Richardson  *
102799a2dd95SBruce Richardson  * @param dev
102899a2dd95SBruce Richardson  *   Event device pointer
102999a2dd95SBruce Richardson  *
103099a2dd95SBruce Richardson  * @param cdev
103199a2dd95SBruce Richardson  *   Crypto device pointer
103299a2dd95SBruce Richardson  *
103399a2dd95SBruce Richardson  * @return
103499a2dd95SBruce Richardson  *   - 0: Success, crypto adapter stopped successfully.
103599a2dd95SBruce Richardson  *   - <0: Error code returned by the driver function.
103699a2dd95SBruce Richardson  */
103799a2dd95SBruce Richardson typedef int (*eventdev_crypto_adapter_stop_t)
103899a2dd95SBruce Richardson 					(const struct rte_eventdev *dev,
103999a2dd95SBruce Richardson 					 const struct rte_cryptodev *cdev);
104099a2dd95SBruce Richardson 
104199a2dd95SBruce Richardson struct rte_event_crypto_adapter_stats;
104299a2dd95SBruce Richardson 
104399a2dd95SBruce Richardson /**
104499a2dd95SBruce Richardson  * Retrieve crypto adapter statistics.
104599a2dd95SBruce Richardson  *
104699a2dd95SBruce Richardson  * @param dev
104799a2dd95SBruce Richardson  *   Event device pointer
104899a2dd95SBruce Richardson  *
104999a2dd95SBruce Richardson  * @param cdev
105099a2dd95SBruce Richardson  *   Crypto device pointer
105199a2dd95SBruce Richardson  *
105299a2dd95SBruce Richardson  * @param[out] stats
105399a2dd95SBruce Richardson  *   Pointer to stats structure
105499a2dd95SBruce Richardson  *
105599a2dd95SBruce Richardson  * @return
105699a2dd95SBruce Richardson  *   Return 0 on success.
105799a2dd95SBruce Richardson  */
105899a2dd95SBruce Richardson 
105999a2dd95SBruce Richardson typedef int (*eventdev_crypto_adapter_stats_get)
106099a2dd95SBruce Richardson 			(const struct rte_eventdev *dev,
106199a2dd95SBruce Richardson 			 const struct rte_cryptodev *cdev,
106299a2dd95SBruce Richardson 			 struct rte_event_crypto_adapter_stats *stats);
106399a2dd95SBruce Richardson 
106499a2dd95SBruce Richardson /**
106599a2dd95SBruce Richardson  * Reset crypto adapter statistics.
106699a2dd95SBruce Richardson  *
106799a2dd95SBruce Richardson  * @param dev
106899a2dd95SBruce Richardson  *   Event device pointer
106999a2dd95SBruce Richardson  *
107099a2dd95SBruce Richardson  * @param cdev
107199a2dd95SBruce Richardson  *   Crypto device pointer
107299a2dd95SBruce Richardson  *
107399a2dd95SBruce Richardson  * @return
107499a2dd95SBruce Richardson  *   Return 0 on success.
107599a2dd95SBruce Richardson  */
107699a2dd95SBruce Richardson 
107799a2dd95SBruce Richardson typedef int (*eventdev_crypto_adapter_stats_reset)
107899a2dd95SBruce Richardson 			(const struct rte_eventdev *dev,
107999a2dd95SBruce Richardson 			 const struct rte_cryptodev *cdev);
108099a2dd95SBruce Richardson 
1081*c1749bc5SVolodymyr Fialko struct rte_event_crypto_adapter_vector_limits;
1082*c1749bc5SVolodymyr Fialko /**
1083*c1749bc5SVolodymyr Fialko  * Get event vector limits for a given event, crypto device pair.
1084*c1749bc5SVolodymyr Fialko  *
1085*c1749bc5SVolodymyr Fialko  * @param dev
1086*c1749bc5SVolodymyr Fialko  *   Event device pointer
1087*c1749bc5SVolodymyr Fialko  *
1088*c1749bc5SVolodymyr Fialko  * @param cdev
1089*c1749bc5SVolodymyr Fialko  *   Crypto device pointer
1090*c1749bc5SVolodymyr Fialko  *
1091*c1749bc5SVolodymyr Fialko  * @param[out] limits
1092*c1749bc5SVolodymyr Fialko  *   Pointer to the limits structure to be filled.
1093*c1749bc5SVolodymyr Fialko  *
1094*c1749bc5SVolodymyr Fialko  * @return
1095*c1749bc5SVolodymyr Fialko  *   - 0: Success.
1096*c1749bc5SVolodymyr Fialko  *   - <0: Error code returned by the driver function.
1097*c1749bc5SVolodymyr Fialko  */
1098*c1749bc5SVolodymyr Fialko typedef int (*eventdev_crypto_adapter_vector_limits_get_t)(
1099*c1749bc5SVolodymyr Fialko 	const struct rte_eventdev *dev, const struct rte_cryptodev *cdev,
1100*c1749bc5SVolodymyr Fialko 	struct rte_event_crypto_adapter_vector_limits *limits);
1101*c1749bc5SVolodymyr Fialko 
110299a2dd95SBruce Richardson /**
110399a2dd95SBruce Richardson  * Retrieve the event device's eth Tx adapter capabilities.
110499a2dd95SBruce Richardson  *
110599a2dd95SBruce Richardson  * @param dev
110699a2dd95SBruce Richardson  *   Event device pointer
110799a2dd95SBruce Richardson  *
110899a2dd95SBruce Richardson  * @param eth_dev
110999a2dd95SBruce Richardson  *   Ethernet device pointer
111099a2dd95SBruce Richardson  *
111199a2dd95SBruce Richardson  * @param[out] caps
111299a2dd95SBruce Richardson  *   A pointer to memory filled with eth Tx adapter capabilities.
111399a2dd95SBruce Richardson  *
111499a2dd95SBruce Richardson  * @return
111599a2dd95SBruce Richardson  *   - 0: Success, driver provides eth Tx adapter capabilities
111699a2dd95SBruce Richardson  *   - <0: Error code returned by the driver function.
111799a2dd95SBruce Richardson  *
111899a2dd95SBruce Richardson  */
111999a2dd95SBruce Richardson typedef int (*eventdev_eth_tx_adapter_caps_get_t)
112099a2dd95SBruce Richardson 					(const struct rte_eventdev *dev,
112199a2dd95SBruce Richardson 					const struct rte_eth_dev *eth_dev,
112299a2dd95SBruce Richardson 					uint32_t *caps);
112399a2dd95SBruce Richardson 
112499a2dd95SBruce Richardson /**
112599a2dd95SBruce Richardson  * Create adapter callback.
112699a2dd95SBruce Richardson  *
112799a2dd95SBruce Richardson  * @param id
112899a2dd95SBruce Richardson  *   Adapter identifier
112999a2dd95SBruce Richardson  *
113099a2dd95SBruce Richardson  * @param dev
113199a2dd95SBruce Richardson  *   Event device pointer
113299a2dd95SBruce Richardson  *
113399a2dd95SBruce Richardson  * @return
113499a2dd95SBruce Richardson  *   - 0: Success.
113599a2dd95SBruce Richardson  *   - <0: Error code on failure.
113699a2dd95SBruce Richardson  */
113799a2dd95SBruce Richardson typedef int (*eventdev_eth_tx_adapter_create_t)(uint8_t id,
113899a2dd95SBruce Richardson 					const struct rte_eventdev *dev);
113999a2dd95SBruce Richardson 
114099a2dd95SBruce Richardson /**
114199a2dd95SBruce Richardson  * Free adapter callback.
114299a2dd95SBruce Richardson  *
114399a2dd95SBruce Richardson  * @param id
114499a2dd95SBruce Richardson  *   Adapter identifier
114599a2dd95SBruce Richardson  *
114699a2dd95SBruce Richardson  * @param dev
114799a2dd95SBruce Richardson  *   Event device pointer
114899a2dd95SBruce Richardson  *
114999a2dd95SBruce Richardson  * @return
115099a2dd95SBruce Richardson  *   - 0: Success.
115199a2dd95SBruce Richardson  *   - <0: Error code on failure.
115299a2dd95SBruce Richardson  */
115399a2dd95SBruce Richardson typedef int (*eventdev_eth_tx_adapter_free_t)(uint8_t id,
115499a2dd95SBruce Richardson 					const struct rte_eventdev *dev);
115599a2dd95SBruce Richardson 
115699a2dd95SBruce Richardson /**
115799a2dd95SBruce Richardson  * Add a Tx queue to the adapter.
115899a2dd95SBruce Richardson  * A queue value of -1 is used to indicate all
115999a2dd95SBruce Richardson  * queues within the device.
116099a2dd95SBruce Richardson  *
116199a2dd95SBruce Richardson  * @param id
116299a2dd95SBruce Richardson  *   Adapter identifier
116399a2dd95SBruce Richardson  *
116499a2dd95SBruce Richardson  * @param dev
116599a2dd95SBruce Richardson  *   Event device pointer
116699a2dd95SBruce Richardson  *
116799a2dd95SBruce Richardson  * @param eth_dev
116899a2dd95SBruce Richardson  *   Ethernet device pointer
116999a2dd95SBruce Richardson  *
117099a2dd95SBruce Richardson  * @param tx_queue_id
117199a2dd95SBruce Richardson  *   Transmit queue index
117299a2dd95SBruce Richardson  *
117399a2dd95SBruce Richardson  * @return
117499a2dd95SBruce Richardson  *   - 0: Success.
117599a2dd95SBruce Richardson  *   - <0: Error code on failure.
117699a2dd95SBruce Richardson  */
117799a2dd95SBruce Richardson typedef int (*eventdev_eth_tx_adapter_queue_add_t)(
117899a2dd95SBruce Richardson 					uint8_t id,
117999a2dd95SBruce Richardson 					const struct rte_eventdev *dev,
118099a2dd95SBruce Richardson 					const struct rte_eth_dev *eth_dev,
118199a2dd95SBruce Richardson 					int32_t tx_queue_id);
118299a2dd95SBruce Richardson 
118399a2dd95SBruce Richardson /**
118499a2dd95SBruce Richardson  * Delete a Tx queue from the adapter.
118599a2dd95SBruce Richardson  * A queue value of -1 is used to indicate all
118699a2dd95SBruce Richardson  * queues within the device, that have been added to this
118799a2dd95SBruce Richardson  * adapter.
118899a2dd95SBruce Richardson  *
118999a2dd95SBruce Richardson  * @param id
119099a2dd95SBruce Richardson  *   Adapter identifier
119199a2dd95SBruce Richardson  *
119299a2dd95SBruce Richardson  * @param dev
119399a2dd95SBruce Richardson  *   Event device pointer
119499a2dd95SBruce Richardson  *
119599a2dd95SBruce Richardson  * @param eth_dev
119699a2dd95SBruce Richardson  *   Ethernet device pointer
119799a2dd95SBruce Richardson  *
119899a2dd95SBruce Richardson  * @param tx_queue_id
119999a2dd95SBruce Richardson  *   Transmit queue index
120099a2dd95SBruce Richardson  *
120199a2dd95SBruce Richardson  * @return
120299a2dd95SBruce Richardson  *  - 0: Success, Queues deleted successfully.
120399a2dd95SBruce Richardson  *  - <0: Error code on failure.
120499a2dd95SBruce Richardson  */
120599a2dd95SBruce Richardson typedef int (*eventdev_eth_tx_adapter_queue_del_t)(
120699a2dd95SBruce Richardson 					uint8_t id,
120799a2dd95SBruce Richardson 					const struct rte_eventdev *dev,
120899a2dd95SBruce Richardson 					const struct rte_eth_dev *eth_dev,
120999a2dd95SBruce Richardson 					int32_t tx_queue_id);
121099a2dd95SBruce Richardson 
121199a2dd95SBruce Richardson /**
121299a2dd95SBruce Richardson  * Start the adapter.
121399a2dd95SBruce Richardson  *
121499a2dd95SBruce Richardson  * @param id
121599a2dd95SBruce Richardson  *   Adapter identifier
121699a2dd95SBruce Richardson  *
121799a2dd95SBruce Richardson  * @param dev
121899a2dd95SBruce Richardson  *   Event device pointer
121999a2dd95SBruce Richardson  *
122099a2dd95SBruce Richardson  * @return
122199a2dd95SBruce Richardson  *  - 0: Success, Adapter started correctly.
122299a2dd95SBruce Richardson  *  - <0: Error code on failure.
122399a2dd95SBruce Richardson  */
122499a2dd95SBruce Richardson typedef int (*eventdev_eth_tx_adapter_start_t)(uint8_t id,
122599a2dd95SBruce Richardson 					const struct rte_eventdev *dev);
122699a2dd95SBruce Richardson 
122799a2dd95SBruce Richardson /**
122899a2dd95SBruce Richardson  * Stop the adapter.
122999a2dd95SBruce Richardson  *
123099a2dd95SBruce Richardson  * @param id
123199a2dd95SBruce Richardson  *  Adapter identifier
123299a2dd95SBruce Richardson  *
123399a2dd95SBruce Richardson  * @param dev
123499a2dd95SBruce Richardson  *   Event device pointer
123599a2dd95SBruce Richardson  *
123699a2dd95SBruce Richardson  * @return
123799a2dd95SBruce Richardson  *  - 0: Success.
123899a2dd95SBruce Richardson  *  - <0: Error code on failure.
123999a2dd95SBruce Richardson  */
124099a2dd95SBruce Richardson typedef int (*eventdev_eth_tx_adapter_stop_t)(uint8_t id,
124199a2dd95SBruce Richardson 					const struct rte_eventdev *dev);
124299a2dd95SBruce Richardson 
124399a2dd95SBruce Richardson struct rte_event_eth_tx_adapter_stats;
124499a2dd95SBruce Richardson 
124599a2dd95SBruce Richardson /**
124699a2dd95SBruce Richardson  * Retrieve statistics for an adapter
124799a2dd95SBruce Richardson  *
124899a2dd95SBruce Richardson  * @param id
124999a2dd95SBruce Richardson  *  Adapter identifier
125099a2dd95SBruce Richardson  *
125199a2dd95SBruce Richardson  * @param dev
125299a2dd95SBruce Richardson  *   Event device pointer
125399a2dd95SBruce Richardson  *
125499a2dd95SBruce Richardson  * @param [out] stats
125599a2dd95SBruce Richardson  *  A pointer to structure used to retrieve statistics for an adapter
125699a2dd95SBruce Richardson  *
125799a2dd95SBruce Richardson  * @return
125899a2dd95SBruce Richardson  *  - 0: Success, statistics retrieved successfully.
125999a2dd95SBruce Richardson  *  - <0: Error code on failure.
126099a2dd95SBruce Richardson  */
126199a2dd95SBruce Richardson typedef int (*eventdev_eth_tx_adapter_stats_get_t)(
126299a2dd95SBruce Richardson 				uint8_t id,
126399a2dd95SBruce Richardson 				const struct rte_eventdev *dev,
126499a2dd95SBruce Richardson 				struct rte_event_eth_tx_adapter_stats *stats);
126599a2dd95SBruce Richardson 
126699a2dd95SBruce Richardson /**
126799a2dd95SBruce Richardson  * Reset statistics for an adapter
126899a2dd95SBruce Richardson  *
126999a2dd95SBruce Richardson  * @param id
127099a2dd95SBruce Richardson  *  Adapter identifier
127199a2dd95SBruce Richardson  *
127299a2dd95SBruce Richardson  * @param dev
127399a2dd95SBruce Richardson  *   Event device pointer
127499a2dd95SBruce Richardson  *
127599a2dd95SBruce Richardson  * @return
127699a2dd95SBruce Richardson  *  - 0: Success, statistics retrieved successfully.
127799a2dd95SBruce Richardson  *  - <0: Error code on failure.
127899a2dd95SBruce Richardson  */
127999a2dd95SBruce Richardson typedef int (*eventdev_eth_tx_adapter_stats_reset_t)(uint8_t id,
128099a2dd95SBruce Richardson 					const struct rte_eventdev *dev);
128199a2dd95SBruce Richardson 
1282b2963cbdSGanapati Kundapura /**
1283b2963cbdSGanapati Kundapura  * Get TX adapter instance ID for Tx queue
1284b2963cbdSGanapati Kundapura  *
1285b2963cbdSGanapati Kundapura  * @param eth_dev_id
1286b2963cbdSGanapati Kundapura  *  Port identifier of Ethernet device
1287b2963cbdSGanapati Kundapura  *
1288b2963cbdSGanapati Kundapura  * @param tx_queue_id
1289b2963cbdSGanapati Kundapura  *  Ethernet device Tx queue index
1290b2963cbdSGanapati Kundapura  *
1291b2963cbdSGanapati Kundapura  * @param[out] txa_inst_id
1292b2963cbdSGanapati Kundapura  *  Pointer to Tx adapter instance identifier
1293b2963cbdSGanapati Kundapura  *  Contains valid Tx adapter instance ID when return value is 0
1294b2963cbdSGanapati Kundapura  *
1295b2963cbdSGanapati Kundapura  * @return
1296b2963cbdSGanapati Kundapura  *  -  0: Success
1297b2963cbdSGanapati Kundapura  *  - <0: Error code on failure
1298b2963cbdSGanapati Kundapura  */
1299b2963cbdSGanapati Kundapura typedef int (*eventdev_eth_tx_adapter_instance_get_t)
1300b2963cbdSGanapati Kundapura 	(uint16_t eth_dev_id, uint16_t tx_queue_id, uint8_t *txa_inst_id);
1301b2963cbdSGanapati Kundapura 
13023c3328aeSNaga Harish K S V /**
13033c3328aeSNaga Harish K S V  * Start a Tx queue that is assigned to Tx adapter instance
13043c3328aeSNaga Harish K S V  *
13053c3328aeSNaga Harish K S V  * @param id
13063c3328aeSNaga Harish K S V  *  Adapter identifier
13073c3328aeSNaga Harish K S V  *
13083c3328aeSNaga Harish K S V  * @param eth_dev_id
13093c3328aeSNaga Harish K S V  *  Port identifier of Ethernet device
13103c3328aeSNaga Harish K S V  *
13113c3328aeSNaga Harish K S V  * @param tx_queue_id
13123c3328aeSNaga Harish K S V  *  Ethernet device Tx queue index
13133c3328aeSNaga Harish K S V  *
13143c3328aeSNaga Harish K S V  * @return
13153c3328aeSNaga Harish K S V  *  -  0: Success
13163c3328aeSNaga Harish K S V  *  - <0: Error code on failure
13173c3328aeSNaga Harish K S V  */
13183c3328aeSNaga Harish K S V typedef int (*eventdev_eth_tx_adapter_queue_start)
13193c3328aeSNaga Harish K S V 	(uint8_t id, uint16_t eth_dev_id, uint16_t tx_queue_id);
13203c3328aeSNaga Harish K S V 
13213c3328aeSNaga Harish K S V /**
13223c3328aeSNaga Harish K S V  * Stop a Tx queue that is assigned to Tx adapter instance
13233c3328aeSNaga Harish K S V  *
13243c3328aeSNaga Harish K S V  * @param id
13253c3328aeSNaga Harish K S V  *  Adapter identifier
13263c3328aeSNaga Harish K S V  *
13273c3328aeSNaga Harish K S V  * @param eth_dev_id
13283c3328aeSNaga Harish K S V  *  Port identifier of Ethernet device
13293c3328aeSNaga Harish K S V  *
13303c3328aeSNaga Harish K S V  * @param tx_queue_id
13313c3328aeSNaga Harish K S V  *  Ethernet device Tx queue index
13323c3328aeSNaga Harish K S V  *
13333c3328aeSNaga Harish K S V  * @return
13343c3328aeSNaga Harish K S V  *  -  0: Success
13353c3328aeSNaga Harish K S V  *  - <0: Error code on failure
13363c3328aeSNaga Harish K S V  */
13373c3328aeSNaga Harish K S V typedef int (*eventdev_eth_tx_adapter_queue_stop)
13383c3328aeSNaga Harish K S V 	(uint8_t id, uint16_t eth_dev_id, uint16_t tx_queue_id);
1339b2963cbdSGanapati Kundapura 
1340d986276fSPavan Nikhilesh #define eventdev_stop_flush_t rte_eventdev_stop_flush_t
1341d986276fSPavan Nikhilesh 
134299a2dd95SBruce Richardson /** Event device operations function pointer table */
134323d06e37SPavan Nikhilesh struct eventdev_ops {
134499a2dd95SBruce Richardson 	eventdev_info_get_t dev_infos_get;	/**< Get device info. */
134599a2dd95SBruce Richardson 	eventdev_configure_t dev_configure;	/**< Configure device. */
134699a2dd95SBruce Richardson 	eventdev_start_t dev_start;		/**< Start device. */
134799a2dd95SBruce Richardson 	eventdev_stop_t dev_stop;		/**< Stop device. */
134899a2dd95SBruce Richardson 	eventdev_close_t dev_close;		/**< Close device. */
134999a2dd95SBruce Richardson 
135099a2dd95SBruce Richardson 	eventdev_queue_default_conf_get_t queue_def_conf;
135199a2dd95SBruce Richardson 	/**< Get default queue configuration. */
135299a2dd95SBruce Richardson 	eventdev_queue_setup_t queue_setup;
135399a2dd95SBruce Richardson 	/**< Set up an event queue. */
135499a2dd95SBruce Richardson 	eventdev_queue_release_t queue_release;
135599a2dd95SBruce Richardson 	/**< Release an event queue. */
135697b914f4SShijith Thotton 	eventdev_queue_attr_set_t queue_attr_set;
135797b914f4SShijith Thotton 	/**< Set an event queue attribute. */
135899a2dd95SBruce Richardson 
135999a2dd95SBruce Richardson 	eventdev_port_default_conf_get_t port_def_conf;
136099a2dd95SBruce Richardson 	/**< Get default port configuration. */
136199a2dd95SBruce Richardson 	eventdev_port_setup_t port_setup;
136299a2dd95SBruce Richardson 	/**< Set up an event port. */
136399a2dd95SBruce Richardson 	eventdev_port_release_t port_release;
136499a2dd95SBruce Richardson 	/**< Release an event port. */
13651ff23ce6SPavan Nikhilesh 	eventdev_port_quiesce_t port_quiesce;
13661ff23ce6SPavan Nikhilesh 	/**< Quiesce an event port. */
136799a2dd95SBruce Richardson 
136899a2dd95SBruce Richardson 	eventdev_port_link_t port_link;
136999a2dd95SBruce Richardson 	/**< Link event queues to an event port. */
137099a2dd95SBruce Richardson 	eventdev_port_unlink_t port_unlink;
137199a2dd95SBruce Richardson 	/**< Unlink event queues from an event port. */
137299a2dd95SBruce Richardson 	eventdev_port_unlinks_in_progress_t port_unlinks_in_progress;
137399a2dd95SBruce Richardson 	/**< Unlinks in progress on an event port. */
137499a2dd95SBruce Richardson 	eventdev_dequeue_timeout_ticks_t timeout_ticks;
137599a2dd95SBruce Richardson 	/**< Converts ns to *timeout_ticks* value for rte_event_dequeue() */
137699a2dd95SBruce Richardson 	eventdev_dump_t dump;
137799a2dd95SBruce Richardson 	/* Dump internal information */
137899a2dd95SBruce Richardson 
137999a2dd95SBruce Richardson 	eventdev_xstats_get_t xstats_get;
138099a2dd95SBruce Richardson 	/**< Get extended device statistics. */
138199a2dd95SBruce Richardson 	eventdev_xstats_get_names_t xstats_get_names;
138299a2dd95SBruce Richardson 	/**< Get names of extended stats. */
138399a2dd95SBruce Richardson 	eventdev_xstats_get_by_name xstats_get_by_name;
138499a2dd95SBruce Richardson 	/**< Get one value by name. */
138599a2dd95SBruce Richardson 	eventdev_xstats_reset_t xstats_reset;
138699a2dd95SBruce Richardson 	/**< Reset the statistics values in xstats. */
138799a2dd95SBruce Richardson 
138899a2dd95SBruce Richardson 	eventdev_eth_rx_adapter_caps_get_t eth_rx_adapter_caps_get;
138999a2dd95SBruce Richardson 	/**< Get ethernet Rx adapter capabilities */
139099a2dd95SBruce Richardson 	eventdev_eth_rx_adapter_queue_add_t eth_rx_adapter_queue_add;
139199a2dd95SBruce Richardson 	/**< Add Rx queues to ethernet Rx adapter */
139299a2dd95SBruce Richardson 	eventdev_eth_rx_adapter_queue_del_t eth_rx_adapter_queue_del;
139399a2dd95SBruce Richardson 	/**< Delete Rx queues from ethernet Rx adapter */
1394da781e64SGanapati Kundapura 	eventdev_eth_rx_adapter_queue_conf_get_t eth_rx_adapter_queue_conf_get;
1395da781e64SGanapati Kundapura 	/**< Get Rx adapter queue info */
139699a2dd95SBruce Richardson 	eventdev_eth_rx_adapter_start_t eth_rx_adapter_start;
139799a2dd95SBruce Richardson 	/**< Start ethernet Rx adapter */
139899a2dd95SBruce Richardson 	eventdev_eth_rx_adapter_stop_t eth_rx_adapter_stop;
139999a2dd95SBruce Richardson 	/**< Stop ethernet Rx adapter */
140099a2dd95SBruce Richardson 	eventdev_eth_rx_adapter_stats_get eth_rx_adapter_stats_get;
140199a2dd95SBruce Richardson 	/**< Get ethernet Rx stats */
140299a2dd95SBruce Richardson 	eventdev_eth_rx_adapter_stats_reset eth_rx_adapter_stats_reset;
140399a2dd95SBruce Richardson 	/**< Reset ethernet Rx stats */
140499a2dd95SBruce Richardson 	eventdev_eth_rx_adapter_vector_limits_get_t
140599a2dd95SBruce Richardson 		eth_rx_adapter_vector_limits_get;
140699a2dd95SBruce Richardson 	/**< Get event vector limits for the Rx adapter */
1407a1793ee8SGanapati Kundapura 	eventdev_eth_rx_adapter_instance_get_t eth_rx_adapter_instance_get;
1408a1793ee8SGanapati Kundapura 	/**< Get Rx adapter instance ID for Rx queue */
140999a2dd95SBruce Richardson 
141099a2dd95SBruce Richardson 	eventdev_timer_adapter_caps_get_t timer_adapter_caps_get;
141199a2dd95SBruce Richardson 	/**< Get timer adapter capabilities */
141299a2dd95SBruce Richardson 
141399a2dd95SBruce Richardson 	eventdev_crypto_adapter_caps_get_t crypto_adapter_caps_get;
141499a2dd95SBruce Richardson 	/**< Get crypto adapter capabilities */
141599a2dd95SBruce Richardson 	eventdev_crypto_adapter_queue_pair_add_t crypto_adapter_queue_pair_add;
141699a2dd95SBruce Richardson 	/**< Add queue pair to crypto adapter */
141799a2dd95SBruce Richardson 	eventdev_crypto_adapter_queue_pair_del_t crypto_adapter_queue_pair_del;
141899a2dd95SBruce Richardson 	/**< Delete queue pair from crypto adapter */
141999a2dd95SBruce Richardson 	eventdev_crypto_adapter_start_t crypto_adapter_start;
142099a2dd95SBruce Richardson 	/**< Start crypto adapter */
142199a2dd95SBruce Richardson 	eventdev_crypto_adapter_stop_t crypto_adapter_stop;
142299a2dd95SBruce Richardson 	/**< Stop crypto adapter */
142399a2dd95SBruce Richardson 	eventdev_crypto_adapter_stats_get crypto_adapter_stats_get;
142499a2dd95SBruce Richardson 	/**< Get crypto stats */
142599a2dd95SBruce Richardson 	eventdev_crypto_adapter_stats_reset crypto_adapter_stats_reset;
142699a2dd95SBruce Richardson 	/**< Reset crypto stats */
1427*c1749bc5SVolodymyr Fialko 	eventdev_crypto_adapter_vector_limits_get_t
1428*c1749bc5SVolodymyr Fialko 		crypto_adapter_vector_limits_get;
1429*c1749bc5SVolodymyr Fialko 	/**< Get event vector limits for the crypto adapter */
143099a2dd95SBruce Richardson 
1431995b150cSNaga Harish K S V 	eventdev_eth_rx_adapter_q_stats_get eth_rx_adapter_queue_stats_get;
1432995b150cSNaga Harish K S V 	/**< Get ethernet Rx queue stats */
1433995b150cSNaga Harish K S V 	eventdev_eth_rx_adapter_q_stats_reset eth_rx_adapter_queue_stats_reset;
1434995b150cSNaga Harish K S V 	/**< Reset ethernet Rx queue stats */
1435995b150cSNaga Harish K S V 
143699a2dd95SBruce Richardson 	eventdev_eth_tx_adapter_caps_get_t eth_tx_adapter_caps_get;
143799a2dd95SBruce Richardson 	/**< Get ethernet Tx adapter capabilities */
143899a2dd95SBruce Richardson 
143999a2dd95SBruce Richardson 	eventdev_eth_tx_adapter_create_t eth_tx_adapter_create;
144099a2dd95SBruce Richardson 	/**< Create adapter callback */
144199a2dd95SBruce Richardson 	eventdev_eth_tx_adapter_free_t eth_tx_adapter_free;
144299a2dd95SBruce Richardson 	/**< Free adapter callback */
144399a2dd95SBruce Richardson 	eventdev_eth_tx_adapter_queue_add_t eth_tx_adapter_queue_add;
144499a2dd95SBruce Richardson 	/**< Add Tx queues to the eth Tx adapter */
144599a2dd95SBruce Richardson 	eventdev_eth_tx_adapter_queue_del_t eth_tx_adapter_queue_del;
144699a2dd95SBruce Richardson 	/**< Delete Tx queues from the eth Tx adapter */
144799a2dd95SBruce Richardson 	eventdev_eth_tx_adapter_start_t eth_tx_adapter_start;
144899a2dd95SBruce Richardson 	/**< Start eth Tx adapter */
144999a2dd95SBruce Richardson 	eventdev_eth_tx_adapter_stop_t eth_tx_adapter_stop;
145099a2dd95SBruce Richardson 	/**< Stop eth Tx adapter */
145199a2dd95SBruce Richardson 	eventdev_eth_tx_adapter_stats_get_t eth_tx_adapter_stats_get;
145299a2dd95SBruce Richardson 	/**< Get eth Tx adapter statistics */
145399a2dd95SBruce Richardson 	eventdev_eth_tx_adapter_stats_reset_t eth_tx_adapter_stats_reset;
145499a2dd95SBruce Richardson 	/**< Reset eth Tx adapter statistics */
1455b2963cbdSGanapati Kundapura 	eventdev_eth_tx_adapter_instance_get_t eth_tx_adapter_instance_get;
1456b2963cbdSGanapati Kundapura 	/**< Get Tx adapter instance ID for Tx queue */
14573c3328aeSNaga Harish K S V 	eventdev_eth_tx_adapter_queue_start eth_tx_adapter_queue_start;
14583c3328aeSNaga Harish K S V 	/**< Start Tx queue assigned to Tx adapter instance */
14593c3328aeSNaga Harish K S V 	eventdev_eth_tx_adapter_queue_stop eth_tx_adapter_queue_stop;
14603c3328aeSNaga Harish K S V 	/**< Stop Tx queue assigned to Tx adapter instance */
146199a2dd95SBruce Richardson 
146299a2dd95SBruce Richardson 	eventdev_selftest dev_selftest;
146399a2dd95SBruce Richardson 	/**< Start eventdev Selftest */
146499a2dd95SBruce Richardson 
146599a2dd95SBruce Richardson 	eventdev_stop_flush_t dev_stop_flush;
146699a2dd95SBruce Richardson 	/**< User-provided event flush function */
146799a2dd95SBruce Richardson };
146899a2dd95SBruce Richardson 
146999a2dd95SBruce Richardson /**
147099a2dd95SBruce Richardson  * Allocates a new eventdev slot for an event device and returns the pointer
147199a2dd95SBruce Richardson  * to that slot for the driver to use.
147299a2dd95SBruce Richardson  *
147399a2dd95SBruce Richardson  * @param name
147499a2dd95SBruce Richardson  *   Unique identifier name for each device
147599a2dd95SBruce Richardson  * @param socket_id
147699a2dd95SBruce Richardson  *   Socket to allocate resources on.
147799a2dd95SBruce Richardson  * @return
147899a2dd95SBruce Richardson  *   - Slot in the rte_dev_devices array for a new device;
147999a2dd95SBruce Richardson  */
148023d06e37SPavan Nikhilesh __rte_internal
148199a2dd95SBruce Richardson struct rte_eventdev *
148299a2dd95SBruce Richardson rte_event_pmd_allocate(const char *name, int socket_id);
148399a2dd95SBruce Richardson 
148499a2dd95SBruce Richardson /**
148599a2dd95SBruce Richardson  * Release the specified eventdev device.
148699a2dd95SBruce Richardson  *
148799a2dd95SBruce Richardson  * @param eventdev
148899a2dd95SBruce Richardson  * The *eventdev* pointer is the address of the *rte_eventdev* structure.
148999a2dd95SBruce Richardson  * @return
149099a2dd95SBruce Richardson  *   - 0 on success, negative on error
149199a2dd95SBruce Richardson  */
149223d06e37SPavan Nikhilesh __rte_internal
149399a2dd95SBruce Richardson int
149499a2dd95SBruce Richardson rte_event_pmd_release(struct rte_eventdev *eventdev);
149599a2dd95SBruce Richardson 
1496d35e6132SPavan Nikhilesh /**
1497d35e6132SPavan Nikhilesh  *
1498d35e6132SPavan Nikhilesh  * @internal
1499d35e6132SPavan Nikhilesh  * This is the last step of device probing.
1500d35e6132SPavan Nikhilesh  * It must be called after a port is allocated and initialized successfully.
1501d35e6132SPavan Nikhilesh  *
1502d35e6132SPavan Nikhilesh  * @param eventdev
1503d35e6132SPavan Nikhilesh  *  New event device.
1504d35e6132SPavan Nikhilesh  */
1505d35e6132SPavan Nikhilesh __rte_internal
1506d35e6132SPavan Nikhilesh void
1507d35e6132SPavan Nikhilesh event_dev_probing_finish(struct rte_eventdev *eventdev);
1508d35e6132SPavan Nikhilesh 
1509d35e6132SPavan Nikhilesh /**
1510d35e6132SPavan Nikhilesh  * Reset eventdevice fastpath APIs to dummy values.
1511d35e6132SPavan Nikhilesh  *
1512d35e6132SPavan Nikhilesh  * @param fp_ops
1513d35e6132SPavan Nikhilesh  * The *fp_ops* pointer to reset.
1514d35e6132SPavan Nikhilesh  */
1515d35e6132SPavan Nikhilesh __rte_internal
1516d35e6132SPavan Nikhilesh void
1517d35e6132SPavan Nikhilesh event_dev_fp_ops_reset(struct rte_event_fp_ops *fp_op);
1518d35e6132SPavan Nikhilesh 
1519d35e6132SPavan Nikhilesh /**
1520d35e6132SPavan Nikhilesh  * Set eventdevice fastpath APIs to event device values.
1521d35e6132SPavan Nikhilesh  *
1522d35e6132SPavan Nikhilesh  * @param fp_ops
1523d35e6132SPavan Nikhilesh  * The *fp_ops* pointer to set.
1524d35e6132SPavan Nikhilesh  */
1525d35e6132SPavan Nikhilesh __rte_internal
1526d35e6132SPavan Nikhilesh void
1527d35e6132SPavan Nikhilesh event_dev_fp_ops_set(struct rte_event_fp_ops *fp_ops,
1528d35e6132SPavan Nikhilesh 		     const struct rte_eventdev *dev);
1529d35e6132SPavan Nikhilesh 
15302c552933SBrian Dooley #ifdef __cplusplus
15312c552933SBrian Dooley }
15322c552933SBrian Dooley #endif
15332c552933SBrian Dooley 
153499a2dd95SBruce Richardson #endif /* _RTE_EVENTDEV_PMD_H_ */
1535