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))
76 #define RTE_EVENT_CRYPTO_ADAPTER_SW_CAP \
77 RTE_EVENT_CRYPTO_ADAPTER_CAP_SESSION_PRIVATE_DATA
79 /**< Ethernet Rx adapter cap to return If the packet transfers from
80 * the ethdev to eventdev use a SW service function
83 #define RTE_EVENTDEV_DETACHED (0)
84 #define RTE_EVENTDEV_ATTACHED (1)
88 /** Global structure used for maintaining state of allocated event devices */
89 struct rte_eventdev_global {
90 uint8_t nb_devs; /**< Number of devices found */
93 extern struct rte_eventdev *rte_eventdevs;
94 /** The pool of rte_eventdev structures. */
97 * Get the rte_eventdev structure device pointer for the named device.
100 * device name to select the device structure.
103 * - The rte_eventdev structure pointer for the given device ID.
105 static inline struct rte_eventdev *
106 rte_event_pmd_get_named_dev(const char *name)
108 struct rte_eventdev *dev;
114 for (i = 0; i < RTE_EVENT_MAX_DEVS; i++) {
115 dev = &rte_eventdevs[i];
116 if ((dev->attached == RTE_EVENTDEV_ATTACHED) &&
117 (strcmp(dev->data->name, name) == 0))
125 * Validate if the event device index is valid attached event device.
128 * Event device index.
131 * - If the device index is valid (1) or not (0).
133 static inline unsigned
134 rte_event_pmd_is_valid_dev(uint8_t dev_id)
136 struct rte_eventdev *dev;
138 if (dev_id >= RTE_EVENT_MAX_DEVS)
141 dev = &rte_eventdevs[dev_id];
142 if (dev->attached != RTE_EVENTDEV_ATTACHED)
149 * Definitions of all functions exported by a driver through the
150 * the generic structure of type *event_dev_ops* supplied in the
151 * *rte_eventdev* structure associated with a device.
155 * Get device information of a device.
158 * Event device pointer
160 * Event device information structure
162 typedef void (*eventdev_info_get_t)(struct rte_eventdev *dev,
163 struct rte_event_dev_info *dev_info);
166 * Configure a device.
169 * Event device pointer
172 * Returns 0 on success
174 typedef int (*eventdev_configure_t)(const struct rte_eventdev *dev);
177 * Start a configured device.
180 * Event device pointer
183 * Returns 0 on success
185 typedef int (*eventdev_start_t)(struct rte_eventdev *dev);
188 * Stop a configured device.
191 * Event device pointer
193 typedef void (*eventdev_stop_t)(struct rte_eventdev *dev);
196 * Close a configured device.
199 * Event device pointer
203 * - (-EAGAIN) if can't close as device is busy
205 typedef int (*eventdev_close_t)(struct rte_eventdev *dev);
208 * Retrieve the default event queue configuration.
211 * Event device pointer
214 * @param[out] queue_conf
215 * Event queue configuration structure
218 typedef void (*eventdev_queue_default_conf_get_t)(struct rte_eventdev *dev,
219 uint8_t queue_id, struct rte_event_queue_conf *queue_conf);
222 * Setup an event queue.
225 * Event device pointer
229 * Event queue configuration structure
232 * Returns 0 on success.
234 typedef int (*eventdev_queue_setup_t)(struct rte_eventdev *dev,
236 const struct rte_event_queue_conf *queue_conf);
239 * Release resources allocated by given event queue.
242 * Event device pointer
247 typedef void (*eventdev_queue_release_t)(struct rte_eventdev *dev,
251 * Retrieve the default event port configuration.
254 * Event device pointer
257 * @param[out] port_conf
258 * Event port configuration structure
261 typedef void (*eventdev_port_default_conf_get_t)(struct rte_eventdev *dev,
262 uint8_t port_id, struct rte_event_port_conf *port_conf);
265 * Setup an event port.
268 * Event device pointer
272 * Event port configuration structure
275 * Returns 0 on success.
277 typedef int (*eventdev_port_setup_t)(struct rte_eventdev *dev,
279 const struct rte_event_port_conf *port_conf);
282 * Release memory resources allocated by given event port.
288 typedef void (*eventdev_port_release_t)(void *port);
291 * Link multiple source event queues to destination event port.
294 * Event device pointer
298 * Points to an array of *nb_links* event queues to be linked
301 * Points to an array of *nb_links* service priorities associated with each
302 * event queue link to event port.
304 * The number of links to establish
307 * Returns 0 on success.
310 typedef int (*eventdev_port_link_t)(struct rte_eventdev *dev, void *port,
311 const uint8_t queues[], const uint8_t priorities[],
315 * Unlink multiple source event queues from destination event port.
318 * Event device pointer
322 * An array of *nb_unlinks* event queues to be unlinked from the event port.
324 * The number of unlinks to establish
327 * Returns 0 on success.
330 typedef int (*eventdev_port_unlink_t)(struct rte_eventdev *dev, void *port,
331 uint8_t queues[], uint16_t nb_unlinks);
334 * Unlinks in progress. Returns number of unlinks that the PMD is currently
335 * performing, but have not yet been completed.
338 * Event device pointer
344 * Returns the number of in-progress unlinks. Zero is returned if none are
347 typedef int (*eventdev_port_unlinks_in_progress_t)(struct rte_eventdev *dev,
351 * Converts nanoseconds to *timeout_ticks* value for rte_event_dequeue()
354 * Event device pointer
356 * Wait time in nanosecond
357 * @param[out] timeout_ticks
358 * Value for the *timeout_ticks* parameter in rte_event_dequeue() function
361 * Returns 0 on success.
364 typedef int (*eventdev_dequeue_timeout_ticks_t)(struct rte_eventdev *dev,
365 uint64_t ns, uint64_t *timeout_ticks);
368 * Dump internal information
371 * Event device pointer
373 * A pointer to a file for output
376 typedef void (*eventdev_dump_t)(struct rte_eventdev *dev, FILE *f);
379 * Retrieve a set of statistics from device
382 * Event device pointer
384 * Level (device, port or queue)
385 * @param queue_port_id
386 * Queue or port number depending on mode
388 * The stat ids to retrieve
390 * The returned stat values
392 * The number of id values and entries in the values array
394 * The number of stat values successfully filled into the values array
396 typedef int (*eventdev_xstats_get_t)(const struct rte_eventdev *dev,
397 enum rte_event_dev_xstats_mode mode, uint8_t queue_port_id,
398 const unsigned int ids[], uint64_t values[], unsigned int n);
401 * Resets the statistic values in xstats for the device, based on mode.
403 typedef int (*eventdev_xstats_reset_t)(struct rte_eventdev *dev,
404 enum rte_event_dev_xstats_mode mode,
405 int16_t queue_port_id,
406 const uint32_t ids[],
410 * Get names of extended stats of an event device
413 * Event device pointer
415 * Level (device, port or queue)
416 * @param queue_port_id
417 * Queue or port number depending on mode
418 * @param xstats_names
419 * Array of name values to be filled in
421 * The stat ids to retrieve
423 * Number of values in the xstats_names array
425 * When size >= the number of stats, return the number of stat values filled
427 * When size < the number of available stats, return the number of stats
428 * values, and do not fill in any data into xstats_names.
430 typedef int (*eventdev_xstats_get_names_t)(const struct rte_eventdev *dev,
431 enum rte_event_dev_xstats_mode mode, uint8_t queue_port_id,
432 struct rte_event_dev_xstats_name *xstats_names,
433 unsigned int *ids, unsigned int size);
436 * Get value of one stats and optionally return its id
439 * Event device pointer
441 * The name of the stat to retrieve
443 * Pointer to an unsigned int where we store the stat-id for future reference.
444 * This pointer may be null if the id is not required.
446 * The value of the stat, or (uint64_t)-1 if the stat is not found.
447 * If the stat is not found, the id value will be returned as (unsigned)-1,
448 * if id pointer is non-NULL
450 typedef uint64_t (*eventdev_xstats_get_by_name)(const struct rte_eventdev *dev,
451 const char *name, unsigned int *id);
455 * Retrieve the event device's ethdev Rx adapter capabilities for the
456 * specified ethernet port
459 * Event device pointer
462 * Ethernet device pointer
465 * A pointer to memory filled with Rx event adapter capabilities.
468 * - 0: Success, driver provides Rx event adapter capabilities for the
470 * - <0: Error code returned by the driver function.
473 typedef int (*eventdev_eth_rx_adapter_caps_get_t)
474 (const struct rte_eventdev *dev,
475 const struct rte_eth_dev *eth_dev,
478 struct rte_event_eth_rx_adapter_queue_conf;
481 * Retrieve the event device's timer adapter capabilities, as well as the ops
482 * structure that an event timer adapter should call through to enter the
486 * Event device pointer
489 * Flags that can be used to determine how to select an event timer
490 * adapter ops structure
493 * A pointer to memory filled with Rx event adapter capabilities.
496 * A pointer to the ops pointer to set with the address of the desired ops
500 * - 0: Success, driver provides Rx event adapter capabilities for the
502 * - <0: Error code returned by the driver function.
505 typedef int (*eventdev_timer_adapter_caps_get_t)(
506 const struct rte_eventdev *dev,
509 const struct rte_event_timer_adapter_ops **ops);
512 * Add ethernet Rx queues to event device. This callback is invoked if
513 * the caps returned from rte_eventdev_eth_rx_adapter_caps_get(, eth_port_id)
514 * has RTE_EVENT_ETH_RX_ADAPTER_CAP_INTERNAL_PORT set.
517 * Event device pointer
520 * Ethernet device pointer
523 * Ethernet device receive queue index
526 * Additional configuration structure
529 * - 0: Success, ethernet receive queue added successfully.
530 * - <0: Error code returned by the driver function.
533 typedef int (*eventdev_eth_rx_adapter_queue_add_t)(
534 const struct rte_eventdev *dev,
535 const struct rte_eth_dev *eth_dev,
537 const struct rte_event_eth_rx_adapter_queue_conf *queue_conf);
540 * Delete ethernet Rx queues from event device. This callback is invoked if
541 * the caps returned from eventdev_eth_rx_adapter_caps_get(, eth_port_id)
542 * has RTE_EVENT_ETH_RX_ADAPTER_CAP_INTERNAL_PORT set.
545 * Event device pointer
548 * Ethernet device pointer
551 * Ethernet device receive queue index
554 * - 0: Success, ethernet receive queue deleted successfully.
555 * - <0: Error code returned by the driver function.
558 typedef int (*eventdev_eth_rx_adapter_queue_del_t)
559 (const struct rte_eventdev *dev,
560 const struct rte_eth_dev *eth_dev,
561 int32_t rx_queue_id);
564 * Start ethernet Rx adapter. This callback is invoked if
565 * the caps returned from eventdev_eth_rx_adapter_caps_get(.., eth_port_id)
566 * has RTE_EVENT_ETH_RX_ADAPTER_CAP_INTERNAL_PORT set and Rx queues
567 * from eth_port_id have been added to the event device.
570 * Event device pointer
573 * Ethernet device pointer
576 * - 0: Success, ethernet Rx adapter started successfully.
577 * - <0: Error code returned by the driver function.
579 typedef int (*eventdev_eth_rx_adapter_start_t)
580 (const struct rte_eventdev *dev,
581 const struct rte_eth_dev *eth_dev);
584 * Stop ethernet Rx adapter. This callback is invoked if
585 * the caps returned from eventdev_eth_rx_adapter_caps_get(..,eth_port_id)
586 * has RTE_EVENT_ETH_RX_ADAPTER_CAP_INTERNAL_PORT set and Rx queues
587 * from eth_port_id have been added to the event device.
590 * Event device pointer
593 * Ethernet device pointer
596 * - 0: Success, ethernet Rx adapter stopped successfully.
597 * - <0: Error code returned by the driver function.
599 typedef int (*eventdev_eth_rx_adapter_stop_t)
600 (const struct rte_eventdev *dev,
601 const struct rte_eth_dev *eth_dev);
603 struct rte_event_eth_rx_adapter_stats;
606 * Retrieve ethernet Rx adapter statistics.
609 * Event device pointer
612 * Ethernet device pointer
615 * Pointer to stats structure
618 * Return 0 on success.
621 typedef int (*eventdev_eth_rx_adapter_stats_get)
622 (const struct rte_eventdev *dev,
623 const struct rte_eth_dev *eth_dev,
624 struct rte_event_eth_rx_adapter_stats *stats);
626 * Reset ethernet Rx adapter statistics.
629 * Event device pointer
632 * Ethernet device pointer
635 * Return 0 on success.
637 typedef int (*eventdev_eth_rx_adapter_stats_reset)
638 (const struct rte_eventdev *dev,
639 const struct rte_eth_dev *eth_dev);
641 * Start eventdev selftest.
644 * Return 0 on success.
646 typedef int (*eventdev_selftest)(void);
648 typedef uint32_t rte_event_pmd_selftest_seqn_t;
649 extern int rte_event_pmd_selftest_seqn_dynfield_offset;
652 * Read test sequence number from mbuf.
654 * @param mbuf Structure to read from.
655 * @return pointer to test sequence number.
658 static inline rte_event_pmd_selftest_seqn_t *
659 rte_event_pmd_selftest_seqn(struct rte_mbuf *mbuf)
661 return RTE_MBUF_DYNFIELD(mbuf,
662 rte_event_pmd_selftest_seqn_dynfield_offset,
663 rte_event_pmd_selftest_seqn_t *);
666 struct rte_cryptodev;
669 * This API may change without prior notice
671 * Retrieve the event device's crypto adapter capabilities for the
672 * specified cryptodev
675 * Event device pointer
681 * A pointer to memory filled with event adapter capabilities.
682 * It is expected to be pre-allocated & initialized by caller.
685 * - 0: Success, driver provides event adapter capabilities for the
687 * - <0: Error code returned by the driver function.
690 typedef int (*eventdev_crypto_adapter_caps_get_t)
691 (const struct rte_eventdev *dev,
692 const struct rte_cryptodev *cdev,
696 * This API may change without prior notice
698 * Add crypto queue pair to event device. This callback is invoked if
699 * the caps returned from rte_event_crypto_adapter_caps_get(, cdev_id)
700 * has RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_* set.
703 * Event device pointer
708 * @param queue_pair_id
709 * cryptodev queue pair identifier.
712 * Event information required for binding cryptodev queue pair to event queue.
713 * This structure will have a valid value for only those HW PMDs supporting
714 * @see RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_QP_EV_BIND capability.
717 * - 0: Success, cryptodev queue pair added successfully.
718 * - <0: Error code returned by the driver function.
721 typedef int (*eventdev_crypto_adapter_queue_pair_add_t)
722 (const struct rte_eventdev *dev,
723 const struct rte_cryptodev *cdev,
724 int32_t queue_pair_id,
725 const struct rte_event *event);
729 * This API may change without prior notice
731 * Delete crypto queue pair to event device. This callback is invoked if
732 * the caps returned from rte_event_crypto_adapter_caps_get(, cdev_id)
733 * has RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_* set.
736 * Event device pointer
741 * @param queue_pair_id
742 * cryptodev queue pair identifier.
745 * - 0: Success, cryptodev queue pair deleted successfully.
746 * - <0: Error code returned by the driver function.
749 typedef int (*eventdev_crypto_adapter_queue_pair_del_t)
750 (const struct rte_eventdev *dev,
751 const struct rte_cryptodev *cdev,
752 int32_t queue_pair_id);
755 * Start crypto adapter. This callback is invoked if
756 * the caps returned from rte_event_crypto_adapter_caps_get(.., cdev_id)
757 * has RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_* set and queue pairs
758 * from cdev_id have been added to the event device.
761 * Event device pointer
764 * Crypto device pointer
767 * - 0: Success, crypto adapter started successfully.
768 * - <0: Error code returned by the driver function.
770 typedef int (*eventdev_crypto_adapter_start_t)
771 (const struct rte_eventdev *dev,
772 const struct rte_cryptodev *cdev);
775 * Stop crypto adapter. This callback is invoked if
776 * the caps returned from rte_event_crypto_adapter_caps_get(.., cdev_id)
777 * has RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_* set and queue pairs
778 * from cdev_id have been added to the event device.
781 * Event device pointer
784 * Crypto device pointer
787 * - 0: Success, crypto adapter stopped successfully.
788 * - <0: Error code returned by the driver function.
790 typedef int (*eventdev_crypto_adapter_stop_t)
791 (const struct rte_eventdev *dev,
792 const struct rte_cryptodev *cdev);
794 struct rte_event_crypto_adapter_stats;
797 * Retrieve crypto adapter statistics.
800 * Event device pointer
803 * Crypto device pointer
806 * Pointer to stats structure
809 * Return 0 on success.
812 typedef int (*eventdev_crypto_adapter_stats_get)
813 (const struct rte_eventdev *dev,
814 const struct rte_cryptodev *cdev,
815 struct rte_event_crypto_adapter_stats *stats);
818 * Reset crypto adapter statistics.
821 * Event device pointer
824 * Crypto device pointer
827 * Return 0 on success.
830 typedef int (*eventdev_crypto_adapter_stats_reset)
831 (const struct rte_eventdev *dev,
832 const struct rte_cryptodev *cdev);
835 * Retrieve the event device's eth Tx adapter capabilities.
838 * Event device pointer
841 * Ethernet device pointer
844 * A pointer to memory filled with eth Tx adapter capabilities.
847 * - 0: Success, driver provides eth Tx adapter capabilities
848 * - <0: Error code returned by the driver function.
851 typedef int (*eventdev_eth_tx_adapter_caps_get_t)
852 (const struct rte_eventdev *dev,
853 const struct rte_eth_dev *eth_dev,
857 * Create adapter callback.
863 * Event device pointer
867 * - <0: Error code on failure.
869 typedef int (*eventdev_eth_tx_adapter_create_t)(uint8_t id,
870 const struct rte_eventdev *dev);
873 * Free adapter callback.
879 * Event device pointer
883 * - <0: Error code on failure.
885 typedef int (*eventdev_eth_tx_adapter_free_t)(uint8_t id,
886 const struct rte_eventdev *dev);
889 * Add a Tx queue to the adapter.
890 * A queue value of -1 is used to indicate all
891 * queues within the device.
897 * Event device pointer
900 * Ethernet device pointer
903 * Transmit queue index
907 * - <0: Error code on failure.
909 typedef int (*eventdev_eth_tx_adapter_queue_add_t)(
911 const struct rte_eventdev *dev,
912 const struct rte_eth_dev *eth_dev,
913 int32_t tx_queue_id);
916 * Delete a Tx queue from the adapter.
917 * A queue value of -1 is used to indicate all
918 * queues within the device, that have been added to this
925 * Event device pointer
928 * Ethernet device pointer
931 * Transmit queue index
934 * - 0: Success, Queues deleted successfully.
935 * - <0: Error code on failure.
937 typedef int (*eventdev_eth_tx_adapter_queue_del_t)(
939 const struct rte_eventdev *dev,
940 const struct rte_eth_dev *eth_dev,
941 int32_t tx_queue_id);
950 * Event device pointer
953 * - 0: Success, Adapter started correctly.
954 * - <0: Error code on failure.
956 typedef int (*eventdev_eth_tx_adapter_start_t)(uint8_t id,
957 const struct rte_eventdev *dev);
966 * Event device pointer
970 * - <0: Error code on failure.
972 typedef int (*eventdev_eth_tx_adapter_stop_t)(uint8_t id,
973 const struct rte_eventdev *dev);
975 struct rte_event_eth_tx_adapter_stats;
978 * Retrieve statistics for an adapter
984 * Event device pointer
987 * A pointer to structure used to retrieve statistics for an adapter
990 * - 0: Success, statistics retrieved successfully.
991 * - <0: Error code on failure.
993 typedef int (*eventdev_eth_tx_adapter_stats_get_t)(
995 const struct rte_eventdev *dev,
996 struct rte_event_eth_tx_adapter_stats *stats);
999 * Reset statistics for an adapter
1002 * Adapter identifier
1005 * Event device pointer
1008 * - 0: Success, statistics retrieved successfully.
1009 * - <0: Error code on failure.
1011 typedef int (*eventdev_eth_tx_adapter_stats_reset_t)(uint8_t id,
1012 const struct rte_eventdev *dev);
1014 /** Event device operations function pointer table */
1015 struct rte_eventdev_ops {
1016 eventdev_info_get_t dev_infos_get; /**< Get device info. */
1017 eventdev_configure_t dev_configure; /**< Configure device. */
1018 eventdev_start_t dev_start; /**< Start device. */
1019 eventdev_stop_t dev_stop; /**< Stop device. */
1020 eventdev_close_t dev_close; /**< Close device. */
1022 eventdev_queue_default_conf_get_t queue_def_conf;
1023 /**< Get default queue configuration. */
1024 eventdev_queue_setup_t queue_setup;
1025 /**< Set up an event queue. */
1026 eventdev_queue_release_t queue_release;
1027 /**< Release an event queue. */
1029 eventdev_port_default_conf_get_t port_def_conf;
1030 /**< Get default port configuration. */
1031 eventdev_port_setup_t port_setup;
1032 /**< Set up an event port. */
1033 eventdev_port_release_t port_release;
1034 /**< Release an event port. */
1036 eventdev_port_link_t port_link;
1037 /**< Link event queues to an event port. */
1038 eventdev_port_unlink_t port_unlink;
1039 /**< Unlink event queues from an event port. */
1040 eventdev_port_unlinks_in_progress_t port_unlinks_in_progress;
1041 /**< Unlinks in progress on an event port. */
1042 eventdev_dequeue_timeout_ticks_t timeout_ticks;
1043 /**< Converts ns to *timeout_ticks* value for rte_event_dequeue() */
1044 eventdev_dump_t dump;
1045 /* Dump internal information */
1047 eventdev_xstats_get_t xstats_get;
1048 /**< Get extended device statistics. */
1049 eventdev_xstats_get_names_t xstats_get_names;
1050 /**< Get names of extended stats. */
1051 eventdev_xstats_get_by_name xstats_get_by_name;
1052 /**< Get one value by name. */
1053 eventdev_xstats_reset_t xstats_reset;
1054 /**< Reset the statistics values in xstats. */
1056 eventdev_eth_rx_adapter_caps_get_t eth_rx_adapter_caps_get;
1057 /**< Get ethernet Rx adapter capabilities */
1058 eventdev_eth_rx_adapter_queue_add_t eth_rx_adapter_queue_add;
1059 /**< Add Rx queues to ethernet Rx adapter */
1060 eventdev_eth_rx_adapter_queue_del_t eth_rx_adapter_queue_del;
1061 /**< Delete Rx queues from ethernet Rx adapter */
1062 eventdev_eth_rx_adapter_start_t eth_rx_adapter_start;
1063 /**< Start ethernet Rx adapter */
1064 eventdev_eth_rx_adapter_stop_t eth_rx_adapter_stop;
1065 /**< Stop ethernet Rx adapter */
1066 eventdev_eth_rx_adapter_stats_get eth_rx_adapter_stats_get;
1067 /**< Get ethernet Rx stats */
1068 eventdev_eth_rx_adapter_stats_reset eth_rx_adapter_stats_reset;
1069 /**< Reset ethernet Rx stats */
1071 eventdev_timer_adapter_caps_get_t timer_adapter_caps_get;
1072 /**< Get timer adapter capabilities */
1074 eventdev_crypto_adapter_caps_get_t crypto_adapter_caps_get;
1075 /**< Get crypto adapter capabilities */
1076 eventdev_crypto_adapter_queue_pair_add_t crypto_adapter_queue_pair_add;
1077 /**< Add queue pair to crypto adapter */
1078 eventdev_crypto_adapter_queue_pair_del_t crypto_adapter_queue_pair_del;
1079 /**< Delete queue pair from crypto adapter */
1080 eventdev_crypto_adapter_start_t crypto_adapter_start;
1081 /**< Start crypto adapter */
1082 eventdev_crypto_adapter_stop_t crypto_adapter_stop;
1083 /**< Stop crypto adapter */
1084 eventdev_crypto_adapter_stats_get crypto_adapter_stats_get;
1085 /**< Get crypto stats */
1086 eventdev_crypto_adapter_stats_reset crypto_adapter_stats_reset;
1087 /**< Reset crypto stats */
1089 eventdev_eth_tx_adapter_caps_get_t eth_tx_adapter_caps_get;
1090 /**< Get ethernet Tx adapter capabilities */
1092 eventdev_eth_tx_adapter_create_t eth_tx_adapter_create;
1093 /**< Create adapter callback */
1094 eventdev_eth_tx_adapter_free_t eth_tx_adapter_free;
1095 /**< Free adapter callback */
1096 eventdev_eth_tx_adapter_queue_add_t eth_tx_adapter_queue_add;
1097 /**< Add Tx queues to the eth Tx adapter */
1098 eventdev_eth_tx_adapter_queue_del_t eth_tx_adapter_queue_del;
1099 /**< Delete Tx queues from the eth Tx adapter */
1100 eventdev_eth_tx_adapter_start_t eth_tx_adapter_start;
1101 /**< Start eth Tx adapter */
1102 eventdev_eth_tx_adapter_stop_t eth_tx_adapter_stop;
1103 /**< Stop eth Tx adapter */
1104 eventdev_eth_tx_adapter_stats_get_t eth_tx_adapter_stats_get;
1105 /**< Get eth Tx adapter statistics */
1106 eventdev_eth_tx_adapter_stats_reset_t eth_tx_adapter_stats_reset;
1107 /**< Reset eth Tx adapter statistics */
1109 eventdev_selftest dev_selftest;
1110 /**< Start eventdev Selftest */
1112 eventdev_stop_flush_t dev_stop_flush;
1113 /**< User-provided event flush function */
1117 * Allocates a new eventdev slot for an event device and returns the pointer
1118 * to that slot for the driver to use.
1121 * Unique identifier name for each device
1123 * Socket to allocate resources on.
1125 * - Slot in the rte_dev_devices array for a new device;
1127 struct rte_eventdev *
1128 rte_event_pmd_allocate(const char *name, int socket_id);
1131 * Release the specified eventdev device.
1134 * The *eventdev* pointer is the address of the *rte_eventdev* structure.
1136 * - 0 on success, negative on error
1139 rte_event_pmd_release(struct rte_eventdev *eventdev);
1145 #endif /* _RTE_EVENTDEV_PMD_H_ */