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
18 #include <rte_common.h>
19 #include <rte_compat.h>
20 #include <rte_config.h>
23 #include <rte_malloc.h>
25 #include <rte_mbuf_dyn.h>
27 #include "rte_eventdev.h"
28 #include "rte_event_timer_adapter_pmd.h"
31 #define RTE_EDEV_LOG_ERR(...) \
32 RTE_LOG(ERR, EVENTDEV, \
33 RTE_FMT("%s() line %u: " RTE_FMT_HEAD(__VA_ARGS__,) "\n", \
34 __func__, __LINE__, RTE_FMT_TAIL(__VA_ARGS__,)))
36 #ifdef RTE_LIBRTE_EVENTDEV_DEBUG
37 #define RTE_EDEV_LOG_DEBUG(...) \
38 RTE_LOG(DEBUG, EVENTDEV, \
39 RTE_FMT("%s() line %u: " RTE_FMT_HEAD(__VA_ARGS__,) "\n", \
40 __func__, __LINE__, RTE_FMT_TAIL(__VA_ARGS__,)))
42 #define RTE_EDEV_LOG_DEBUG(...) (void)0
45 /* Macros to check for valid device */
46 #define RTE_EVENTDEV_VALID_DEVID_OR_ERR_RET(dev_id, retval) do { \
47 if (!rte_event_pmd_is_valid_dev((dev_id))) { \
48 RTE_EDEV_LOG_ERR("Invalid dev_id=%d\n", dev_id); \
53 #define RTE_EVENTDEV_VALID_DEVID_OR_ERRNO_RET(dev_id, errno, retval) do { \
54 if (!rte_event_pmd_is_valid_dev((dev_id))) { \
55 RTE_EDEV_LOG_ERR("Invalid dev_id=%d\n", dev_id); \
61 #define RTE_EVENTDEV_VALID_DEVID_OR_RET(dev_id) do { \
62 if (!rte_event_pmd_is_valid_dev((dev_id))) { \
63 RTE_EDEV_LOG_ERR("Invalid dev_id=%d\n", dev_id); \
68 #define RTE_EVENT_ETH_RX_ADAPTER_SW_CAP \
69 ((RTE_EVENT_ETH_RX_ADAPTER_CAP_OVERRIDE_FLOW_ID) | \
70 (RTE_EVENT_ETH_RX_ADAPTER_CAP_MULTI_EVENTQ) | \
71 (RTE_EVENT_ETH_RX_ADAPTER_CAP_EVENT_VECTOR))
73 #define RTE_EVENT_CRYPTO_ADAPTER_SW_CAP \
74 RTE_EVENT_CRYPTO_ADAPTER_CAP_SESSION_PRIVATE_DATA
76 /**< Ethernet Rx adapter cap to return If the packet transfers from
77 * the ethdev to eventdev use a SW service function
80 #define RTE_EVENTDEV_DETACHED (0)
81 #define RTE_EVENTDEV_ATTACHED (1)
85 /** Global structure used for maintaining state of allocated event devices */
86 struct rte_eventdev_global {
87 uint8_t nb_devs; /**< Number of devices found */
90 extern struct rte_eventdev *rte_eventdevs;
91 /** The pool of rte_eventdev structures. */
94 * Get the rte_eventdev structure device pointer for the named device.
97 * device name to select the device structure.
100 * - The rte_eventdev structure pointer for the given device ID.
102 static inline struct rte_eventdev *
103 rte_event_pmd_get_named_dev(const char *name)
105 struct rte_eventdev *dev;
111 for (i = 0; i < RTE_EVENT_MAX_DEVS; i++) {
112 dev = &rte_eventdevs[i];
113 if ((dev->attached == RTE_EVENTDEV_ATTACHED) &&
114 (strcmp(dev->data->name, name) == 0))
122 * Validate if the event device index is valid attached event device.
125 * Event device index.
128 * - If the device index is valid (1) or not (0).
130 static inline unsigned
131 rte_event_pmd_is_valid_dev(uint8_t dev_id)
133 struct rte_eventdev *dev;
135 if (dev_id >= RTE_EVENT_MAX_DEVS)
138 dev = &rte_eventdevs[dev_id];
139 if (dev->attached != RTE_EVENTDEV_ATTACHED)
146 * Definitions of all functions exported by a driver through the
147 * the generic structure of type *event_dev_ops* supplied in the
148 * *rte_eventdev* structure associated with a device.
152 * Get device information of a device.
155 * Event device pointer
157 * Event device information structure
159 typedef void (*eventdev_info_get_t)(struct rte_eventdev *dev,
160 struct rte_event_dev_info *dev_info);
163 * Configure a device.
166 * Event device pointer
169 * Returns 0 on success
171 typedef int (*eventdev_configure_t)(const struct rte_eventdev *dev);
174 * Start a configured device.
177 * Event device pointer
180 * Returns 0 on success
182 typedef int (*eventdev_start_t)(struct rte_eventdev *dev);
185 * Stop a configured device.
188 * Event device pointer
190 typedef void (*eventdev_stop_t)(struct rte_eventdev *dev);
193 * Close a configured device.
196 * Event device pointer
200 * - (-EAGAIN) if can't close as device is busy
202 typedef int (*eventdev_close_t)(struct rte_eventdev *dev);
205 * Retrieve the default event queue configuration.
208 * Event device pointer
211 * @param[out] queue_conf
212 * Event queue configuration structure
215 typedef void (*eventdev_queue_default_conf_get_t)(struct rte_eventdev *dev,
216 uint8_t queue_id, struct rte_event_queue_conf *queue_conf);
219 * Setup an event queue.
222 * Event device pointer
226 * Event queue configuration structure
229 * Returns 0 on success.
231 typedef int (*eventdev_queue_setup_t)(struct rte_eventdev *dev,
233 const struct rte_event_queue_conf *queue_conf);
236 * Release resources allocated by given event queue.
239 * Event device pointer
244 typedef void (*eventdev_queue_release_t)(struct rte_eventdev *dev,
248 * Retrieve the default event port configuration.
251 * Event device pointer
254 * @param[out] port_conf
255 * Event port configuration structure
258 typedef void (*eventdev_port_default_conf_get_t)(struct rte_eventdev *dev,
259 uint8_t port_id, struct rte_event_port_conf *port_conf);
262 * Setup an event port.
265 * Event device pointer
269 * Event port configuration structure
272 * Returns 0 on success.
274 typedef int (*eventdev_port_setup_t)(struct rte_eventdev *dev,
276 const struct rte_event_port_conf *port_conf);
279 * Release memory resources allocated by given event port.
285 typedef void (*eventdev_port_release_t)(void *port);
288 * Link multiple source event queues to destination event port.
291 * Event device pointer
295 * Points to an array of *nb_links* event queues to be linked
298 * Points to an array of *nb_links* service priorities associated with each
299 * event queue link to event port.
301 * The number of links to establish
304 * Returns 0 on success.
307 typedef int (*eventdev_port_link_t)(struct rte_eventdev *dev, void *port,
308 const uint8_t queues[], const uint8_t priorities[],
312 * Unlink multiple source event queues from destination event port.
315 * Event device pointer
319 * An array of *nb_unlinks* event queues to be unlinked from the event port.
321 * The number of unlinks to establish
324 * Returns 0 on success.
327 typedef int (*eventdev_port_unlink_t)(struct rte_eventdev *dev, void *port,
328 uint8_t queues[], uint16_t nb_unlinks);
331 * Unlinks in progress. Returns number of unlinks that the PMD is currently
332 * performing, but have not yet been completed.
335 * Event device pointer
341 * Returns the number of in-progress unlinks. Zero is returned if none are
344 typedef int (*eventdev_port_unlinks_in_progress_t)(struct rte_eventdev *dev,
348 * Converts nanoseconds to *timeout_ticks* value for rte_event_dequeue()
351 * Event device pointer
353 * Wait time in nanosecond
354 * @param[out] timeout_ticks
355 * Value for the *timeout_ticks* parameter in rte_event_dequeue() function
358 * Returns 0 on success.
361 typedef int (*eventdev_dequeue_timeout_ticks_t)(struct rte_eventdev *dev,
362 uint64_t ns, uint64_t *timeout_ticks);
365 * Dump internal information
368 * Event device pointer
370 * A pointer to a file for output
373 typedef void (*eventdev_dump_t)(struct rte_eventdev *dev, FILE *f);
376 * Retrieve a set of statistics from device
379 * Event device pointer
381 * Level (device, port or queue)
382 * @param queue_port_id
383 * Queue or port number depending on mode
385 * The stat ids to retrieve
387 * The returned stat values
389 * The number of id values and entries in the values array
391 * The number of stat values successfully filled into the values array
393 typedef int (*eventdev_xstats_get_t)(const struct rte_eventdev *dev,
394 enum rte_event_dev_xstats_mode mode, uint8_t queue_port_id,
395 const unsigned int ids[], uint64_t values[], unsigned int n);
398 * Resets the statistic values in xstats for the device, based on mode.
400 typedef int (*eventdev_xstats_reset_t)(struct rte_eventdev *dev,
401 enum rte_event_dev_xstats_mode mode,
402 int16_t queue_port_id,
403 const uint32_t ids[],
407 * Get names of extended stats of an event device
410 * Event device pointer
412 * Level (device, port or queue)
413 * @param queue_port_id
414 * Queue or port number depending on mode
415 * @param xstats_names
416 * Array of name values to be filled in
418 * The stat ids to retrieve
420 * Number of values in the xstats_names array
422 * When size >= the number of stats, return the number of stat values filled
424 * When size < the number of available stats, return the number of stats
425 * values, and do not fill in any data into xstats_names.
427 typedef int (*eventdev_xstats_get_names_t)(const struct rte_eventdev *dev,
428 enum rte_event_dev_xstats_mode mode, uint8_t queue_port_id,
429 struct rte_event_dev_xstats_name *xstats_names,
430 unsigned int *ids, unsigned int size);
433 * Get value of one stats and optionally return its id
436 * Event device pointer
438 * The name of the stat to retrieve
440 * Pointer to an unsigned int where we store the stat-id for future reference.
441 * This pointer may be null if the id is not required.
443 * The value of the stat, or (uint64_t)-1 if the stat is not found.
444 * If the stat is not found, the id value will be returned as (unsigned)-1,
445 * if id pointer is non-NULL
447 typedef uint64_t (*eventdev_xstats_get_by_name)(const struct rte_eventdev *dev,
448 const char *name, unsigned int *id);
452 * Retrieve the event device's ethdev Rx adapter capabilities for the
453 * specified ethernet port
456 * Event device pointer
459 * Ethernet device pointer
462 * A pointer to memory filled with Rx event adapter capabilities.
465 * - 0: Success, driver provides Rx event adapter capabilities for the
467 * - <0: Error code returned by the driver function.
470 typedef int (*eventdev_eth_rx_adapter_caps_get_t)
471 (const struct rte_eventdev *dev,
472 const struct rte_eth_dev *eth_dev,
475 struct rte_event_eth_rx_adapter_queue_conf;
478 * Retrieve the event device's timer adapter capabilities, as well as the ops
479 * structure that an event timer adapter should call through to enter the
483 * Event device pointer
486 * Flags that can be used to determine how to select an event timer
487 * adapter ops structure
490 * A pointer to memory filled with Rx event adapter capabilities.
493 * A pointer to the ops pointer to set with the address of the desired ops
497 * - 0: Success, driver provides Rx event adapter capabilities for the
499 * - <0: Error code returned by the driver function.
502 typedef int (*eventdev_timer_adapter_caps_get_t)(
503 const struct rte_eventdev *dev,
506 const struct rte_event_timer_adapter_ops **ops);
509 * Add ethernet Rx queues to event device. This callback is invoked if
510 * the caps returned from rte_eventdev_eth_rx_adapter_caps_get(, eth_port_id)
511 * has RTE_EVENT_ETH_RX_ADAPTER_CAP_INTERNAL_PORT set.
514 * Event device pointer
517 * Ethernet device pointer
520 * Ethernet device receive queue index
523 * Additional configuration structure
526 * - 0: Success, ethernet receive queue added successfully.
527 * - <0: Error code returned by the driver function.
530 typedef int (*eventdev_eth_rx_adapter_queue_add_t)(
531 const struct rte_eventdev *dev,
532 const struct rte_eth_dev *eth_dev,
534 const struct rte_event_eth_rx_adapter_queue_conf *queue_conf);
537 * Delete ethernet Rx queues from event device. This callback is invoked if
538 * the caps returned from eventdev_eth_rx_adapter_caps_get(, eth_port_id)
539 * has RTE_EVENT_ETH_RX_ADAPTER_CAP_INTERNAL_PORT set.
542 * Event device pointer
545 * Ethernet device pointer
548 * Ethernet device receive queue index
551 * - 0: Success, ethernet receive queue deleted successfully.
552 * - <0: Error code returned by the driver function.
555 typedef int (*eventdev_eth_rx_adapter_queue_del_t)
556 (const struct rte_eventdev *dev,
557 const struct rte_eth_dev *eth_dev,
558 int32_t rx_queue_id);
561 * Start ethernet Rx adapter. This callback is invoked if
562 * the caps returned from eventdev_eth_rx_adapter_caps_get(.., eth_port_id)
563 * has RTE_EVENT_ETH_RX_ADAPTER_CAP_INTERNAL_PORT set and Rx queues
564 * from eth_port_id have been added to the event device.
567 * Event device pointer
570 * Ethernet device pointer
573 * - 0: Success, ethernet Rx adapter started successfully.
574 * - <0: Error code returned by the driver function.
576 typedef int (*eventdev_eth_rx_adapter_start_t)
577 (const struct rte_eventdev *dev,
578 const struct rte_eth_dev *eth_dev);
581 * Stop ethernet Rx adapter. This callback is invoked if
582 * the caps returned from eventdev_eth_rx_adapter_caps_get(..,eth_port_id)
583 * has RTE_EVENT_ETH_RX_ADAPTER_CAP_INTERNAL_PORT set and Rx queues
584 * from eth_port_id have been added to the event device.
587 * Event device pointer
590 * Ethernet device pointer
593 * - 0: Success, ethernet Rx adapter stopped successfully.
594 * - <0: Error code returned by the driver function.
596 typedef int (*eventdev_eth_rx_adapter_stop_t)
597 (const struct rte_eventdev *dev,
598 const struct rte_eth_dev *eth_dev);
600 struct rte_event_eth_rx_adapter_stats;
603 * Retrieve ethernet Rx adapter statistics.
606 * Event device pointer
609 * Ethernet device pointer
612 * Pointer to stats structure
615 * Return 0 on success.
618 typedef int (*eventdev_eth_rx_adapter_stats_get)
619 (const struct rte_eventdev *dev,
620 const struct rte_eth_dev *eth_dev,
621 struct rte_event_eth_rx_adapter_stats *stats);
623 * Reset ethernet Rx adapter statistics.
626 * Event device pointer
629 * Ethernet device pointer
632 * Return 0 on success.
634 typedef int (*eventdev_eth_rx_adapter_stats_reset)
635 (const struct rte_eventdev *dev,
636 const struct rte_eth_dev *eth_dev);
638 * Start eventdev selftest.
641 * Return 0 on success.
643 typedef int (*eventdev_selftest)(void);
645 struct rte_event_eth_rx_adapter_vector_limits;
647 * Get event vector limits for a given event, ethernet device pair.
650 * Event device pointer
653 * Ethernet device pointer
656 * Pointer to the limits structure to be filled.
660 * - <0: Error code returned by the driver function.
662 typedef int (*eventdev_eth_rx_adapter_vector_limits_get_t)(
663 const struct rte_eventdev *dev, const struct rte_eth_dev *eth_dev,
664 struct rte_event_eth_rx_adapter_vector_limits *limits);
666 typedef uint32_t rte_event_pmd_selftest_seqn_t;
667 extern int rte_event_pmd_selftest_seqn_dynfield_offset;
670 * Read test sequence number from mbuf.
672 * @param mbuf Structure to read from.
673 * @return pointer to test sequence number.
676 static inline rte_event_pmd_selftest_seqn_t *
677 rte_event_pmd_selftest_seqn(struct rte_mbuf *mbuf)
679 return RTE_MBUF_DYNFIELD(mbuf,
680 rte_event_pmd_selftest_seqn_dynfield_offset,
681 rte_event_pmd_selftest_seqn_t *);
684 struct rte_cryptodev;
687 * This API may change without prior notice
689 * Retrieve the event device's crypto adapter capabilities for the
690 * specified cryptodev
693 * Event device pointer
699 * A pointer to memory filled with event adapter capabilities.
700 * It is expected to be pre-allocated & initialized by caller.
703 * - 0: Success, driver provides event adapter capabilities for the
705 * - <0: Error code returned by the driver function.
708 typedef int (*eventdev_crypto_adapter_caps_get_t)
709 (const struct rte_eventdev *dev,
710 const struct rte_cryptodev *cdev,
714 * This API may change without prior notice
716 * Add crypto queue pair to event device. This callback is invoked if
717 * the caps returned from rte_event_crypto_adapter_caps_get(, cdev_id)
718 * has RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_* set.
721 * Event device pointer
726 * @param queue_pair_id
727 * cryptodev queue pair identifier.
730 * Event information required for binding cryptodev queue pair to event queue.
731 * This structure will have a valid value for only those HW PMDs supporting
732 * @see RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_QP_EV_BIND capability.
735 * - 0: Success, cryptodev queue pair added successfully.
736 * - <0: Error code returned by the driver function.
739 typedef int (*eventdev_crypto_adapter_queue_pair_add_t)
740 (const struct rte_eventdev *dev,
741 const struct rte_cryptodev *cdev,
742 int32_t queue_pair_id,
743 const struct rte_event *event);
747 * This API may change without prior notice
749 * Delete crypto queue pair to event device. This callback is invoked if
750 * the caps returned from rte_event_crypto_adapter_caps_get(, cdev_id)
751 * has RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_* set.
754 * Event device pointer
759 * @param queue_pair_id
760 * cryptodev queue pair identifier.
763 * - 0: Success, cryptodev queue pair deleted successfully.
764 * - <0: Error code returned by the driver function.
767 typedef int (*eventdev_crypto_adapter_queue_pair_del_t)
768 (const struct rte_eventdev *dev,
769 const struct rte_cryptodev *cdev,
770 int32_t queue_pair_id);
773 * Start crypto adapter. This callback is invoked if
774 * the caps returned from rte_event_crypto_adapter_caps_get(.., cdev_id)
775 * has RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_* set and queue pairs
776 * from cdev_id have been added to the event device.
779 * Event device pointer
782 * Crypto device pointer
785 * - 0: Success, crypto adapter started successfully.
786 * - <0: Error code returned by the driver function.
788 typedef int (*eventdev_crypto_adapter_start_t)
789 (const struct rte_eventdev *dev,
790 const struct rte_cryptodev *cdev);
793 * Stop crypto adapter. This callback is invoked if
794 * the caps returned from rte_event_crypto_adapter_caps_get(.., cdev_id)
795 * has RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_* set and queue pairs
796 * from cdev_id have been added to the event device.
799 * Event device pointer
802 * Crypto device pointer
805 * - 0: Success, crypto adapter stopped successfully.
806 * - <0: Error code returned by the driver function.
808 typedef int (*eventdev_crypto_adapter_stop_t)
809 (const struct rte_eventdev *dev,
810 const struct rte_cryptodev *cdev);
812 struct rte_event_crypto_adapter_stats;
815 * Retrieve crypto adapter statistics.
818 * Event device pointer
821 * Crypto device pointer
824 * Pointer to stats structure
827 * Return 0 on success.
830 typedef int (*eventdev_crypto_adapter_stats_get)
831 (const struct rte_eventdev *dev,
832 const struct rte_cryptodev *cdev,
833 struct rte_event_crypto_adapter_stats *stats);
836 * Reset crypto adapter statistics.
839 * Event device pointer
842 * Crypto device pointer
845 * Return 0 on success.
848 typedef int (*eventdev_crypto_adapter_stats_reset)
849 (const struct rte_eventdev *dev,
850 const struct rte_cryptodev *cdev);
853 * Retrieve the event device's eth Tx adapter capabilities.
856 * Event device pointer
859 * Ethernet device pointer
862 * A pointer to memory filled with eth Tx adapter capabilities.
865 * - 0: Success, driver provides eth Tx adapter capabilities
866 * - <0: Error code returned by the driver function.
869 typedef int (*eventdev_eth_tx_adapter_caps_get_t)
870 (const struct rte_eventdev *dev,
871 const struct rte_eth_dev *eth_dev,
875 * Create adapter callback.
881 * Event device pointer
885 * - <0: Error code on failure.
887 typedef int (*eventdev_eth_tx_adapter_create_t)(uint8_t id,
888 const struct rte_eventdev *dev);
891 * Free adapter callback.
897 * Event device pointer
901 * - <0: Error code on failure.
903 typedef int (*eventdev_eth_tx_adapter_free_t)(uint8_t id,
904 const struct rte_eventdev *dev);
907 * Add a Tx queue to the adapter.
908 * A queue value of -1 is used to indicate all
909 * queues within the device.
915 * Event device pointer
918 * Ethernet device pointer
921 * Transmit queue index
925 * - <0: Error code on failure.
927 typedef int (*eventdev_eth_tx_adapter_queue_add_t)(
929 const struct rte_eventdev *dev,
930 const struct rte_eth_dev *eth_dev,
931 int32_t tx_queue_id);
934 * Delete a Tx queue from the adapter.
935 * A queue value of -1 is used to indicate all
936 * queues within the device, that have been added to this
943 * Event device pointer
946 * Ethernet device pointer
949 * Transmit queue index
952 * - 0: Success, Queues deleted successfully.
953 * - <0: Error code on failure.
955 typedef int (*eventdev_eth_tx_adapter_queue_del_t)(
957 const struct rte_eventdev *dev,
958 const struct rte_eth_dev *eth_dev,
959 int32_t tx_queue_id);
968 * Event device pointer
971 * - 0: Success, Adapter started correctly.
972 * - <0: Error code on failure.
974 typedef int (*eventdev_eth_tx_adapter_start_t)(uint8_t id,
975 const struct rte_eventdev *dev);
984 * Event device pointer
988 * - <0: Error code on failure.
990 typedef int (*eventdev_eth_tx_adapter_stop_t)(uint8_t id,
991 const struct rte_eventdev *dev);
993 struct rte_event_eth_tx_adapter_stats;
996 * Retrieve statistics for an adapter
1002 * Event device pointer
1004 * @param [out] stats
1005 * A pointer to structure used to retrieve statistics for an adapter
1008 * - 0: Success, statistics retrieved successfully.
1009 * - <0: Error code on failure.
1011 typedef int (*eventdev_eth_tx_adapter_stats_get_t)(
1013 const struct rte_eventdev *dev,
1014 struct rte_event_eth_tx_adapter_stats *stats);
1017 * Reset statistics for an adapter
1020 * Adapter identifier
1023 * Event device pointer
1026 * - 0: Success, statistics retrieved successfully.
1027 * - <0: Error code on failure.
1029 typedef int (*eventdev_eth_tx_adapter_stats_reset_t)(uint8_t id,
1030 const struct rte_eventdev *dev);
1032 /** Event device operations function pointer table */
1033 struct rte_eventdev_ops {
1034 eventdev_info_get_t dev_infos_get; /**< Get device info. */
1035 eventdev_configure_t dev_configure; /**< Configure device. */
1036 eventdev_start_t dev_start; /**< Start device. */
1037 eventdev_stop_t dev_stop; /**< Stop device. */
1038 eventdev_close_t dev_close; /**< Close device. */
1040 eventdev_queue_default_conf_get_t queue_def_conf;
1041 /**< Get default queue configuration. */
1042 eventdev_queue_setup_t queue_setup;
1043 /**< Set up an event queue. */
1044 eventdev_queue_release_t queue_release;
1045 /**< Release an event queue. */
1047 eventdev_port_default_conf_get_t port_def_conf;
1048 /**< Get default port configuration. */
1049 eventdev_port_setup_t port_setup;
1050 /**< Set up an event port. */
1051 eventdev_port_release_t port_release;
1052 /**< Release an event port. */
1054 eventdev_port_link_t port_link;
1055 /**< Link event queues to an event port. */
1056 eventdev_port_unlink_t port_unlink;
1057 /**< Unlink event queues from an event port. */
1058 eventdev_port_unlinks_in_progress_t port_unlinks_in_progress;
1059 /**< Unlinks in progress on an event port. */
1060 eventdev_dequeue_timeout_ticks_t timeout_ticks;
1061 /**< Converts ns to *timeout_ticks* value for rte_event_dequeue() */
1062 eventdev_dump_t dump;
1063 /* Dump internal information */
1065 eventdev_xstats_get_t xstats_get;
1066 /**< Get extended device statistics. */
1067 eventdev_xstats_get_names_t xstats_get_names;
1068 /**< Get names of extended stats. */
1069 eventdev_xstats_get_by_name xstats_get_by_name;
1070 /**< Get one value by name. */
1071 eventdev_xstats_reset_t xstats_reset;
1072 /**< Reset the statistics values in xstats. */
1074 eventdev_eth_rx_adapter_caps_get_t eth_rx_adapter_caps_get;
1075 /**< Get ethernet Rx adapter capabilities */
1076 eventdev_eth_rx_adapter_queue_add_t eth_rx_adapter_queue_add;
1077 /**< Add Rx queues to ethernet Rx adapter */
1078 eventdev_eth_rx_adapter_queue_del_t eth_rx_adapter_queue_del;
1079 /**< Delete Rx queues from ethernet Rx adapter */
1080 eventdev_eth_rx_adapter_start_t eth_rx_adapter_start;
1081 /**< Start ethernet Rx adapter */
1082 eventdev_eth_rx_adapter_stop_t eth_rx_adapter_stop;
1083 /**< Stop ethernet Rx adapter */
1084 eventdev_eth_rx_adapter_stats_get eth_rx_adapter_stats_get;
1085 /**< Get ethernet Rx stats */
1086 eventdev_eth_rx_adapter_stats_reset eth_rx_adapter_stats_reset;
1087 /**< Reset ethernet Rx stats */
1088 eventdev_eth_rx_adapter_vector_limits_get_t
1089 eth_rx_adapter_vector_limits_get;
1090 /**< Get event vector limits for the Rx adapter */
1092 eventdev_timer_adapter_caps_get_t timer_adapter_caps_get;
1093 /**< Get timer adapter capabilities */
1095 eventdev_crypto_adapter_caps_get_t crypto_adapter_caps_get;
1096 /**< Get crypto adapter capabilities */
1097 eventdev_crypto_adapter_queue_pair_add_t crypto_adapter_queue_pair_add;
1098 /**< Add queue pair to crypto adapter */
1099 eventdev_crypto_adapter_queue_pair_del_t crypto_adapter_queue_pair_del;
1100 /**< Delete queue pair from crypto adapter */
1101 eventdev_crypto_adapter_start_t crypto_adapter_start;
1102 /**< Start crypto adapter */
1103 eventdev_crypto_adapter_stop_t crypto_adapter_stop;
1104 /**< Stop crypto adapter */
1105 eventdev_crypto_adapter_stats_get crypto_adapter_stats_get;
1106 /**< Get crypto stats */
1107 eventdev_crypto_adapter_stats_reset crypto_adapter_stats_reset;
1108 /**< Reset crypto stats */
1110 eventdev_eth_tx_adapter_caps_get_t eth_tx_adapter_caps_get;
1111 /**< Get ethernet Tx adapter capabilities */
1113 eventdev_eth_tx_adapter_create_t eth_tx_adapter_create;
1114 /**< Create adapter callback */
1115 eventdev_eth_tx_adapter_free_t eth_tx_adapter_free;
1116 /**< Free adapter callback */
1117 eventdev_eth_tx_adapter_queue_add_t eth_tx_adapter_queue_add;
1118 /**< Add Tx queues to the eth Tx adapter */
1119 eventdev_eth_tx_adapter_queue_del_t eth_tx_adapter_queue_del;
1120 /**< Delete Tx queues from the eth Tx adapter */
1121 eventdev_eth_tx_adapter_start_t eth_tx_adapter_start;
1122 /**< Start eth Tx adapter */
1123 eventdev_eth_tx_adapter_stop_t eth_tx_adapter_stop;
1124 /**< Stop eth Tx adapter */
1125 eventdev_eth_tx_adapter_stats_get_t eth_tx_adapter_stats_get;
1126 /**< Get eth Tx adapter statistics */
1127 eventdev_eth_tx_adapter_stats_reset_t eth_tx_adapter_stats_reset;
1128 /**< Reset eth Tx adapter statistics */
1130 eventdev_selftest dev_selftest;
1131 /**< Start eventdev Selftest */
1133 eventdev_stop_flush_t dev_stop_flush;
1134 /**< User-provided event flush function */
1138 * Allocates a new eventdev slot for an event device and returns the pointer
1139 * to that slot for the driver to use.
1142 * Unique identifier name for each device
1144 * Socket to allocate resources on.
1146 * - Slot in the rte_dev_devices array for a new device;
1148 struct rte_eventdev *
1149 rte_event_pmd_allocate(const char *name, int socket_id);
1152 * Release the specified eventdev device.
1155 * The *eventdev* pointer is the address of the *rte_eventdev* structure.
1157 * - 0 on success, negative on error
1160 rte_event_pmd_release(struct rte_eventdev *eventdev);
1162 #endif /* _RTE_EVENTDEV_PMD_H_ */