1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2016 Cavium, Inc
5 #ifndef _RTE_EVENTDEV_PMD_H_
6 #define _RTE_EVENTDEV_PMD_H_
12 * These API are from event PMD only and user applications should not call
22 #include <rte_common.h>
23 #include <rte_compat.h>
24 #include <rte_config.h>
27 #include <rte_malloc.h>
29 #include <rte_mbuf_dyn.h>
31 #include "rte_eventdev.h"
32 #include "rte_event_timer_adapter_pmd.h"
35 #define RTE_EDEV_LOG_ERR(...) \
36 RTE_LOG(ERR, EVENTDEV, \
37 RTE_FMT("%s() line %u: " RTE_FMT_HEAD(__VA_ARGS__,) "\n", \
38 __func__, __LINE__, RTE_FMT_TAIL(__VA_ARGS__,)))
40 #ifdef RTE_LIBRTE_EVENTDEV_DEBUG
41 #define RTE_EDEV_LOG_DEBUG(...) \
42 RTE_LOG(DEBUG, EVENTDEV, \
43 RTE_FMT("%s() line %u: " RTE_FMT_HEAD(__VA_ARGS__,) "\n", \
44 __func__, __LINE__, RTE_FMT_TAIL(__VA_ARGS__,)))
46 #define RTE_EDEV_LOG_DEBUG(...) (void)0
49 /* Macros to check for valid device */
50 #define RTE_EVENTDEV_VALID_DEVID_OR_ERR_RET(dev_id, retval) do { \
51 if (!rte_event_pmd_is_valid_dev((dev_id))) { \
52 RTE_EDEV_LOG_ERR("Invalid dev_id=%d\n", dev_id); \
57 #define RTE_EVENTDEV_VALID_DEVID_OR_ERRNO_RET(dev_id, errno, retval) do { \
58 if (!rte_event_pmd_is_valid_dev((dev_id))) { \
59 RTE_EDEV_LOG_ERR("Invalid dev_id=%d\n", dev_id); \
65 #define RTE_EVENTDEV_VALID_DEVID_OR_RET(dev_id) do { \
66 if (!rte_event_pmd_is_valid_dev((dev_id))) { \
67 RTE_EDEV_LOG_ERR("Invalid dev_id=%d\n", dev_id); \
72 #define RTE_EVENT_ETH_RX_ADAPTER_SW_CAP \
73 ((RTE_EVENT_ETH_RX_ADAPTER_CAP_OVERRIDE_FLOW_ID) | \
74 (RTE_EVENT_ETH_RX_ADAPTER_CAP_MULTI_EVENTQ) | \
75 (RTE_EVENT_ETH_RX_ADAPTER_CAP_EVENT_VECTOR))
77 #define RTE_EVENT_CRYPTO_ADAPTER_SW_CAP \
78 RTE_EVENT_CRYPTO_ADAPTER_CAP_SESSION_PRIVATE_DATA
80 /**< Ethernet Rx adapter cap to return If the packet transfers from
81 * the ethdev to eventdev use a SW service function
84 #define RTE_EVENTDEV_DETACHED (0)
85 #define RTE_EVENTDEV_ATTACHED (1)
89 /** Global structure used for maintaining state of allocated event devices */
90 struct rte_eventdev_global {
91 uint8_t nb_devs; /**< Number of devices found */
94 extern struct rte_eventdev *rte_eventdevs;
95 /** The pool of rte_eventdev structures. */
98 * Get the rte_eventdev structure device pointer for the named device.
101 * device name to select the device structure.
104 * - The rte_eventdev structure pointer for the given device ID.
106 static inline struct rte_eventdev *
107 rte_event_pmd_get_named_dev(const char *name)
109 struct rte_eventdev *dev;
115 for (i = 0; i < RTE_EVENT_MAX_DEVS; i++) {
116 dev = &rte_eventdevs[i];
117 if ((dev->attached == RTE_EVENTDEV_ATTACHED) &&
118 (strcmp(dev->data->name, name) == 0))
126 * Validate if the event device index is valid attached event device.
129 * Event device index.
132 * - If the device index is valid (1) or not (0).
134 static inline unsigned
135 rte_event_pmd_is_valid_dev(uint8_t dev_id)
137 struct rte_eventdev *dev;
139 if (dev_id >= RTE_EVENT_MAX_DEVS)
142 dev = &rte_eventdevs[dev_id];
143 if (dev->attached != RTE_EVENTDEV_ATTACHED)
150 * Definitions of all functions exported by a driver through the
151 * the generic structure of type *event_dev_ops* supplied in the
152 * *rte_eventdev* structure associated with a device.
156 * Get device information of a device.
159 * Event device pointer
161 * Event device information structure
163 typedef void (*eventdev_info_get_t)(struct rte_eventdev *dev,
164 struct rte_event_dev_info *dev_info);
167 * Configure a device.
170 * Event device pointer
173 * Returns 0 on success
175 typedef int (*eventdev_configure_t)(const struct rte_eventdev *dev);
178 * Start a configured device.
181 * Event device pointer
184 * Returns 0 on success
186 typedef int (*eventdev_start_t)(struct rte_eventdev *dev);
189 * Stop a configured device.
192 * Event device pointer
194 typedef void (*eventdev_stop_t)(struct rte_eventdev *dev);
197 * Close a configured device.
200 * Event device pointer
204 * - (-EAGAIN) if can't close as device is busy
206 typedef int (*eventdev_close_t)(struct rte_eventdev *dev);
209 * Retrieve the default event queue configuration.
212 * Event device pointer
215 * @param[out] queue_conf
216 * Event queue configuration structure
219 typedef void (*eventdev_queue_default_conf_get_t)(struct rte_eventdev *dev,
220 uint8_t queue_id, struct rte_event_queue_conf *queue_conf);
223 * Setup an event queue.
226 * Event device pointer
230 * Event queue configuration structure
233 * Returns 0 on success.
235 typedef int (*eventdev_queue_setup_t)(struct rte_eventdev *dev,
237 const struct rte_event_queue_conf *queue_conf);
240 * Release resources allocated by given event queue.
243 * Event device pointer
248 typedef void (*eventdev_queue_release_t)(struct rte_eventdev *dev,
252 * Retrieve the default event port configuration.
255 * Event device pointer
258 * @param[out] port_conf
259 * Event port configuration structure
262 typedef void (*eventdev_port_default_conf_get_t)(struct rte_eventdev *dev,
263 uint8_t port_id, struct rte_event_port_conf *port_conf);
266 * Setup an event port.
269 * Event device pointer
273 * Event port configuration structure
276 * Returns 0 on success.
278 typedef int (*eventdev_port_setup_t)(struct rte_eventdev *dev,
280 const struct rte_event_port_conf *port_conf);
283 * Release memory resources allocated by given event port.
289 typedef void (*eventdev_port_release_t)(void *port);
292 * Link multiple source event queues to destination event port.
295 * Event device pointer
299 * Points to an array of *nb_links* event queues to be linked
302 * Points to an array of *nb_links* service priorities associated with each
303 * event queue link to event port.
305 * The number of links to establish
308 * Returns 0 on success.
311 typedef int (*eventdev_port_link_t)(struct rte_eventdev *dev, void *port,
312 const uint8_t queues[], const uint8_t priorities[],
316 * Unlink multiple source event queues from destination event port.
319 * Event device pointer
323 * An array of *nb_unlinks* event queues to be unlinked from the event port.
325 * The number of unlinks to establish
328 * Returns 0 on success.
331 typedef int (*eventdev_port_unlink_t)(struct rte_eventdev *dev, void *port,
332 uint8_t queues[], uint16_t nb_unlinks);
335 * Unlinks in progress. Returns number of unlinks that the PMD is currently
336 * performing, but have not yet been completed.
339 * Event device pointer
345 * Returns the number of in-progress unlinks. Zero is returned if none are
348 typedef int (*eventdev_port_unlinks_in_progress_t)(struct rte_eventdev *dev,
352 * Converts nanoseconds to *timeout_ticks* value for rte_event_dequeue()
355 * Event device pointer
357 * Wait time in nanosecond
358 * @param[out] timeout_ticks
359 * Value for the *timeout_ticks* parameter in rte_event_dequeue() function
362 * Returns 0 on success.
365 typedef int (*eventdev_dequeue_timeout_ticks_t)(struct rte_eventdev *dev,
366 uint64_t ns, uint64_t *timeout_ticks);
369 * Dump internal information
372 * Event device pointer
374 * A pointer to a file for output
377 typedef void (*eventdev_dump_t)(struct rte_eventdev *dev, FILE *f);
380 * Retrieve a set of statistics from device
383 * Event device pointer
385 * Level (device, port or queue)
386 * @param queue_port_id
387 * Queue or port number depending on mode
389 * The stat ids to retrieve
391 * The returned stat values
393 * The number of id values and entries in the values array
395 * The number of stat values successfully filled into the values array
397 typedef int (*eventdev_xstats_get_t)(const struct rte_eventdev *dev,
398 enum rte_event_dev_xstats_mode mode, uint8_t queue_port_id,
399 const unsigned int ids[], uint64_t values[], unsigned int n);
402 * Resets the statistic values in xstats for the device, based on mode.
404 typedef int (*eventdev_xstats_reset_t)(struct rte_eventdev *dev,
405 enum rte_event_dev_xstats_mode mode,
406 int16_t queue_port_id,
407 const uint32_t ids[],
411 * Get names of extended stats of an event device
414 * Event device pointer
416 * Level (device, port or queue)
417 * @param queue_port_id
418 * Queue or port number depending on mode
419 * @param xstats_names
420 * Array of name values to be filled in
422 * The stat ids to retrieve
424 * Number of values in the xstats_names array
426 * When size >= the number of stats, return the number of stat values filled
428 * When size < the number of available stats, return the number of stats
429 * values, and do not fill in any data into xstats_names.
431 typedef int (*eventdev_xstats_get_names_t)(const struct rte_eventdev *dev,
432 enum rte_event_dev_xstats_mode mode, uint8_t queue_port_id,
433 struct rte_event_dev_xstats_name *xstats_names,
434 unsigned int *ids, unsigned int size);
437 * Get value of one stats and optionally return its id
440 * Event device pointer
442 * The name of the stat to retrieve
444 * Pointer to an unsigned int where we store the stat-id for future reference.
445 * This pointer may be null if the id is not required.
447 * The value of the stat, or (uint64_t)-1 if the stat is not found.
448 * If the stat is not found, the id value will be returned as (unsigned)-1,
449 * if id pointer is non-NULL
451 typedef uint64_t (*eventdev_xstats_get_by_name)(const struct rte_eventdev *dev,
452 const char *name, unsigned int *id);
456 * Retrieve the event device's ethdev Rx adapter capabilities for the
457 * specified ethernet port
460 * Event device pointer
463 * Ethernet device pointer
466 * A pointer to memory filled with Rx event adapter capabilities.
469 * - 0: Success, driver provides Rx event adapter capabilities for the
471 * - <0: Error code returned by the driver function.
474 typedef int (*eventdev_eth_rx_adapter_caps_get_t)
475 (const struct rte_eventdev *dev,
476 const struct rte_eth_dev *eth_dev,
479 struct rte_event_eth_rx_adapter_queue_conf;
482 * Retrieve the event device's timer adapter capabilities, as well as the ops
483 * structure that an event timer adapter should call through to enter the
487 * Event device pointer
490 * Flags that can be used to determine how to select an event timer
491 * adapter ops structure
494 * A pointer to memory filled with Rx event adapter capabilities.
497 * A pointer to the ops pointer to set with the address of the desired ops
501 * - 0: Success, driver provides Rx event adapter capabilities for the
503 * - <0: Error code returned by the driver function.
506 typedef int (*eventdev_timer_adapter_caps_get_t)(
507 const struct rte_eventdev *dev,
510 const struct rte_event_timer_adapter_ops **ops);
513 * Add ethernet Rx queues to event device. This callback is invoked if
514 * the caps returned from rte_eventdev_eth_rx_adapter_caps_get(, eth_port_id)
515 * has RTE_EVENT_ETH_RX_ADAPTER_CAP_INTERNAL_PORT set.
518 * Event device pointer
521 * Ethernet device pointer
524 * Ethernet device receive queue index
527 * Additional configuration structure
530 * - 0: Success, ethernet receive queue added successfully.
531 * - <0: Error code returned by the driver function.
534 typedef int (*eventdev_eth_rx_adapter_queue_add_t)(
535 const struct rte_eventdev *dev,
536 const struct rte_eth_dev *eth_dev,
538 const struct rte_event_eth_rx_adapter_queue_conf *queue_conf);
541 * Delete ethernet Rx queues from event device. This callback is invoked if
542 * the caps returned from eventdev_eth_rx_adapter_caps_get(, eth_port_id)
543 * has RTE_EVENT_ETH_RX_ADAPTER_CAP_INTERNAL_PORT set.
546 * Event device pointer
549 * Ethernet device pointer
552 * Ethernet device receive queue index
555 * - 0: Success, ethernet receive queue deleted successfully.
556 * - <0: Error code returned by the driver function.
559 typedef int (*eventdev_eth_rx_adapter_queue_del_t)
560 (const struct rte_eventdev *dev,
561 const struct rte_eth_dev *eth_dev,
562 int32_t rx_queue_id);
565 * Start ethernet Rx adapter. This callback is invoked if
566 * the caps returned from eventdev_eth_rx_adapter_caps_get(.., eth_port_id)
567 * has RTE_EVENT_ETH_RX_ADAPTER_CAP_INTERNAL_PORT set and Rx queues
568 * from eth_port_id have been added to the event device.
571 * Event device pointer
574 * Ethernet device pointer
577 * - 0: Success, ethernet Rx adapter started successfully.
578 * - <0: Error code returned by the driver function.
580 typedef int (*eventdev_eth_rx_adapter_start_t)
581 (const struct rte_eventdev *dev,
582 const struct rte_eth_dev *eth_dev);
585 * Stop ethernet Rx adapter. This callback is invoked if
586 * the caps returned from eventdev_eth_rx_adapter_caps_get(..,eth_port_id)
587 * has RTE_EVENT_ETH_RX_ADAPTER_CAP_INTERNAL_PORT set and Rx queues
588 * from eth_port_id have been added to the event device.
591 * Event device pointer
594 * Ethernet device pointer
597 * - 0: Success, ethernet Rx adapter stopped successfully.
598 * - <0: Error code returned by the driver function.
600 typedef int (*eventdev_eth_rx_adapter_stop_t)
601 (const struct rte_eventdev *dev,
602 const struct rte_eth_dev *eth_dev);
604 struct rte_event_eth_rx_adapter_stats;
607 * Retrieve ethernet Rx adapter statistics.
610 * Event device pointer
613 * Ethernet device pointer
616 * Pointer to stats structure
619 * Return 0 on success.
622 typedef int (*eventdev_eth_rx_adapter_stats_get)
623 (const struct rte_eventdev *dev,
624 const struct rte_eth_dev *eth_dev,
625 struct rte_event_eth_rx_adapter_stats *stats);
627 * Reset ethernet Rx adapter statistics.
630 * Event device pointer
633 * Ethernet device pointer
636 * Return 0 on success.
638 typedef int (*eventdev_eth_rx_adapter_stats_reset)
639 (const struct rte_eventdev *dev,
640 const struct rte_eth_dev *eth_dev);
642 * Start eventdev selftest.
645 * Return 0 on success.
647 typedef int (*eventdev_selftest)(void);
649 struct rte_event_eth_rx_adapter_vector_limits;
651 * Get event vector limits for a given event, ethernet device pair.
654 * Event device pointer
657 * Ethernet device pointer
660 * Pointer to the limits structure to be filled.
664 * - <0: Error code returned by the driver function.
666 typedef int (*eventdev_eth_rx_adapter_vector_limits_get_t)(
667 const struct rte_eventdev *dev, const struct rte_eth_dev *eth_dev,
668 struct rte_event_eth_rx_adapter_vector_limits *limits);
670 struct rte_event_eth_rx_adapter_event_vector_config;
672 * Enable event vector on an given Rx queue of a ethernet devices belonging to
676 * Event device pointer
679 * Ethernet device pointer
682 * The Rx queue identifier
685 * Pointer to the event vector configuration structure.
689 * - <0: Error code returned by the driver function.
691 typedef int (*eventdev_eth_rx_adapter_event_vector_config_t)(
692 const struct rte_eventdev *dev, const struct rte_eth_dev *eth_dev,
694 const struct rte_event_eth_rx_adapter_event_vector_config *config);
696 typedef uint32_t rte_event_pmd_selftest_seqn_t;
697 extern int rte_event_pmd_selftest_seqn_dynfield_offset;
700 * Read test sequence number from mbuf.
702 * @param mbuf Structure to read from.
703 * @return pointer to test sequence number.
706 static inline rte_event_pmd_selftest_seqn_t *
707 rte_event_pmd_selftest_seqn(struct rte_mbuf *mbuf)
709 return RTE_MBUF_DYNFIELD(mbuf,
710 rte_event_pmd_selftest_seqn_dynfield_offset,
711 rte_event_pmd_selftest_seqn_t *);
714 struct rte_cryptodev;
717 * This API may change without prior notice
719 * Retrieve the event device's crypto adapter capabilities for the
720 * specified cryptodev
723 * Event device pointer
729 * A pointer to memory filled with event adapter capabilities.
730 * It is expected to be pre-allocated & initialized by caller.
733 * - 0: Success, driver provides event adapter capabilities for the
735 * - <0: Error code returned by the driver function.
738 typedef int (*eventdev_crypto_adapter_caps_get_t)
739 (const struct rte_eventdev *dev,
740 const struct rte_cryptodev *cdev,
744 * This API may change without prior notice
746 * Add crypto queue pair to event device. This callback is invoked if
747 * the caps returned from rte_event_crypto_adapter_caps_get(, cdev_id)
748 * has RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_* set.
751 * Event device pointer
756 * @param queue_pair_id
757 * cryptodev queue pair identifier.
760 * Event information required for binding cryptodev queue pair to event queue.
761 * This structure will have a valid value for only those HW PMDs supporting
762 * @see RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_QP_EV_BIND capability.
765 * - 0: Success, cryptodev queue pair added successfully.
766 * - <0: Error code returned by the driver function.
769 typedef int (*eventdev_crypto_adapter_queue_pair_add_t)
770 (const struct rte_eventdev *dev,
771 const struct rte_cryptodev *cdev,
772 int32_t queue_pair_id,
773 const struct rte_event *event);
777 * This API may change without prior notice
779 * Delete crypto queue pair to event device. This callback is invoked if
780 * the caps returned from rte_event_crypto_adapter_caps_get(, cdev_id)
781 * has RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_* set.
784 * Event device pointer
789 * @param queue_pair_id
790 * cryptodev queue pair identifier.
793 * - 0: Success, cryptodev queue pair deleted successfully.
794 * - <0: Error code returned by the driver function.
797 typedef int (*eventdev_crypto_adapter_queue_pair_del_t)
798 (const struct rte_eventdev *dev,
799 const struct rte_cryptodev *cdev,
800 int32_t queue_pair_id);
803 * Start crypto adapter. This callback is invoked if
804 * the caps returned from rte_event_crypto_adapter_caps_get(.., cdev_id)
805 * has RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_* set and queue pairs
806 * from cdev_id have been added to the event device.
809 * Event device pointer
812 * Crypto device pointer
815 * - 0: Success, crypto adapter started successfully.
816 * - <0: Error code returned by the driver function.
818 typedef int (*eventdev_crypto_adapter_start_t)
819 (const struct rte_eventdev *dev,
820 const struct rte_cryptodev *cdev);
823 * Stop crypto adapter. This callback is invoked if
824 * the caps returned from rte_event_crypto_adapter_caps_get(.., cdev_id)
825 * has RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_* set and queue pairs
826 * from cdev_id have been added to the event device.
829 * Event device pointer
832 * Crypto device pointer
835 * - 0: Success, crypto adapter stopped successfully.
836 * - <0: Error code returned by the driver function.
838 typedef int (*eventdev_crypto_adapter_stop_t)
839 (const struct rte_eventdev *dev,
840 const struct rte_cryptodev *cdev);
842 struct rte_event_crypto_adapter_stats;
845 * Retrieve crypto adapter statistics.
848 * Event device pointer
851 * Crypto device pointer
854 * Pointer to stats structure
857 * Return 0 on success.
860 typedef int (*eventdev_crypto_adapter_stats_get)
861 (const struct rte_eventdev *dev,
862 const struct rte_cryptodev *cdev,
863 struct rte_event_crypto_adapter_stats *stats);
866 * Reset crypto adapter statistics.
869 * Event device pointer
872 * Crypto device pointer
875 * Return 0 on success.
878 typedef int (*eventdev_crypto_adapter_stats_reset)
879 (const struct rte_eventdev *dev,
880 const struct rte_cryptodev *cdev);
883 * Retrieve the event device's eth Tx adapter capabilities.
886 * Event device pointer
889 * Ethernet device pointer
892 * A pointer to memory filled with eth Tx adapter capabilities.
895 * - 0: Success, driver provides eth Tx adapter capabilities
896 * - <0: Error code returned by the driver function.
899 typedef int (*eventdev_eth_tx_adapter_caps_get_t)
900 (const struct rte_eventdev *dev,
901 const struct rte_eth_dev *eth_dev,
905 * Create adapter callback.
911 * Event device pointer
915 * - <0: Error code on failure.
917 typedef int (*eventdev_eth_tx_adapter_create_t)(uint8_t id,
918 const struct rte_eventdev *dev);
921 * Free adapter callback.
927 * Event device pointer
931 * - <0: Error code on failure.
933 typedef int (*eventdev_eth_tx_adapter_free_t)(uint8_t id,
934 const struct rte_eventdev *dev);
937 * Add a Tx queue to the adapter.
938 * A queue value of -1 is used to indicate all
939 * queues within the device.
945 * Event device pointer
948 * Ethernet device pointer
951 * Transmit queue index
955 * - <0: Error code on failure.
957 typedef int (*eventdev_eth_tx_adapter_queue_add_t)(
959 const struct rte_eventdev *dev,
960 const struct rte_eth_dev *eth_dev,
961 int32_t tx_queue_id);
964 * Delete a Tx queue from the adapter.
965 * A queue value of -1 is used to indicate all
966 * queues within the device, that have been added to this
973 * Event device pointer
976 * Ethernet device pointer
979 * Transmit queue index
982 * - 0: Success, Queues deleted successfully.
983 * - <0: Error code on failure.
985 typedef int (*eventdev_eth_tx_adapter_queue_del_t)(
987 const struct rte_eventdev *dev,
988 const struct rte_eth_dev *eth_dev,
989 int32_t tx_queue_id);
998 * Event device pointer
1001 * - 0: Success, Adapter started correctly.
1002 * - <0: Error code on failure.
1004 typedef int (*eventdev_eth_tx_adapter_start_t)(uint8_t id,
1005 const struct rte_eventdev *dev);
1011 * Adapter identifier
1014 * Event device pointer
1018 * - <0: Error code on failure.
1020 typedef int (*eventdev_eth_tx_adapter_stop_t)(uint8_t id,
1021 const struct rte_eventdev *dev);
1023 struct rte_event_eth_tx_adapter_stats;
1026 * Retrieve statistics for an adapter
1029 * Adapter identifier
1032 * Event device pointer
1034 * @param [out] stats
1035 * A pointer to structure used to retrieve statistics for an adapter
1038 * - 0: Success, statistics retrieved successfully.
1039 * - <0: Error code on failure.
1041 typedef int (*eventdev_eth_tx_adapter_stats_get_t)(
1043 const struct rte_eventdev *dev,
1044 struct rte_event_eth_tx_adapter_stats *stats);
1047 * Reset statistics for an adapter
1050 * Adapter identifier
1053 * Event device pointer
1056 * - 0: Success, statistics retrieved successfully.
1057 * - <0: Error code on failure.
1059 typedef int (*eventdev_eth_tx_adapter_stats_reset_t)(uint8_t id,
1060 const struct rte_eventdev *dev);
1062 /** Event device operations function pointer table */
1063 struct rte_eventdev_ops {
1064 eventdev_info_get_t dev_infos_get; /**< Get device info. */
1065 eventdev_configure_t dev_configure; /**< Configure device. */
1066 eventdev_start_t dev_start; /**< Start device. */
1067 eventdev_stop_t dev_stop; /**< Stop device. */
1068 eventdev_close_t dev_close; /**< Close device. */
1070 eventdev_queue_default_conf_get_t queue_def_conf;
1071 /**< Get default queue configuration. */
1072 eventdev_queue_setup_t queue_setup;
1073 /**< Set up an event queue. */
1074 eventdev_queue_release_t queue_release;
1075 /**< Release an event queue. */
1077 eventdev_port_default_conf_get_t port_def_conf;
1078 /**< Get default port configuration. */
1079 eventdev_port_setup_t port_setup;
1080 /**< Set up an event port. */
1081 eventdev_port_release_t port_release;
1082 /**< Release an event port. */
1084 eventdev_port_link_t port_link;
1085 /**< Link event queues to an event port. */
1086 eventdev_port_unlink_t port_unlink;
1087 /**< Unlink event queues from an event port. */
1088 eventdev_port_unlinks_in_progress_t port_unlinks_in_progress;
1089 /**< Unlinks in progress on an event port. */
1090 eventdev_dequeue_timeout_ticks_t timeout_ticks;
1091 /**< Converts ns to *timeout_ticks* value for rte_event_dequeue() */
1092 eventdev_dump_t dump;
1093 /* Dump internal information */
1095 eventdev_xstats_get_t xstats_get;
1096 /**< Get extended device statistics. */
1097 eventdev_xstats_get_names_t xstats_get_names;
1098 /**< Get names of extended stats. */
1099 eventdev_xstats_get_by_name xstats_get_by_name;
1100 /**< Get one value by name. */
1101 eventdev_xstats_reset_t xstats_reset;
1102 /**< Reset the statistics values in xstats. */
1104 eventdev_eth_rx_adapter_caps_get_t eth_rx_adapter_caps_get;
1105 /**< Get ethernet Rx adapter capabilities */
1106 eventdev_eth_rx_adapter_queue_add_t eth_rx_adapter_queue_add;
1107 /**< Add Rx queues to ethernet Rx adapter */
1108 eventdev_eth_rx_adapter_queue_del_t eth_rx_adapter_queue_del;
1109 /**< Delete Rx queues from ethernet Rx adapter */
1110 eventdev_eth_rx_adapter_start_t eth_rx_adapter_start;
1111 /**< Start ethernet Rx adapter */
1112 eventdev_eth_rx_adapter_stop_t eth_rx_adapter_stop;
1113 /**< Stop ethernet Rx adapter */
1114 eventdev_eth_rx_adapter_stats_get eth_rx_adapter_stats_get;
1115 /**< Get ethernet Rx stats */
1116 eventdev_eth_rx_adapter_stats_reset eth_rx_adapter_stats_reset;
1117 /**< Reset ethernet Rx stats */
1118 eventdev_eth_rx_adapter_vector_limits_get_t
1119 eth_rx_adapter_vector_limits_get;
1120 /**< Get event vector limits for the Rx adapter */
1121 eventdev_eth_rx_adapter_event_vector_config_t
1122 eth_rx_adapter_event_vector_config;
1123 /**< Configure Rx adapter with event vector */
1125 eventdev_timer_adapter_caps_get_t timer_adapter_caps_get;
1126 /**< Get timer adapter capabilities */
1128 eventdev_crypto_adapter_caps_get_t crypto_adapter_caps_get;
1129 /**< Get crypto adapter capabilities */
1130 eventdev_crypto_adapter_queue_pair_add_t crypto_adapter_queue_pair_add;
1131 /**< Add queue pair to crypto adapter */
1132 eventdev_crypto_adapter_queue_pair_del_t crypto_adapter_queue_pair_del;
1133 /**< Delete queue pair from crypto adapter */
1134 eventdev_crypto_adapter_start_t crypto_adapter_start;
1135 /**< Start crypto adapter */
1136 eventdev_crypto_adapter_stop_t crypto_adapter_stop;
1137 /**< Stop crypto adapter */
1138 eventdev_crypto_adapter_stats_get crypto_adapter_stats_get;
1139 /**< Get crypto stats */
1140 eventdev_crypto_adapter_stats_reset crypto_adapter_stats_reset;
1141 /**< Reset crypto stats */
1143 eventdev_eth_tx_adapter_caps_get_t eth_tx_adapter_caps_get;
1144 /**< Get ethernet Tx adapter capabilities */
1146 eventdev_eth_tx_adapter_create_t eth_tx_adapter_create;
1147 /**< Create adapter callback */
1148 eventdev_eth_tx_adapter_free_t eth_tx_adapter_free;
1149 /**< Free adapter callback */
1150 eventdev_eth_tx_adapter_queue_add_t eth_tx_adapter_queue_add;
1151 /**< Add Tx queues to the eth Tx adapter */
1152 eventdev_eth_tx_adapter_queue_del_t eth_tx_adapter_queue_del;
1153 /**< Delete Tx queues from the eth Tx adapter */
1154 eventdev_eth_tx_adapter_start_t eth_tx_adapter_start;
1155 /**< Start eth Tx adapter */
1156 eventdev_eth_tx_adapter_stop_t eth_tx_adapter_stop;
1157 /**< Stop eth Tx adapter */
1158 eventdev_eth_tx_adapter_stats_get_t eth_tx_adapter_stats_get;
1159 /**< Get eth Tx adapter statistics */
1160 eventdev_eth_tx_adapter_stats_reset_t eth_tx_adapter_stats_reset;
1161 /**< Reset eth Tx adapter statistics */
1163 eventdev_selftest dev_selftest;
1164 /**< Start eventdev Selftest */
1166 eventdev_stop_flush_t dev_stop_flush;
1167 /**< User-provided event flush function */
1171 * Allocates a new eventdev slot for an event device and returns the pointer
1172 * to that slot for the driver to use.
1175 * Unique identifier name for each device
1177 * Socket to allocate resources on.
1179 * - Slot in the rte_dev_devices array for a new device;
1181 struct rte_eventdev *
1182 rte_event_pmd_allocate(const char *name, int socket_id);
1185 * Release the specified eventdev device.
1188 * The *eventdev* pointer is the address of the *rte_eventdev* structure.
1190 * - 0 on success, negative on error
1193 rte_event_pmd_release(struct rte_eventdev *eventdev);
1199 #endif /* _RTE_EVENTDEV_PMD_H_ */