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 899a2dd95SBruce Richardson /** @file 999a2dd95SBruce Richardson * RTE Event PMD APIs 1099a2dd95SBruce Richardson * 1199a2dd95SBruce Richardson * @note 1299a2dd95SBruce Richardson * These API are from event PMD only and user applications should not call 1399a2dd95SBruce Richardson * them directly. 1499a2dd95SBruce Richardson */ 1599a2dd95SBruce Richardson 1699a2dd95SBruce Richardson #include <string.h> 1799a2dd95SBruce Richardson 1899a2dd95SBruce Richardson #include <rte_common.h> 1999a2dd95SBruce Richardson #include <rte_compat.h> 2099a2dd95SBruce Richardson #include <rte_config.h> 2199a2dd95SBruce Richardson #include <rte_dev.h> 2299a2dd95SBruce Richardson #include <rte_log.h> 2399a2dd95SBruce Richardson #include <rte_malloc.h> 2499a2dd95SBruce Richardson #include <rte_mbuf.h> 2599a2dd95SBruce Richardson #include <rte_mbuf_dyn.h> 2699a2dd95SBruce Richardson 2799a2dd95SBruce Richardson #include "rte_eventdev.h" 2899a2dd95SBruce Richardson #include "rte_event_timer_adapter_pmd.h" 2999a2dd95SBruce Richardson 3099a2dd95SBruce Richardson /* Logging Macros */ 3199a2dd95SBruce Richardson #define RTE_EDEV_LOG_ERR(...) \ 3299a2dd95SBruce Richardson RTE_LOG(ERR, EVENTDEV, \ 3399a2dd95SBruce Richardson RTE_FMT("%s() line %u: " RTE_FMT_HEAD(__VA_ARGS__,) "\n", \ 3499a2dd95SBruce Richardson __func__, __LINE__, RTE_FMT_TAIL(__VA_ARGS__,))) 3599a2dd95SBruce Richardson 3699a2dd95SBruce Richardson #ifdef RTE_LIBRTE_EVENTDEV_DEBUG 3799a2dd95SBruce Richardson #define RTE_EDEV_LOG_DEBUG(...) \ 3899a2dd95SBruce Richardson RTE_LOG(DEBUG, EVENTDEV, \ 3999a2dd95SBruce Richardson RTE_FMT("%s() line %u: " RTE_FMT_HEAD(__VA_ARGS__,) "\n", \ 4099a2dd95SBruce Richardson __func__, __LINE__, RTE_FMT_TAIL(__VA_ARGS__,))) 4199a2dd95SBruce Richardson #else 4299a2dd95SBruce Richardson #define RTE_EDEV_LOG_DEBUG(...) (void)0 4399a2dd95SBruce Richardson #endif 4499a2dd95SBruce Richardson 4599a2dd95SBruce Richardson /* Macros to check for valid device */ 4699a2dd95SBruce Richardson #define RTE_EVENTDEV_VALID_DEVID_OR_ERR_RET(dev_id, retval) do { \ 4799a2dd95SBruce Richardson if (!rte_event_pmd_is_valid_dev((dev_id))) { \ 4899a2dd95SBruce Richardson RTE_EDEV_LOG_ERR("Invalid dev_id=%d\n", dev_id); \ 4999a2dd95SBruce Richardson return retval; \ 5099a2dd95SBruce Richardson } \ 5199a2dd95SBruce Richardson } while (0) 5299a2dd95SBruce Richardson 5399a2dd95SBruce Richardson #define RTE_EVENTDEV_VALID_DEVID_OR_ERRNO_RET(dev_id, errno, retval) do { \ 5499a2dd95SBruce Richardson if (!rte_event_pmd_is_valid_dev((dev_id))) { \ 5599a2dd95SBruce Richardson RTE_EDEV_LOG_ERR("Invalid dev_id=%d\n", dev_id); \ 5699a2dd95SBruce Richardson rte_errno = errno; \ 5799a2dd95SBruce Richardson return retval; \ 5899a2dd95SBruce Richardson } \ 5999a2dd95SBruce Richardson } while (0) 6099a2dd95SBruce Richardson 6199a2dd95SBruce Richardson #define RTE_EVENTDEV_VALID_DEVID_OR_RET(dev_id) do { \ 6299a2dd95SBruce Richardson if (!rte_event_pmd_is_valid_dev((dev_id))) { \ 6399a2dd95SBruce Richardson RTE_EDEV_LOG_ERR("Invalid dev_id=%d\n", dev_id); \ 6499a2dd95SBruce Richardson return; \ 6599a2dd95SBruce Richardson } \ 6699a2dd95SBruce Richardson } while (0) 6799a2dd95SBruce Richardson 6899a2dd95SBruce Richardson #define RTE_EVENT_ETH_RX_ADAPTER_SW_CAP \ 6999a2dd95SBruce Richardson ((RTE_EVENT_ETH_RX_ADAPTER_CAP_OVERRIDE_FLOW_ID) | \ 7099a2dd95SBruce Richardson (RTE_EVENT_ETH_RX_ADAPTER_CAP_MULTI_EVENTQ) | \ 7199a2dd95SBruce Richardson (RTE_EVENT_ETH_RX_ADAPTER_CAP_EVENT_VECTOR)) 7299a2dd95SBruce Richardson 7399a2dd95SBruce Richardson #define RTE_EVENT_CRYPTO_ADAPTER_SW_CAP \ 7499a2dd95SBruce Richardson RTE_EVENT_CRYPTO_ADAPTER_CAP_SESSION_PRIVATE_DATA 7599a2dd95SBruce Richardson 7699a2dd95SBruce Richardson /**< Ethernet Rx adapter cap to return If the packet transfers from 7799a2dd95SBruce Richardson * the ethdev to eventdev use a SW service function 7899a2dd95SBruce Richardson */ 7999a2dd95SBruce Richardson 8099a2dd95SBruce Richardson #define RTE_EVENTDEV_DETACHED (0) 8199a2dd95SBruce Richardson #define RTE_EVENTDEV_ATTACHED (1) 8299a2dd95SBruce Richardson 8399a2dd95SBruce Richardson struct rte_eth_dev; 8499a2dd95SBruce Richardson 8599a2dd95SBruce Richardson /** Global structure used for maintaining state of allocated event devices */ 8699a2dd95SBruce Richardson struct rte_eventdev_global { 8799a2dd95SBruce Richardson uint8_t nb_devs; /**< Number of devices found */ 8899a2dd95SBruce Richardson }; 8999a2dd95SBruce Richardson 9099a2dd95SBruce Richardson /** 9199a2dd95SBruce Richardson * Get the rte_eventdev structure device pointer for the named device. 9299a2dd95SBruce Richardson * 9399a2dd95SBruce Richardson * @param name 9499a2dd95SBruce Richardson * device name to select the device structure. 9599a2dd95SBruce Richardson * 9699a2dd95SBruce Richardson * @return 9799a2dd95SBruce Richardson * - The rte_eventdev structure pointer for the given device ID. 9899a2dd95SBruce Richardson */ 9923d06e37SPavan Nikhilesh __rte_internal 10099a2dd95SBruce Richardson static inline struct rte_eventdev * 10199a2dd95SBruce Richardson rte_event_pmd_get_named_dev(const char *name) 10299a2dd95SBruce Richardson { 10399a2dd95SBruce Richardson struct rte_eventdev *dev; 10499a2dd95SBruce Richardson unsigned int i; 10599a2dd95SBruce Richardson 10699a2dd95SBruce Richardson if (name == NULL) 10799a2dd95SBruce Richardson return NULL; 10899a2dd95SBruce Richardson 10999a2dd95SBruce Richardson for (i = 0; i < RTE_EVENT_MAX_DEVS; i++) { 11099a2dd95SBruce Richardson dev = &rte_eventdevs[i]; 11199a2dd95SBruce Richardson if ((dev->attached == RTE_EVENTDEV_ATTACHED) && 11299a2dd95SBruce Richardson (strcmp(dev->data->name, name) == 0)) 11399a2dd95SBruce Richardson return dev; 11499a2dd95SBruce Richardson } 11599a2dd95SBruce Richardson 11699a2dd95SBruce Richardson return NULL; 11799a2dd95SBruce Richardson } 11899a2dd95SBruce Richardson 11999a2dd95SBruce Richardson /** 12099a2dd95SBruce Richardson * Validate if the event device index is valid attached event device. 12199a2dd95SBruce Richardson * 12299a2dd95SBruce Richardson * @param dev_id 12399a2dd95SBruce Richardson * Event device index. 12499a2dd95SBruce Richardson * 12599a2dd95SBruce Richardson * @return 12699a2dd95SBruce Richardson * - If the device index is valid (1) or not (0). 12799a2dd95SBruce Richardson */ 12823d06e37SPavan Nikhilesh __rte_internal 12999a2dd95SBruce Richardson static inline unsigned 13099a2dd95SBruce Richardson rte_event_pmd_is_valid_dev(uint8_t dev_id) 13199a2dd95SBruce Richardson { 13299a2dd95SBruce Richardson struct rte_eventdev *dev; 13399a2dd95SBruce Richardson 13499a2dd95SBruce Richardson if (dev_id >= RTE_EVENT_MAX_DEVS) 13599a2dd95SBruce Richardson return 0; 13699a2dd95SBruce Richardson 13799a2dd95SBruce Richardson dev = &rte_eventdevs[dev_id]; 13899a2dd95SBruce Richardson if (dev->attached != RTE_EVENTDEV_ATTACHED) 13999a2dd95SBruce Richardson return 0; 14099a2dd95SBruce Richardson else 14199a2dd95SBruce Richardson return 1; 14299a2dd95SBruce Richardson } 14399a2dd95SBruce Richardson 14499a2dd95SBruce Richardson /** 14599a2dd95SBruce Richardson * Definitions of all functions exported by a driver through the 14699a2dd95SBruce Richardson * the generic structure of type *event_dev_ops* supplied in the 14799a2dd95SBruce Richardson * *rte_eventdev* structure associated with a device. 14899a2dd95SBruce Richardson */ 14999a2dd95SBruce Richardson 15099a2dd95SBruce Richardson /** 15199a2dd95SBruce Richardson * Get device information of a device. 15299a2dd95SBruce Richardson * 15399a2dd95SBruce Richardson * @param dev 15499a2dd95SBruce Richardson * Event device pointer 15599a2dd95SBruce Richardson * @param dev_info 15699a2dd95SBruce Richardson * Event device information structure 15799a2dd95SBruce Richardson */ 15899a2dd95SBruce Richardson typedef void (*eventdev_info_get_t)(struct rte_eventdev *dev, 15999a2dd95SBruce Richardson struct rte_event_dev_info *dev_info); 16099a2dd95SBruce Richardson 16199a2dd95SBruce Richardson /** 16299a2dd95SBruce Richardson * Configure a device. 16399a2dd95SBruce Richardson * 16499a2dd95SBruce Richardson * @param dev 16599a2dd95SBruce Richardson * Event device pointer 16699a2dd95SBruce Richardson * 16799a2dd95SBruce Richardson * @return 16899a2dd95SBruce Richardson * Returns 0 on success 16999a2dd95SBruce Richardson */ 17099a2dd95SBruce Richardson typedef int (*eventdev_configure_t)(const struct rte_eventdev *dev); 17199a2dd95SBruce Richardson 17299a2dd95SBruce Richardson /** 17399a2dd95SBruce Richardson * Start a configured device. 17499a2dd95SBruce Richardson * 17599a2dd95SBruce Richardson * @param dev 17699a2dd95SBruce Richardson * Event device pointer 17799a2dd95SBruce Richardson * 17899a2dd95SBruce Richardson * @return 17999a2dd95SBruce Richardson * Returns 0 on success 18099a2dd95SBruce Richardson */ 18199a2dd95SBruce Richardson typedef int (*eventdev_start_t)(struct rte_eventdev *dev); 18299a2dd95SBruce Richardson 18399a2dd95SBruce Richardson /** 18499a2dd95SBruce Richardson * Stop a configured device. 18599a2dd95SBruce Richardson * 18699a2dd95SBruce Richardson * @param dev 18799a2dd95SBruce Richardson * Event device pointer 18899a2dd95SBruce Richardson */ 18999a2dd95SBruce Richardson typedef void (*eventdev_stop_t)(struct rte_eventdev *dev); 19099a2dd95SBruce Richardson 19199a2dd95SBruce Richardson /** 19299a2dd95SBruce Richardson * Close a configured device. 19399a2dd95SBruce Richardson * 19499a2dd95SBruce Richardson * @param dev 19599a2dd95SBruce Richardson * Event device pointer 19699a2dd95SBruce Richardson * 19799a2dd95SBruce Richardson * @return 19899a2dd95SBruce Richardson * - 0 on success 19999a2dd95SBruce Richardson * - (-EAGAIN) if can't close as device is busy 20099a2dd95SBruce Richardson */ 20199a2dd95SBruce Richardson typedef int (*eventdev_close_t)(struct rte_eventdev *dev); 20299a2dd95SBruce Richardson 20399a2dd95SBruce Richardson /** 20499a2dd95SBruce Richardson * Retrieve the default event queue configuration. 20599a2dd95SBruce Richardson * 20699a2dd95SBruce Richardson * @param dev 20799a2dd95SBruce Richardson * Event device pointer 20899a2dd95SBruce Richardson * @param queue_id 20999a2dd95SBruce Richardson * Event queue index 21099a2dd95SBruce Richardson * @param[out] queue_conf 21199a2dd95SBruce Richardson * Event queue configuration structure 21299a2dd95SBruce Richardson * 21399a2dd95SBruce Richardson */ 21499a2dd95SBruce Richardson typedef void (*eventdev_queue_default_conf_get_t)(struct rte_eventdev *dev, 21599a2dd95SBruce Richardson uint8_t queue_id, struct rte_event_queue_conf *queue_conf); 21699a2dd95SBruce Richardson 21799a2dd95SBruce Richardson /** 21899a2dd95SBruce Richardson * Setup an event queue. 21999a2dd95SBruce Richardson * 22099a2dd95SBruce Richardson * @param dev 22199a2dd95SBruce Richardson * Event device pointer 22299a2dd95SBruce Richardson * @param queue_id 22399a2dd95SBruce Richardson * Event queue index 22499a2dd95SBruce Richardson * @param queue_conf 22599a2dd95SBruce Richardson * Event queue configuration structure 22699a2dd95SBruce Richardson * 22799a2dd95SBruce Richardson * @return 22899a2dd95SBruce Richardson * Returns 0 on success. 22999a2dd95SBruce Richardson */ 23099a2dd95SBruce Richardson typedef int (*eventdev_queue_setup_t)(struct rte_eventdev *dev, 23199a2dd95SBruce Richardson uint8_t queue_id, 23299a2dd95SBruce Richardson const struct rte_event_queue_conf *queue_conf); 23399a2dd95SBruce Richardson 23499a2dd95SBruce Richardson /** 23599a2dd95SBruce Richardson * Release resources allocated by given event queue. 23699a2dd95SBruce Richardson * 23799a2dd95SBruce Richardson * @param dev 23899a2dd95SBruce Richardson * Event device pointer 23999a2dd95SBruce Richardson * @param queue_id 24099a2dd95SBruce Richardson * Event queue index 24199a2dd95SBruce Richardson * 24299a2dd95SBruce Richardson */ 24399a2dd95SBruce Richardson typedef void (*eventdev_queue_release_t)(struct rte_eventdev *dev, 24499a2dd95SBruce Richardson uint8_t queue_id); 24599a2dd95SBruce Richardson 24699a2dd95SBruce Richardson /** 24799a2dd95SBruce Richardson * Retrieve the default event port configuration. 24899a2dd95SBruce Richardson * 24999a2dd95SBruce Richardson * @param dev 25099a2dd95SBruce Richardson * Event device pointer 25199a2dd95SBruce Richardson * @param port_id 25299a2dd95SBruce Richardson * Event port index 25399a2dd95SBruce Richardson * @param[out] port_conf 25499a2dd95SBruce Richardson * Event port configuration structure 25599a2dd95SBruce Richardson * 25699a2dd95SBruce Richardson */ 25799a2dd95SBruce Richardson typedef void (*eventdev_port_default_conf_get_t)(struct rte_eventdev *dev, 25899a2dd95SBruce Richardson uint8_t port_id, struct rte_event_port_conf *port_conf); 25999a2dd95SBruce Richardson 26099a2dd95SBruce Richardson /** 26199a2dd95SBruce Richardson * Setup an event port. 26299a2dd95SBruce Richardson * 26399a2dd95SBruce Richardson * @param dev 26499a2dd95SBruce Richardson * Event device pointer 26599a2dd95SBruce Richardson * @param port_id 26699a2dd95SBruce Richardson * Event port index 26799a2dd95SBruce Richardson * @param port_conf 26899a2dd95SBruce Richardson * Event port configuration structure 26999a2dd95SBruce Richardson * 27099a2dd95SBruce Richardson * @return 27199a2dd95SBruce Richardson * Returns 0 on success. 27299a2dd95SBruce Richardson */ 27399a2dd95SBruce Richardson typedef int (*eventdev_port_setup_t)(struct rte_eventdev *dev, 27499a2dd95SBruce Richardson uint8_t port_id, 27599a2dd95SBruce Richardson const struct rte_event_port_conf *port_conf); 27699a2dd95SBruce Richardson 27799a2dd95SBruce Richardson /** 27899a2dd95SBruce Richardson * Release memory resources allocated by given event port. 27999a2dd95SBruce Richardson * 28099a2dd95SBruce Richardson * @param port 28199a2dd95SBruce Richardson * Event port pointer 28299a2dd95SBruce Richardson * 28399a2dd95SBruce Richardson */ 28499a2dd95SBruce Richardson typedef void (*eventdev_port_release_t)(void *port); 28599a2dd95SBruce Richardson 28699a2dd95SBruce Richardson /** 28799a2dd95SBruce Richardson * Link multiple source event queues to destination event port. 28899a2dd95SBruce Richardson * 28999a2dd95SBruce Richardson * @param dev 29099a2dd95SBruce Richardson * Event device pointer 29199a2dd95SBruce Richardson * @param port 29299a2dd95SBruce Richardson * Event port pointer 29399a2dd95SBruce Richardson * @param queues 29499a2dd95SBruce Richardson * Points to an array of *nb_links* event queues to be linked 29599a2dd95SBruce Richardson * to the event port. 29699a2dd95SBruce Richardson * @param priorities 29799a2dd95SBruce Richardson * Points to an array of *nb_links* service priorities associated with each 29899a2dd95SBruce Richardson * event queue link to event port. 29999a2dd95SBruce Richardson * @param nb_links 30099a2dd95SBruce Richardson * The number of links to establish 30199a2dd95SBruce Richardson * 30299a2dd95SBruce Richardson * @return 30399a2dd95SBruce Richardson * Returns 0 on success. 30499a2dd95SBruce Richardson * 30599a2dd95SBruce Richardson */ 30699a2dd95SBruce Richardson typedef int (*eventdev_port_link_t)(struct rte_eventdev *dev, void *port, 30799a2dd95SBruce Richardson const uint8_t queues[], const uint8_t priorities[], 30899a2dd95SBruce Richardson uint16_t nb_links); 30999a2dd95SBruce Richardson 31099a2dd95SBruce Richardson /** 31199a2dd95SBruce Richardson * Unlink multiple source event queues from destination event port. 31299a2dd95SBruce Richardson * 31399a2dd95SBruce Richardson * @param dev 31499a2dd95SBruce Richardson * Event device pointer 31599a2dd95SBruce Richardson * @param port 31699a2dd95SBruce Richardson * Event port pointer 31799a2dd95SBruce Richardson * @param queues 31899a2dd95SBruce Richardson * An array of *nb_unlinks* event queues to be unlinked from the event port. 31999a2dd95SBruce Richardson * @param nb_unlinks 32099a2dd95SBruce Richardson * The number of unlinks to establish 32199a2dd95SBruce Richardson * 32299a2dd95SBruce Richardson * @return 32399a2dd95SBruce Richardson * Returns 0 on success. 32499a2dd95SBruce Richardson * 32599a2dd95SBruce Richardson */ 32699a2dd95SBruce Richardson typedef int (*eventdev_port_unlink_t)(struct rte_eventdev *dev, void *port, 32799a2dd95SBruce Richardson uint8_t queues[], uint16_t nb_unlinks); 32899a2dd95SBruce Richardson 32999a2dd95SBruce Richardson /** 33099a2dd95SBruce Richardson * Unlinks in progress. Returns number of unlinks that the PMD is currently 33199a2dd95SBruce Richardson * performing, but have not yet been completed. 33299a2dd95SBruce Richardson * 33399a2dd95SBruce Richardson * @param dev 33499a2dd95SBruce Richardson * Event device pointer 33599a2dd95SBruce Richardson * 33699a2dd95SBruce Richardson * @param port 33799a2dd95SBruce Richardson * Event port pointer 33899a2dd95SBruce Richardson * 33999a2dd95SBruce Richardson * @return 34099a2dd95SBruce Richardson * Returns the number of in-progress unlinks. Zero is returned if none are 34199a2dd95SBruce Richardson * in progress. 34299a2dd95SBruce Richardson */ 34399a2dd95SBruce Richardson typedef int (*eventdev_port_unlinks_in_progress_t)(struct rte_eventdev *dev, 34499a2dd95SBruce Richardson void *port); 34599a2dd95SBruce Richardson 34699a2dd95SBruce Richardson /** 34799a2dd95SBruce Richardson * Converts nanoseconds to *timeout_ticks* value for rte_event_dequeue() 34899a2dd95SBruce Richardson * 34999a2dd95SBruce Richardson * @param dev 35099a2dd95SBruce Richardson * Event device pointer 35199a2dd95SBruce Richardson * @param ns 35299a2dd95SBruce Richardson * Wait time in nanosecond 35399a2dd95SBruce Richardson * @param[out] timeout_ticks 35499a2dd95SBruce Richardson * Value for the *timeout_ticks* parameter in rte_event_dequeue() function 35599a2dd95SBruce Richardson * 35699a2dd95SBruce Richardson * @return 35799a2dd95SBruce Richardson * Returns 0 on success. 35899a2dd95SBruce Richardson * 35999a2dd95SBruce Richardson */ 36099a2dd95SBruce Richardson typedef int (*eventdev_dequeue_timeout_ticks_t)(struct rte_eventdev *dev, 36199a2dd95SBruce Richardson uint64_t ns, uint64_t *timeout_ticks); 36299a2dd95SBruce Richardson 36399a2dd95SBruce Richardson /** 36499a2dd95SBruce Richardson * Dump internal information 36599a2dd95SBruce Richardson * 36699a2dd95SBruce Richardson * @param dev 36799a2dd95SBruce Richardson * Event device pointer 36899a2dd95SBruce Richardson * @param f 36999a2dd95SBruce Richardson * A pointer to a file for output 37099a2dd95SBruce Richardson * 37199a2dd95SBruce Richardson */ 37299a2dd95SBruce Richardson typedef void (*eventdev_dump_t)(struct rte_eventdev *dev, FILE *f); 37399a2dd95SBruce Richardson 37499a2dd95SBruce Richardson /** 37599a2dd95SBruce Richardson * Retrieve a set of statistics from device 37699a2dd95SBruce Richardson * 37799a2dd95SBruce Richardson * @param dev 37899a2dd95SBruce Richardson * Event device pointer 37999a2dd95SBruce Richardson * @param mode 38099a2dd95SBruce Richardson * Level (device, port or queue) 38199a2dd95SBruce Richardson * @param queue_port_id 38299a2dd95SBruce Richardson * Queue or port number depending on mode 38399a2dd95SBruce Richardson * @param ids 38499a2dd95SBruce Richardson * The stat ids to retrieve 38599a2dd95SBruce Richardson * @param values 38699a2dd95SBruce Richardson * The returned stat values 38799a2dd95SBruce Richardson * @param n 38899a2dd95SBruce Richardson * The number of id values and entries in the values array 38999a2dd95SBruce Richardson * @return 39099a2dd95SBruce Richardson * The number of stat values successfully filled into the values array 39199a2dd95SBruce Richardson */ 39299a2dd95SBruce Richardson typedef int (*eventdev_xstats_get_t)(const struct rte_eventdev *dev, 39399a2dd95SBruce Richardson enum rte_event_dev_xstats_mode mode, uint8_t queue_port_id, 39499a2dd95SBruce Richardson const unsigned int ids[], uint64_t values[], unsigned int n); 39599a2dd95SBruce Richardson 39699a2dd95SBruce Richardson /** 39799a2dd95SBruce Richardson * Resets the statistic values in xstats for the device, based on mode. 39899a2dd95SBruce Richardson */ 39999a2dd95SBruce Richardson typedef int (*eventdev_xstats_reset_t)(struct rte_eventdev *dev, 40099a2dd95SBruce Richardson enum rte_event_dev_xstats_mode mode, 40199a2dd95SBruce Richardson int16_t queue_port_id, 40299a2dd95SBruce Richardson const uint32_t ids[], 40399a2dd95SBruce Richardson uint32_t nb_ids); 40499a2dd95SBruce Richardson 40599a2dd95SBruce Richardson /** 40699a2dd95SBruce Richardson * Get names of extended stats of an event device 40799a2dd95SBruce Richardson * 40899a2dd95SBruce Richardson * @param dev 40999a2dd95SBruce Richardson * Event device pointer 41099a2dd95SBruce Richardson * @param mode 41199a2dd95SBruce Richardson * Level (device, port or queue) 41299a2dd95SBruce Richardson * @param queue_port_id 41399a2dd95SBruce Richardson * Queue or port number depending on mode 41499a2dd95SBruce Richardson * @param xstats_names 41599a2dd95SBruce Richardson * Array of name values to be filled in 41699a2dd95SBruce Richardson * @param ids 41799a2dd95SBruce Richardson * The stat ids to retrieve 41899a2dd95SBruce Richardson * @param size 41999a2dd95SBruce Richardson * Number of values in the xstats_names array 42099a2dd95SBruce Richardson * @return 42199a2dd95SBruce Richardson * When size >= the number of stats, return the number of stat values filled 42299a2dd95SBruce Richardson * into the array. 42399a2dd95SBruce Richardson * When size < the number of available stats, return the number of stats 42499a2dd95SBruce Richardson * values, and do not fill in any data into xstats_names. 42599a2dd95SBruce Richardson */ 42699a2dd95SBruce Richardson typedef int (*eventdev_xstats_get_names_t)(const struct rte_eventdev *dev, 42799a2dd95SBruce Richardson enum rte_event_dev_xstats_mode mode, uint8_t queue_port_id, 42899a2dd95SBruce Richardson struct rte_event_dev_xstats_name *xstats_names, 42999a2dd95SBruce Richardson unsigned int *ids, unsigned int size); 43099a2dd95SBruce Richardson 43199a2dd95SBruce Richardson /** 43299a2dd95SBruce Richardson * Get value of one stats and optionally return its id 43399a2dd95SBruce Richardson * 43499a2dd95SBruce Richardson * @param dev 43599a2dd95SBruce Richardson * Event device pointer 43699a2dd95SBruce Richardson * @param name 43799a2dd95SBruce Richardson * The name of the stat to retrieve 43899a2dd95SBruce Richardson * @param id 43999a2dd95SBruce Richardson * Pointer to an unsigned int where we store the stat-id for future reference. 44099a2dd95SBruce Richardson * This pointer may be null if the id is not required. 44199a2dd95SBruce Richardson * @return 44299a2dd95SBruce Richardson * The value of the stat, or (uint64_t)-1 if the stat is not found. 44399a2dd95SBruce Richardson * If the stat is not found, the id value will be returned as (unsigned)-1, 44499a2dd95SBruce Richardson * if id pointer is non-NULL 44599a2dd95SBruce Richardson */ 44699a2dd95SBruce Richardson typedef uint64_t (*eventdev_xstats_get_by_name)(const struct rte_eventdev *dev, 44799a2dd95SBruce Richardson const char *name, unsigned int *id); 44899a2dd95SBruce Richardson 44999a2dd95SBruce Richardson 45099a2dd95SBruce Richardson /** 45199a2dd95SBruce Richardson * Retrieve the event device's ethdev Rx adapter capabilities for the 45299a2dd95SBruce Richardson * specified ethernet port 45399a2dd95SBruce Richardson * 45499a2dd95SBruce Richardson * @param dev 45599a2dd95SBruce Richardson * Event device pointer 45699a2dd95SBruce Richardson * 45799a2dd95SBruce Richardson * @param eth_dev 45899a2dd95SBruce Richardson * Ethernet device pointer 45999a2dd95SBruce Richardson * 46099a2dd95SBruce Richardson * @param[out] caps 46199a2dd95SBruce Richardson * A pointer to memory filled with Rx event adapter capabilities. 46299a2dd95SBruce Richardson * 46399a2dd95SBruce Richardson * @return 46499a2dd95SBruce Richardson * - 0: Success, driver provides Rx event adapter capabilities for the 46599a2dd95SBruce Richardson * ethernet device. 46699a2dd95SBruce Richardson * - <0: Error code returned by the driver function. 46799a2dd95SBruce Richardson * 46899a2dd95SBruce Richardson */ 46999a2dd95SBruce Richardson typedef int (*eventdev_eth_rx_adapter_caps_get_t) 47099a2dd95SBruce Richardson (const struct rte_eventdev *dev, 47199a2dd95SBruce Richardson const struct rte_eth_dev *eth_dev, 47299a2dd95SBruce Richardson uint32_t *caps); 47399a2dd95SBruce Richardson 47499a2dd95SBruce Richardson struct rte_event_eth_rx_adapter_queue_conf; 47599a2dd95SBruce Richardson 47699a2dd95SBruce Richardson /** 47799a2dd95SBruce Richardson * Retrieve the event device's timer adapter capabilities, as well as the ops 47899a2dd95SBruce Richardson * structure that an event timer adapter should call through to enter the 47999a2dd95SBruce Richardson * driver 48099a2dd95SBruce Richardson * 48199a2dd95SBruce Richardson * @param dev 48299a2dd95SBruce Richardson * Event device pointer 48399a2dd95SBruce Richardson * 48499a2dd95SBruce Richardson * @param flags 48599a2dd95SBruce Richardson * Flags that can be used to determine how to select an event timer 48699a2dd95SBruce Richardson * adapter ops structure 48799a2dd95SBruce Richardson * 48899a2dd95SBruce Richardson * @param[out] caps 48999a2dd95SBruce Richardson * A pointer to memory filled with Rx event adapter capabilities. 49099a2dd95SBruce Richardson * 49199a2dd95SBruce Richardson * @param[out] ops 49299a2dd95SBruce Richardson * A pointer to the ops pointer to set with the address of the desired ops 49399a2dd95SBruce Richardson * structure 49499a2dd95SBruce Richardson * 49599a2dd95SBruce Richardson * @return 49699a2dd95SBruce Richardson * - 0: Success, driver provides Rx event adapter capabilities for the 49799a2dd95SBruce Richardson * ethernet device. 49899a2dd95SBruce Richardson * - <0: Error code returned by the driver function. 49999a2dd95SBruce Richardson * 50099a2dd95SBruce Richardson */ 50199a2dd95SBruce Richardson typedef int (*eventdev_timer_adapter_caps_get_t)( 50299a2dd95SBruce Richardson const struct rte_eventdev *dev, 50399a2dd95SBruce Richardson uint64_t flags, 50499a2dd95SBruce Richardson uint32_t *caps, 50599a2dd95SBruce Richardson const struct rte_event_timer_adapter_ops **ops); 50699a2dd95SBruce Richardson 50799a2dd95SBruce Richardson /** 50899a2dd95SBruce Richardson * Add ethernet Rx queues to event device. This callback is invoked if 50999a2dd95SBruce Richardson * the caps returned from rte_eventdev_eth_rx_adapter_caps_get(, eth_port_id) 51099a2dd95SBruce Richardson * has RTE_EVENT_ETH_RX_ADAPTER_CAP_INTERNAL_PORT set. 51199a2dd95SBruce Richardson * 51299a2dd95SBruce Richardson * @param dev 51399a2dd95SBruce Richardson * Event device pointer 51499a2dd95SBruce Richardson * 51599a2dd95SBruce Richardson * @param eth_dev 51699a2dd95SBruce Richardson * Ethernet device pointer 51799a2dd95SBruce Richardson * 51899a2dd95SBruce Richardson * @param rx_queue_id 51999a2dd95SBruce Richardson * Ethernet device receive queue index 52099a2dd95SBruce Richardson * 52199a2dd95SBruce Richardson * @param queue_conf 52299a2dd95SBruce Richardson * Additional configuration structure 52399a2dd95SBruce Richardson 52499a2dd95SBruce Richardson * @return 52599a2dd95SBruce Richardson * - 0: Success, ethernet receive queue added successfully. 52699a2dd95SBruce Richardson * - <0: Error code returned by the driver function. 52799a2dd95SBruce Richardson * 52899a2dd95SBruce Richardson */ 52999a2dd95SBruce Richardson typedef int (*eventdev_eth_rx_adapter_queue_add_t)( 53099a2dd95SBruce Richardson const struct rte_eventdev *dev, 53199a2dd95SBruce Richardson const struct rte_eth_dev *eth_dev, 53299a2dd95SBruce Richardson int32_t rx_queue_id, 53399a2dd95SBruce Richardson const struct rte_event_eth_rx_adapter_queue_conf *queue_conf); 53499a2dd95SBruce Richardson 53599a2dd95SBruce Richardson /** 53699a2dd95SBruce Richardson * Delete ethernet Rx queues from event device. This callback is invoked if 53799a2dd95SBruce Richardson * the caps returned from eventdev_eth_rx_adapter_caps_get(, eth_port_id) 53899a2dd95SBruce Richardson * has RTE_EVENT_ETH_RX_ADAPTER_CAP_INTERNAL_PORT set. 53999a2dd95SBruce Richardson * 54099a2dd95SBruce Richardson * @param dev 54199a2dd95SBruce Richardson * Event device pointer 54299a2dd95SBruce Richardson * 54399a2dd95SBruce Richardson * @param eth_dev 54499a2dd95SBruce Richardson * Ethernet device pointer 54599a2dd95SBruce Richardson * 54699a2dd95SBruce Richardson * @param rx_queue_id 54799a2dd95SBruce Richardson * Ethernet device receive queue index 54899a2dd95SBruce Richardson * 54999a2dd95SBruce Richardson * @return 55099a2dd95SBruce Richardson * - 0: Success, ethernet receive queue deleted successfully. 55199a2dd95SBruce Richardson * - <0: Error code returned by the driver function. 55299a2dd95SBruce Richardson * 55399a2dd95SBruce Richardson */ 55499a2dd95SBruce Richardson typedef int (*eventdev_eth_rx_adapter_queue_del_t) 55599a2dd95SBruce Richardson (const struct rte_eventdev *dev, 55699a2dd95SBruce Richardson const struct rte_eth_dev *eth_dev, 55799a2dd95SBruce Richardson int32_t rx_queue_id); 55899a2dd95SBruce Richardson 55999a2dd95SBruce Richardson /** 560da781e64SGanapati Kundapura * Retrieve Rx adapter queue config information for the specified 561da781e64SGanapati Kundapura * rx queue ID. 562da781e64SGanapati Kundapura * 563da781e64SGanapati Kundapura * @param dev 564da781e64SGanapati Kundapura * Event device pointer 565da781e64SGanapati Kundapura * 566da781e64SGanapati Kundapura * @param eth_dev 567da781e64SGanapati Kundapura * Ethernet device pointer 568da781e64SGanapati Kundapura * 569da781e64SGanapati Kundapura * @param rx_queue_id 570da781e64SGanapati Kundapura * Ethernet device receive queue index. 571da781e64SGanapati Kundapura * 572da781e64SGanapati Kundapura * @param[out] queue_conf 573da781e64SGanapati Kundapura * Pointer to rte_event_eth_rx_adapter_queue_conf structure 574da781e64SGanapati Kundapura * 575da781e64SGanapati Kundapura * @return 576da781e64SGanapati Kundapura * - 0: Success 577da781e64SGanapati Kundapura * - <0: Error code on failure. 578da781e64SGanapati Kundapura */ 579da781e64SGanapati Kundapura typedef int (*eventdev_eth_rx_adapter_queue_conf_get_t) 580da781e64SGanapati Kundapura (const struct rte_eventdev *dev, 581da781e64SGanapati Kundapura const struct rte_eth_dev *eth_dev, 582da781e64SGanapati Kundapura uint16_t rx_queue_id, 583da781e64SGanapati Kundapura struct rte_event_eth_rx_adapter_queue_conf *queue_conf); 584da781e64SGanapati Kundapura 585da781e64SGanapati Kundapura /** 58699a2dd95SBruce Richardson * Start ethernet Rx adapter. This callback is invoked if 58799a2dd95SBruce Richardson * the caps returned from eventdev_eth_rx_adapter_caps_get(.., eth_port_id) 58899a2dd95SBruce Richardson * has RTE_EVENT_ETH_RX_ADAPTER_CAP_INTERNAL_PORT set and Rx queues 58999a2dd95SBruce Richardson * from eth_port_id have been added to the event device. 59099a2dd95SBruce Richardson * 59199a2dd95SBruce Richardson * @param dev 59299a2dd95SBruce Richardson * Event device pointer 59399a2dd95SBruce Richardson * 59499a2dd95SBruce Richardson * @param eth_dev 59599a2dd95SBruce Richardson * Ethernet device pointer 59699a2dd95SBruce Richardson * 59799a2dd95SBruce Richardson * @return 59899a2dd95SBruce Richardson * - 0: Success, ethernet Rx adapter started successfully. 59999a2dd95SBruce Richardson * - <0: Error code returned by the driver function. 60099a2dd95SBruce Richardson */ 60199a2dd95SBruce Richardson typedef int (*eventdev_eth_rx_adapter_start_t) 60299a2dd95SBruce Richardson (const struct rte_eventdev *dev, 60399a2dd95SBruce Richardson const struct rte_eth_dev *eth_dev); 60499a2dd95SBruce Richardson 60599a2dd95SBruce Richardson /** 60699a2dd95SBruce Richardson * Stop ethernet Rx adapter. This callback is invoked if 60799a2dd95SBruce Richardson * the caps returned from eventdev_eth_rx_adapter_caps_get(..,eth_port_id) 60899a2dd95SBruce Richardson * has RTE_EVENT_ETH_RX_ADAPTER_CAP_INTERNAL_PORT set and Rx queues 60999a2dd95SBruce Richardson * from eth_port_id have been added to the event device. 61099a2dd95SBruce Richardson * 61199a2dd95SBruce Richardson * @param dev 61299a2dd95SBruce Richardson * Event device pointer 61399a2dd95SBruce Richardson * 61499a2dd95SBruce Richardson * @param eth_dev 61599a2dd95SBruce Richardson * Ethernet device pointer 61699a2dd95SBruce Richardson * 61799a2dd95SBruce Richardson * @return 61899a2dd95SBruce Richardson * - 0: Success, ethernet Rx adapter stopped successfully. 61999a2dd95SBruce Richardson * - <0: Error code returned by the driver function. 62099a2dd95SBruce Richardson */ 62199a2dd95SBruce Richardson typedef int (*eventdev_eth_rx_adapter_stop_t) 62299a2dd95SBruce Richardson (const struct rte_eventdev *dev, 62399a2dd95SBruce Richardson const struct rte_eth_dev *eth_dev); 62499a2dd95SBruce Richardson 62599a2dd95SBruce Richardson struct rte_event_eth_rx_adapter_stats; 62699a2dd95SBruce Richardson 62799a2dd95SBruce Richardson /** 62899a2dd95SBruce Richardson * Retrieve ethernet Rx adapter statistics. 62999a2dd95SBruce Richardson * 63099a2dd95SBruce Richardson * @param dev 63199a2dd95SBruce Richardson * Event device pointer 63299a2dd95SBruce Richardson * 63399a2dd95SBruce Richardson * @param eth_dev 63499a2dd95SBruce Richardson * Ethernet device pointer 63599a2dd95SBruce Richardson * 63699a2dd95SBruce Richardson * @param[out] stats 63799a2dd95SBruce Richardson * Pointer to stats structure 63899a2dd95SBruce Richardson * 63999a2dd95SBruce Richardson * @return 64099a2dd95SBruce Richardson * Return 0 on success. 64199a2dd95SBruce Richardson */ 64299a2dd95SBruce Richardson 64399a2dd95SBruce Richardson typedef int (*eventdev_eth_rx_adapter_stats_get) 64499a2dd95SBruce Richardson (const struct rte_eventdev *dev, 64599a2dd95SBruce Richardson const struct rte_eth_dev *eth_dev, 64699a2dd95SBruce Richardson struct rte_event_eth_rx_adapter_stats *stats); 64799a2dd95SBruce Richardson /** 64899a2dd95SBruce Richardson * Reset ethernet Rx adapter statistics. 64999a2dd95SBruce Richardson * 65099a2dd95SBruce Richardson * @param dev 65199a2dd95SBruce Richardson * Event device pointer 65299a2dd95SBruce Richardson * 65399a2dd95SBruce Richardson * @param eth_dev 65499a2dd95SBruce Richardson * Ethernet device pointer 65599a2dd95SBruce Richardson * 65699a2dd95SBruce Richardson * @return 65799a2dd95SBruce Richardson * Return 0 on success. 65899a2dd95SBruce Richardson */ 65999a2dd95SBruce Richardson typedef int (*eventdev_eth_rx_adapter_stats_reset) 66099a2dd95SBruce Richardson (const struct rte_eventdev *dev, 66199a2dd95SBruce Richardson const struct rte_eth_dev *eth_dev); 66299a2dd95SBruce Richardson /** 66399a2dd95SBruce Richardson * Start eventdev selftest. 66499a2dd95SBruce Richardson * 66599a2dd95SBruce Richardson * @return 66699a2dd95SBruce Richardson * Return 0 on success. 66799a2dd95SBruce Richardson */ 66899a2dd95SBruce Richardson typedef int (*eventdev_selftest)(void); 66999a2dd95SBruce Richardson 67099a2dd95SBruce Richardson struct rte_event_eth_rx_adapter_vector_limits; 67199a2dd95SBruce Richardson /** 67299a2dd95SBruce Richardson * Get event vector limits for a given event, ethernet device pair. 67399a2dd95SBruce Richardson * 67499a2dd95SBruce Richardson * @param dev 67599a2dd95SBruce Richardson * Event device pointer 67699a2dd95SBruce Richardson * 67799a2dd95SBruce Richardson * @param eth_dev 67899a2dd95SBruce Richardson * Ethernet device pointer 67999a2dd95SBruce Richardson * 68099a2dd95SBruce Richardson * @param[out] limits 68199a2dd95SBruce Richardson * Pointer to the limits structure to be filled. 68299a2dd95SBruce Richardson * 68399a2dd95SBruce Richardson * @return 68499a2dd95SBruce Richardson * - 0: Success. 68599a2dd95SBruce Richardson * - <0: Error code returned by the driver function. 68699a2dd95SBruce Richardson */ 68799a2dd95SBruce Richardson typedef int (*eventdev_eth_rx_adapter_vector_limits_get_t)( 68899a2dd95SBruce Richardson const struct rte_eventdev *dev, const struct rte_eth_dev *eth_dev, 68999a2dd95SBruce Richardson struct rte_event_eth_rx_adapter_vector_limits *limits); 69099a2dd95SBruce Richardson 69199a2dd95SBruce Richardson typedef uint32_t rte_event_pmd_selftest_seqn_t; 69299a2dd95SBruce Richardson extern int rte_event_pmd_selftest_seqn_dynfield_offset; 69399a2dd95SBruce Richardson 69499a2dd95SBruce Richardson /** 69599a2dd95SBruce Richardson * Read test sequence number from mbuf. 69699a2dd95SBruce Richardson * 69799a2dd95SBruce Richardson * @param mbuf Structure to read from. 69899a2dd95SBruce Richardson * @return pointer to test sequence number. 69999a2dd95SBruce Richardson */ 70099a2dd95SBruce Richardson __rte_internal 70199a2dd95SBruce Richardson static inline rte_event_pmd_selftest_seqn_t * 70299a2dd95SBruce Richardson rte_event_pmd_selftest_seqn(struct rte_mbuf *mbuf) 70399a2dd95SBruce Richardson { 70499a2dd95SBruce Richardson return RTE_MBUF_DYNFIELD(mbuf, 70599a2dd95SBruce Richardson rte_event_pmd_selftest_seqn_dynfield_offset, 70699a2dd95SBruce Richardson rte_event_pmd_selftest_seqn_t *); 70799a2dd95SBruce Richardson } 70899a2dd95SBruce Richardson 70999a2dd95SBruce Richardson struct rte_cryptodev; 71099a2dd95SBruce Richardson 71199a2dd95SBruce Richardson /** 71299a2dd95SBruce Richardson * This API may change without prior notice 71399a2dd95SBruce Richardson * 71499a2dd95SBruce Richardson * Retrieve the event device's crypto adapter capabilities for the 71599a2dd95SBruce Richardson * specified cryptodev 71699a2dd95SBruce Richardson * 71799a2dd95SBruce Richardson * @param dev 71899a2dd95SBruce Richardson * Event device pointer 71999a2dd95SBruce Richardson * 72099a2dd95SBruce Richardson * @param cdev 72199a2dd95SBruce Richardson * cryptodev pointer 72299a2dd95SBruce Richardson * 72399a2dd95SBruce Richardson * @param[out] caps 72499a2dd95SBruce Richardson * A pointer to memory filled with event adapter capabilities. 72599a2dd95SBruce Richardson * It is expected to be pre-allocated & initialized by caller. 72699a2dd95SBruce Richardson * 72799a2dd95SBruce Richardson * @return 72899a2dd95SBruce Richardson * - 0: Success, driver provides event adapter capabilities for the 72999a2dd95SBruce Richardson * cryptodev. 73099a2dd95SBruce Richardson * - <0: Error code returned by the driver function. 73199a2dd95SBruce Richardson * 73299a2dd95SBruce Richardson */ 73399a2dd95SBruce Richardson typedef int (*eventdev_crypto_adapter_caps_get_t) 73499a2dd95SBruce Richardson (const struct rte_eventdev *dev, 73599a2dd95SBruce Richardson const struct rte_cryptodev *cdev, 73699a2dd95SBruce Richardson uint32_t *caps); 73799a2dd95SBruce Richardson 73899a2dd95SBruce Richardson /** 73999a2dd95SBruce Richardson * This API may change without prior notice 74099a2dd95SBruce Richardson * 74199a2dd95SBruce Richardson * Add crypto queue pair to event device. This callback is invoked if 74299a2dd95SBruce Richardson * the caps returned from rte_event_crypto_adapter_caps_get(, cdev_id) 74399a2dd95SBruce Richardson * has RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_* set. 74499a2dd95SBruce Richardson * 74599a2dd95SBruce Richardson * @param dev 74699a2dd95SBruce Richardson * Event device pointer 74799a2dd95SBruce Richardson * 74899a2dd95SBruce Richardson * @param cdev 74999a2dd95SBruce Richardson * cryptodev pointer 75099a2dd95SBruce Richardson * 75199a2dd95SBruce Richardson * @param queue_pair_id 75299a2dd95SBruce Richardson * cryptodev queue pair identifier. 75399a2dd95SBruce Richardson * 75499a2dd95SBruce Richardson * @param event 75599a2dd95SBruce Richardson * Event information required for binding cryptodev queue pair to event queue. 75699a2dd95SBruce Richardson * This structure will have a valid value for only those HW PMDs supporting 75799a2dd95SBruce Richardson * @see RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_QP_EV_BIND capability. 75899a2dd95SBruce Richardson * 75999a2dd95SBruce Richardson * @return 76099a2dd95SBruce Richardson * - 0: Success, cryptodev queue pair added successfully. 76199a2dd95SBruce Richardson * - <0: Error code returned by the driver function. 76299a2dd95SBruce Richardson * 76399a2dd95SBruce Richardson */ 76499a2dd95SBruce Richardson typedef int (*eventdev_crypto_adapter_queue_pair_add_t) 76599a2dd95SBruce Richardson (const struct rte_eventdev *dev, 76699a2dd95SBruce Richardson const struct rte_cryptodev *cdev, 76799a2dd95SBruce Richardson int32_t queue_pair_id, 76899a2dd95SBruce Richardson const struct rte_event *event); 76999a2dd95SBruce Richardson 77099a2dd95SBruce Richardson 77199a2dd95SBruce Richardson /** 77299a2dd95SBruce Richardson * This API may change without prior notice 77399a2dd95SBruce Richardson * 77499a2dd95SBruce Richardson * Delete crypto queue pair to event device. This callback is invoked if 77599a2dd95SBruce Richardson * the caps returned from rte_event_crypto_adapter_caps_get(, cdev_id) 77699a2dd95SBruce Richardson * has RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_* set. 77799a2dd95SBruce Richardson * 77899a2dd95SBruce Richardson * @param dev 77999a2dd95SBruce Richardson * Event device pointer 78099a2dd95SBruce Richardson * 78199a2dd95SBruce Richardson * @param cdev 78299a2dd95SBruce Richardson * cryptodev pointer 78399a2dd95SBruce Richardson * 78499a2dd95SBruce Richardson * @param queue_pair_id 78599a2dd95SBruce Richardson * cryptodev queue pair identifier. 78699a2dd95SBruce Richardson * 78799a2dd95SBruce Richardson * @return 78899a2dd95SBruce Richardson * - 0: Success, cryptodev queue pair deleted successfully. 78999a2dd95SBruce Richardson * - <0: Error code returned by the driver function. 79099a2dd95SBruce Richardson * 79199a2dd95SBruce Richardson */ 79299a2dd95SBruce Richardson typedef int (*eventdev_crypto_adapter_queue_pair_del_t) 79399a2dd95SBruce Richardson (const struct rte_eventdev *dev, 79499a2dd95SBruce Richardson const struct rte_cryptodev *cdev, 79599a2dd95SBruce Richardson int32_t queue_pair_id); 79699a2dd95SBruce Richardson 79799a2dd95SBruce Richardson /** 79899a2dd95SBruce Richardson * Start crypto adapter. This callback is invoked if 79999a2dd95SBruce Richardson * the caps returned from rte_event_crypto_adapter_caps_get(.., cdev_id) 80099a2dd95SBruce Richardson * has RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_* set and queue pairs 80199a2dd95SBruce Richardson * from cdev_id have been added to the event device. 80299a2dd95SBruce Richardson * 80399a2dd95SBruce Richardson * @param dev 80499a2dd95SBruce Richardson * Event device pointer 80599a2dd95SBruce Richardson * 80699a2dd95SBruce Richardson * @param cdev 80799a2dd95SBruce Richardson * Crypto device pointer 80899a2dd95SBruce Richardson * 80999a2dd95SBruce Richardson * @return 81099a2dd95SBruce Richardson * - 0: Success, crypto adapter started successfully. 81199a2dd95SBruce Richardson * - <0: Error code returned by the driver function. 81299a2dd95SBruce Richardson */ 81399a2dd95SBruce Richardson typedef int (*eventdev_crypto_adapter_start_t) 81499a2dd95SBruce Richardson (const struct rte_eventdev *dev, 81599a2dd95SBruce Richardson const struct rte_cryptodev *cdev); 81699a2dd95SBruce Richardson 81799a2dd95SBruce Richardson /** 81899a2dd95SBruce Richardson * Stop crypto adapter. This callback is invoked if 81999a2dd95SBruce Richardson * the caps returned from rte_event_crypto_adapter_caps_get(.., cdev_id) 82099a2dd95SBruce Richardson * has RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_* set and queue pairs 82199a2dd95SBruce Richardson * from cdev_id have been added to the event device. 82299a2dd95SBruce Richardson * 82399a2dd95SBruce Richardson * @param dev 82499a2dd95SBruce Richardson * Event device pointer 82599a2dd95SBruce Richardson * 82699a2dd95SBruce Richardson * @param cdev 82799a2dd95SBruce Richardson * Crypto device pointer 82899a2dd95SBruce Richardson * 82999a2dd95SBruce Richardson * @return 83099a2dd95SBruce Richardson * - 0: Success, crypto adapter stopped successfully. 83199a2dd95SBruce Richardson * - <0: Error code returned by the driver function. 83299a2dd95SBruce Richardson */ 83399a2dd95SBruce Richardson typedef int (*eventdev_crypto_adapter_stop_t) 83499a2dd95SBruce Richardson (const struct rte_eventdev *dev, 83599a2dd95SBruce Richardson const struct rte_cryptodev *cdev); 83699a2dd95SBruce Richardson 83799a2dd95SBruce Richardson struct rte_event_crypto_adapter_stats; 83899a2dd95SBruce Richardson 83999a2dd95SBruce Richardson /** 84099a2dd95SBruce Richardson * Retrieve crypto adapter statistics. 84199a2dd95SBruce Richardson * 84299a2dd95SBruce Richardson * @param dev 84399a2dd95SBruce Richardson * Event device pointer 84499a2dd95SBruce Richardson * 84599a2dd95SBruce Richardson * @param cdev 84699a2dd95SBruce Richardson * Crypto device pointer 84799a2dd95SBruce Richardson * 84899a2dd95SBruce Richardson * @param[out] stats 84999a2dd95SBruce Richardson * Pointer to stats structure 85099a2dd95SBruce Richardson * 85199a2dd95SBruce Richardson * @return 85299a2dd95SBruce Richardson * Return 0 on success. 85399a2dd95SBruce Richardson */ 85499a2dd95SBruce Richardson 85599a2dd95SBruce Richardson typedef int (*eventdev_crypto_adapter_stats_get) 85699a2dd95SBruce Richardson (const struct rte_eventdev *dev, 85799a2dd95SBruce Richardson const struct rte_cryptodev *cdev, 85899a2dd95SBruce Richardson struct rte_event_crypto_adapter_stats *stats); 85999a2dd95SBruce Richardson 86099a2dd95SBruce Richardson /** 86199a2dd95SBruce Richardson * Reset crypto adapter statistics. 86299a2dd95SBruce Richardson * 86399a2dd95SBruce Richardson * @param dev 86499a2dd95SBruce Richardson * Event device pointer 86599a2dd95SBruce Richardson * 86699a2dd95SBruce Richardson * @param cdev 86799a2dd95SBruce Richardson * Crypto device pointer 86899a2dd95SBruce Richardson * 86999a2dd95SBruce Richardson * @return 87099a2dd95SBruce Richardson * Return 0 on success. 87199a2dd95SBruce Richardson */ 87299a2dd95SBruce Richardson 87399a2dd95SBruce Richardson typedef int (*eventdev_crypto_adapter_stats_reset) 87499a2dd95SBruce Richardson (const struct rte_eventdev *dev, 87599a2dd95SBruce Richardson const struct rte_cryptodev *cdev); 87699a2dd95SBruce Richardson 87799a2dd95SBruce Richardson /** 87899a2dd95SBruce Richardson * Retrieve the event device's eth Tx adapter capabilities. 87999a2dd95SBruce Richardson * 88099a2dd95SBruce Richardson * @param dev 88199a2dd95SBruce Richardson * Event device pointer 88299a2dd95SBruce Richardson * 88399a2dd95SBruce Richardson * @param eth_dev 88499a2dd95SBruce Richardson * Ethernet device pointer 88599a2dd95SBruce Richardson * 88699a2dd95SBruce Richardson * @param[out] caps 88799a2dd95SBruce Richardson * A pointer to memory filled with eth Tx adapter capabilities. 88899a2dd95SBruce Richardson * 88999a2dd95SBruce Richardson * @return 89099a2dd95SBruce Richardson * - 0: Success, driver provides eth Tx adapter capabilities 89199a2dd95SBruce Richardson * - <0: Error code returned by the driver function. 89299a2dd95SBruce Richardson * 89399a2dd95SBruce Richardson */ 89499a2dd95SBruce Richardson typedef int (*eventdev_eth_tx_adapter_caps_get_t) 89599a2dd95SBruce Richardson (const struct rte_eventdev *dev, 89699a2dd95SBruce Richardson const struct rte_eth_dev *eth_dev, 89799a2dd95SBruce Richardson uint32_t *caps); 89899a2dd95SBruce Richardson 89999a2dd95SBruce Richardson /** 90099a2dd95SBruce Richardson * Create adapter callback. 90199a2dd95SBruce Richardson * 90299a2dd95SBruce Richardson * @param id 90399a2dd95SBruce Richardson * Adapter identifier 90499a2dd95SBruce Richardson * 90599a2dd95SBruce Richardson * @param dev 90699a2dd95SBruce Richardson * Event device pointer 90799a2dd95SBruce Richardson * 90899a2dd95SBruce Richardson * @return 90999a2dd95SBruce Richardson * - 0: Success. 91099a2dd95SBruce Richardson * - <0: Error code on failure. 91199a2dd95SBruce Richardson */ 91299a2dd95SBruce Richardson typedef int (*eventdev_eth_tx_adapter_create_t)(uint8_t id, 91399a2dd95SBruce Richardson const struct rte_eventdev *dev); 91499a2dd95SBruce Richardson 91599a2dd95SBruce Richardson /** 91699a2dd95SBruce Richardson * Free adapter callback. 91799a2dd95SBruce Richardson * 91899a2dd95SBruce Richardson * @param id 91999a2dd95SBruce Richardson * Adapter identifier 92099a2dd95SBruce Richardson * 92199a2dd95SBruce Richardson * @param dev 92299a2dd95SBruce Richardson * Event device pointer 92399a2dd95SBruce Richardson * 92499a2dd95SBruce Richardson * @return 92599a2dd95SBruce Richardson * - 0: Success. 92699a2dd95SBruce Richardson * - <0: Error code on failure. 92799a2dd95SBruce Richardson */ 92899a2dd95SBruce Richardson typedef int (*eventdev_eth_tx_adapter_free_t)(uint8_t id, 92999a2dd95SBruce Richardson const struct rte_eventdev *dev); 93099a2dd95SBruce Richardson 93199a2dd95SBruce Richardson /** 93299a2dd95SBruce Richardson * Add a Tx queue to the adapter. 93399a2dd95SBruce Richardson * A queue value of -1 is used to indicate all 93499a2dd95SBruce Richardson * queues within the device. 93599a2dd95SBruce Richardson * 93699a2dd95SBruce Richardson * @param id 93799a2dd95SBruce Richardson * Adapter identifier 93899a2dd95SBruce Richardson * 93999a2dd95SBruce Richardson * @param dev 94099a2dd95SBruce Richardson * Event device pointer 94199a2dd95SBruce Richardson * 94299a2dd95SBruce Richardson * @param eth_dev 94399a2dd95SBruce Richardson * Ethernet device pointer 94499a2dd95SBruce Richardson * 94599a2dd95SBruce Richardson * @param tx_queue_id 94699a2dd95SBruce Richardson * Transmit queue index 94799a2dd95SBruce Richardson * 94899a2dd95SBruce Richardson * @return 94999a2dd95SBruce Richardson * - 0: Success. 95099a2dd95SBruce Richardson * - <0: Error code on failure. 95199a2dd95SBruce Richardson */ 95299a2dd95SBruce Richardson typedef int (*eventdev_eth_tx_adapter_queue_add_t)( 95399a2dd95SBruce Richardson uint8_t id, 95499a2dd95SBruce Richardson const struct rte_eventdev *dev, 95599a2dd95SBruce Richardson const struct rte_eth_dev *eth_dev, 95699a2dd95SBruce Richardson int32_t tx_queue_id); 95799a2dd95SBruce Richardson 95899a2dd95SBruce Richardson /** 95999a2dd95SBruce Richardson * Delete a Tx queue from the adapter. 96099a2dd95SBruce Richardson * A queue value of -1 is used to indicate all 96199a2dd95SBruce Richardson * queues within the device, that have been added to this 96299a2dd95SBruce Richardson * adapter. 96399a2dd95SBruce Richardson * 96499a2dd95SBruce Richardson * @param id 96599a2dd95SBruce Richardson * Adapter identifier 96699a2dd95SBruce Richardson * 96799a2dd95SBruce Richardson * @param dev 96899a2dd95SBruce Richardson * Event device pointer 96999a2dd95SBruce Richardson * 97099a2dd95SBruce Richardson * @param eth_dev 97199a2dd95SBruce Richardson * Ethernet device pointer 97299a2dd95SBruce Richardson * 97399a2dd95SBruce Richardson * @param tx_queue_id 97499a2dd95SBruce Richardson * Transmit queue index 97599a2dd95SBruce Richardson * 97699a2dd95SBruce Richardson * @return 97799a2dd95SBruce Richardson * - 0: Success, Queues deleted successfully. 97899a2dd95SBruce Richardson * - <0: Error code on failure. 97999a2dd95SBruce Richardson */ 98099a2dd95SBruce Richardson typedef int (*eventdev_eth_tx_adapter_queue_del_t)( 98199a2dd95SBruce Richardson uint8_t id, 98299a2dd95SBruce Richardson const struct rte_eventdev *dev, 98399a2dd95SBruce Richardson const struct rte_eth_dev *eth_dev, 98499a2dd95SBruce Richardson int32_t tx_queue_id); 98599a2dd95SBruce Richardson 98699a2dd95SBruce Richardson /** 98799a2dd95SBruce Richardson * Start the adapter. 98899a2dd95SBruce Richardson * 98999a2dd95SBruce Richardson * @param id 99099a2dd95SBruce Richardson * Adapter identifier 99199a2dd95SBruce Richardson * 99299a2dd95SBruce Richardson * @param dev 99399a2dd95SBruce Richardson * Event device pointer 99499a2dd95SBruce Richardson * 99599a2dd95SBruce Richardson * @return 99699a2dd95SBruce Richardson * - 0: Success, Adapter started correctly. 99799a2dd95SBruce Richardson * - <0: Error code on failure. 99899a2dd95SBruce Richardson */ 99999a2dd95SBruce Richardson typedef int (*eventdev_eth_tx_adapter_start_t)(uint8_t id, 100099a2dd95SBruce Richardson const struct rte_eventdev *dev); 100199a2dd95SBruce Richardson 100299a2dd95SBruce Richardson /** 100399a2dd95SBruce Richardson * Stop the adapter. 100499a2dd95SBruce Richardson * 100599a2dd95SBruce Richardson * @param id 100699a2dd95SBruce Richardson * Adapter identifier 100799a2dd95SBruce Richardson * 100899a2dd95SBruce Richardson * @param dev 100999a2dd95SBruce Richardson * Event device pointer 101099a2dd95SBruce Richardson * 101199a2dd95SBruce Richardson * @return 101299a2dd95SBruce Richardson * - 0: Success. 101399a2dd95SBruce Richardson * - <0: Error code on failure. 101499a2dd95SBruce Richardson */ 101599a2dd95SBruce Richardson typedef int (*eventdev_eth_tx_adapter_stop_t)(uint8_t id, 101699a2dd95SBruce Richardson const struct rte_eventdev *dev); 101799a2dd95SBruce Richardson 101899a2dd95SBruce Richardson struct rte_event_eth_tx_adapter_stats; 101999a2dd95SBruce Richardson 102099a2dd95SBruce Richardson /** 102199a2dd95SBruce Richardson * Retrieve statistics for an adapter 102299a2dd95SBruce Richardson * 102399a2dd95SBruce Richardson * @param id 102499a2dd95SBruce Richardson * Adapter identifier 102599a2dd95SBruce Richardson * 102699a2dd95SBruce Richardson * @param dev 102799a2dd95SBruce Richardson * Event device pointer 102899a2dd95SBruce Richardson * 102999a2dd95SBruce Richardson * @param [out] stats 103099a2dd95SBruce Richardson * A pointer to structure used to retrieve statistics for an adapter 103199a2dd95SBruce Richardson * 103299a2dd95SBruce Richardson * @return 103399a2dd95SBruce Richardson * - 0: Success, statistics retrieved successfully. 103499a2dd95SBruce Richardson * - <0: Error code on failure. 103599a2dd95SBruce Richardson */ 103699a2dd95SBruce Richardson typedef int (*eventdev_eth_tx_adapter_stats_get_t)( 103799a2dd95SBruce Richardson uint8_t id, 103899a2dd95SBruce Richardson const struct rte_eventdev *dev, 103999a2dd95SBruce Richardson struct rte_event_eth_tx_adapter_stats *stats); 104099a2dd95SBruce Richardson 104199a2dd95SBruce Richardson /** 104299a2dd95SBruce Richardson * Reset statistics for an adapter 104399a2dd95SBruce Richardson * 104499a2dd95SBruce Richardson * @param id 104599a2dd95SBruce Richardson * Adapter identifier 104699a2dd95SBruce Richardson * 104799a2dd95SBruce Richardson * @param dev 104899a2dd95SBruce Richardson * Event device pointer 104999a2dd95SBruce Richardson * 105099a2dd95SBruce Richardson * @return 105199a2dd95SBruce Richardson * - 0: Success, statistics retrieved successfully. 105299a2dd95SBruce Richardson * - <0: Error code on failure. 105399a2dd95SBruce Richardson */ 105499a2dd95SBruce Richardson typedef int (*eventdev_eth_tx_adapter_stats_reset_t)(uint8_t id, 105599a2dd95SBruce Richardson const struct rte_eventdev *dev); 105699a2dd95SBruce Richardson 105799a2dd95SBruce Richardson /** Event device operations function pointer table */ 105823d06e37SPavan Nikhilesh struct eventdev_ops { 105999a2dd95SBruce Richardson eventdev_info_get_t dev_infos_get; /**< Get device info. */ 106099a2dd95SBruce Richardson eventdev_configure_t dev_configure; /**< Configure device. */ 106199a2dd95SBruce Richardson eventdev_start_t dev_start; /**< Start device. */ 106299a2dd95SBruce Richardson eventdev_stop_t dev_stop; /**< Stop device. */ 106399a2dd95SBruce Richardson eventdev_close_t dev_close; /**< Close device. */ 106499a2dd95SBruce Richardson 106599a2dd95SBruce Richardson eventdev_queue_default_conf_get_t queue_def_conf; 106699a2dd95SBruce Richardson /**< Get default queue configuration. */ 106799a2dd95SBruce Richardson eventdev_queue_setup_t queue_setup; 106899a2dd95SBruce Richardson /**< Set up an event queue. */ 106999a2dd95SBruce Richardson eventdev_queue_release_t queue_release; 107099a2dd95SBruce Richardson /**< Release an event queue. */ 107199a2dd95SBruce Richardson 107299a2dd95SBruce Richardson eventdev_port_default_conf_get_t port_def_conf; 107399a2dd95SBruce Richardson /**< Get default port configuration. */ 107499a2dd95SBruce Richardson eventdev_port_setup_t port_setup; 107599a2dd95SBruce Richardson /**< Set up an event port. */ 107699a2dd95SBruce Richardson eventdev_port_release_t port_release; 107799a2dd95SBruce Richardson /**< Release an event port. */ 107899a2dd95SBruce Richardson 107999a2dd95SBruce Richardson eventdev_port_link_t port_link; 108099a2dd95SBruce Richardson /**< Link event queues to an event port. */ 108199a2dd95SBruce Richardson eventdev_port_unlink_t port_unlink; 108299a2dd95SBruce Richardson /**< Unlink event queues from an event port. */ 108399a2dd95SBruce Richardson eventdev_port_unlinks_in_progress_t port_unlinks_in_progress; 108499a2dd95SBruce Richardson /**< Unlinks in progress on an event port. */ 108599a2dd95SBruce Richardson eventdev_dequeue_timeout_ticks_t timeout_ticks; 108699a2dd95SBruce Richardson /**< Converts ns to *timeout_ticks* value for rte_event_dequeue() */ 108799a2dd95SBruce Richardson eventdev_dump_t dump; 108899a2dd95SBruce Richardson /* Dump internal information */ 108999a2dd95SBruce Richardson 109099a2dd95SBruce Richardson eventdev_xstats_get_t xstats_get; 109199a2dd95SBruce Richardson /**< Get extended device statistics. */ 109299a2dd95SBruce Richardson eventdev_xstats_get_names_t xstats_get_names; 109399a2dd95SBruce Richardson /**< Get names of extended stats. */ 109499a2dd95SBruce Richardson eventdev_xstats_get_by_name xstats_get_by_name; 109599a2dd95SBruce Richardson /**< Get one value by name. */ 109699a2dd95SBruce Richardson eventdev_xstats_reset_t xstats_reset; 109799a2dd95SBruce Richardson /**< Reset the statistics values in xstats. */ 109899a2dd95SBruce Richardson 109999a2dd95SBruce Richardson eventdev_eth_rx_adapter_caps_get_t eth_rx_adapter_caps_get; 110099a2dd95SBruce Richardson /**< Get ethernet Rx adapter capabilities */ 110199a2dd95SBruce Richardson eventdev_eth_rx_adapter_queue_add_t eth_rx_adapter_queue_add; 110299a2dd95SBruce Richardson /**< Add Rx queues to ethernet Rx adapter */ 110399a2dd95SBruce Richardson eventdev_eth_rx_adapter_queue_del_t eth_rx_adapter_queue_del; 110499a2dd95SBruce Richardson /**< Delete Rx queues from ethernet Rx adapter */ 1105da781e64SGanapati Kundapura eventdev_eth_rx_adapter_queue_conf_get_t eth_rx_adapter_queue_conf_get; 1106da781e64SGanapati Kundapura /**< Get Rx adapter queue info */ 110799a2dd95SBruce Richardson eventdev_eth_rx_adapter_start_t eth_rx_adapter_start; 110899a2dd95SBruce Richardson /**< Start ethernet Rx adapter */ 110999a2dd95SBruce Richardson eventdev_eth_rx_adapter_stop_t eth_rx_adapter_stop; 111099a2dd95SBruce Richardson /**< Stop ethernet Rx adapter */ 111199a2dd95SBruce Richardson eventdev_eth_rx_adapter_stats_get eth_rx_adapter_stats_get; 111299a2dd95SBruce Richardson /**< Get ethernet Rx stats */ 111399a2dd95SBruce Richardson eventdev_eth_rx_adapter_stats_reset eth_rx_adapter_stats_reset; 111499a2dd95SBruce Richardson /**< Reset ethernet Rx stats */ 111599a2dd95SBruce Richardson eventdev_eth_rx_adapter_vector_limits_get_t 111699a2dd95SBruce Richardson eth_rx_adapter_vector_limits_get; 111799a2dd95SBruce Richardson /**< Get event vector limits for the Rx adapter */ 111899a2dd95SBruce Richardson 111999a2dd95SBruce Richardson eventdev_timer_adapter_caps_get_t timer_adapter_caps_get; 112099a2dd95SBruce Richardson /**< Get timer adapter capabilities */ 112199a2dd95SBruce Richardson 112299a2dd95SBruce Richardson eventdev_crypto_adapter_caps_get_t crypto_adapter_caps_get; 112399a2dd95SBruce Richardson /**< Get crypto adapter capabilities */ 112499a2dd95SBruce Richardson eventdev_crypto_adapter_queue_pair_add_t crypto_adapter_queue_pair_add; 112599a2dd95SBruce Richardson /**< Add queue pair to crypto adapter */ 112699a2dd95SBruce Richardson eventdev_crypto_adapter_queue_pair_del_t crypto_adapter_queue_pair_del; 112799a2dd95SBruce Richardson /**< Delete queue pair from crypto adapter */ 112899a2dd95SBruce Richardson eventdev_crypto_adapter_start_t crypto_adapter_start; 112999a2dd95SBruce Richardson /**< Start crypto adapter */ 113099a2dd95SBruce Richardson eventdev_crypto_adapter_stop_t crypto_adapter_stop; 113199a2dd95SBruce Richardson /**< Stop crypto adapter */ 113299a2dd95SBruce Richardson eventdev_crypto_adapter_stats_get crypto_adapter_stats_get; 113399a2dd95SBruce Richardson /**< Get crypto stats */ 113499a2dd95SBruce Richardson eventdev_crypto_adapter_stats_reset crypto_adapter_stats_reset; 113599a2dd95SBruce Richardson /**< Reset crypto stats */ 113699a2dd95SBruce Richardson 113799a2dd95SBruce Richardson eventdev_eth_tx_adapter_caps_get_t eth_tx_adapter_caps_get; 113899a2dd95SBruce Richardson /**< Get ethernet Tx adapter capabilities */ 113999a2dd95SBruce Richardson 114099a2dd95SBruce Richardson eventdev_eth_tx_adapter_create_t eth_tx_adapter_create; 114199a2dd95SBruce Richardson /**< Create adapter callback */ 114299a2dd95SBruce Richardson eventdev_eth_tx_adapter_free_t eth_tx_adapter_free; 114399a2dd95SBruce Richardson /**< Free adapter callback */ 114499a2dd95SBruce Richardson eventdev_eth_tx_adapter_queue_add_t eth_tx_adapter_queue_add; 114599a2dd95SBruce Richardson /**< Add Tx queues to the eth Tx adapter */ 114699a2dd95SBruce Richardson eventdev_eth_tx_adapter_queue_del_t eth_tx_adapter_queue_del; 114799a2dd95SBruce Richardson /**< Delete Tx queues from the eth Tx adapter */ 114899a2dd95SBruce Richardson eventdev_eth_tx_adapter_start_t eth_tx_adapter_start; 114999a2dd95SBruce Richardson /**< Start eth Tx adapter */ 115099a2dd95SBruce Richardson eventdev_eth_tx_adapter_stop_t eth_tx_adapter_stop; 115199a2dd95SBruce Richardson /**< Stop eth Tx adapter */ 115299a2dd95SBruce Richardson eventdev_eth_tx_adapter_stats_get_t eth_tx_adapter_stats_get; 115399a2dd95SBruce Richardson /**< Get eth Tx adapter statistics */ 115499a2dd95SBruce Richardson eventdev_eth_tx_adapter_stats_reset_t eth_tx_adapter_stats_reset; 115599a2dd95SBruce Richardson /**< Reset eth Tx adapter statistics */ 115699a2dd95SBruce Richardson 115799a2dd95SBruce Richardson eventdev_selftest dev_selftest; 115899a2dd95SBruce Richardson /**< Start eventdev Selftest */ 115999a2dd95SBruce Richardson 116099a2dd95SBruce Richardson eventdev_stop_flush_t dev_stop_flush; 116199a2dd95SBruce Richardson /**< User-provided event flush function */ 116299a2dd95SBruce Richardson }; 116399a2dd95SBruce Richardson 116499a2dd95SBruce Richardson /** 116599a2dd95SBruce Richardson * Allocates a new eventdev slot for an event device and returns the pointer 116699a2dd95SBruce Richardson * to that slot for the driver to use. 116799a2dd95SBruce Richardson * 116899a2dd95SBruce Richardson * @param name 116999a2dd95SBruce Richardson * Unique identifier name for each device 117099a2dd95SBruce Richardson * @param socket_id 117199a2dd95SBruce Richardson * Socket to allocate resources on. 117299a2dd95SBruce Richardson * @return 117399a2dd95SBruce Richardson * - Slot in the rte_dev_devices array for a new device; 117499a2dd95SBruce Richardson */ 117523d06e37SPavan Nikhilesh __rte_internal 117699a2dd95SBruce Richardson struct rte_eventdev * 117799a2dd95SBruce Richardson rte_event_pmd_allocate(const char *name, int socket_id); 117899a2dd95SBruce Richardson 117999a2dd95SBruce Richardson /** 118099a2dd95SBruce Richardson * Release the specified eventdev device. 118199a2dd95SBruce Richardson * 118299a2dd95SBruce Richardson * @param eventdev 118399a2dd95SBruce Richardson * The *eventdev* pointer is the address of the *rte_eventdev* structure. 118499a2dd95SBruce Richardson * @return 118599a2dd95SBruce Richardson * - 0 on success, negative on error 118699a2dd95SBruce Richardson */ 118723d06e37SPavan Nikhilesh __rte_internal 118899a2dd95SBruce Richardson int 118999a2dd95SBruce Richardson rte_event_pmd_release(struct rte_eventdev *eventdev); 119099a2dd95SBruce Richardson 1191*d35e6132SPavan Nikhilesh /** 1192*d35e6132SPavan Nikhilesh * 1193*d35e6132SPavan Nikhilesh * @internal 1194*d35e6132SPavan Nikhilesh * This is the last step of device probing. 1195*d35e6132SPavan Nikhilesh * It must be called after a port is allocated and initialized successfully. 1196*d35e6132SPavan Nikhilesh * 1197*d35e6132SPavan Nikhilesh * @param eventdev 1198*d35e6132SPavan Nikhilesh * New event device. 1199*d35e6132SPavan Nikhilesh */ 1200*d35e6132SPavan Nikhilesh __rte_internal 1201*d35e6132SPavan Nikhilesh void 1202*d35e6132SPavan Nikhilesh event_dev_probing_finish(struct rte_eventdev *eventdev); 1203*d35e6132SPavan Nikhilesh 1204*d35e6132SPavan Nikhilesh /** 1205*d35e6132SPavan Nikhilesh * Reset eventdevice fastpath APIs to dummy values. 1206*d35e6132SPavan Nikhilesh * 1207*d35e6132SPavan Nikhilesh * @param fp_ops 1208*d35e6132SPavan Nikhilesh * The *fp_ops* pointer to reset. 1209*d35e6132SPavan Nikhilesh */ 1210*d35e6132SPavan Nikhilesh __rte_internal 1211*d35e6132SPavan Nikhilesh void 1212*d35e6132SPavan Nikhilesh event_dev_fp_ops_reset(struct rte_event_fp_ops *fp_op); 1213*d35e6132SPavan Nikhilesh 1214*d35e6132SPavan Nikhilesh /** 1215*d35e6132SPavan Nikhilesh * Set eventdevice fastpath APIs to event device values. 1216*d35e6132SPavan Nikhilesh * 1217*d35e6132SPavan Nikhilesh * @param fp_ops 1218*d35e6132SPavan Nikhilesh * The *fp_ops* pointer to set. 1219*d35e6132SPavan Nikhilesh */ 1220*d35e6132SPavan Nikhilesh __rte_internal 1221*d35e6132SPavan Nikhilesh void 1222*d35e6132SPavan Nikhilesh event_dev_fp_ops_set(struct rte_event_fp_ops *fp_ops, 1223*d35e6132SPavan Nikhilesh const struct rte_eventdev *dev); 1224*d35e6132SPavan Nikhilesh 1225*d35e6132SPavan Nikhilesh #ifdef __cplusplus 1226*d35e6132SPavan Nikhilesh } 1227*d35e6132SPavan Nikhilesh #endif 1228*d35e6132SPavan Nikhilesh 122999a2dd95SBruce Richardson #endif /* _RTE_EVENTDEV_PMD_H_ */ 1230