21 #include <sys/queue.h>
23 #include <rte_config.h>
24 #include <rte_compat.h>
36 struct rte_dev_event {
42 typedef void (*rte_dev_event_cb_fn)(
const char *device_name,
46 __attribute__((format(printf, 2, 0)))
48 rte_pmd_debug_trace(const
char *func_name, const
char *fmt, ...)
55 char buffer[vsnprintf(NULL, 0, fmt, ap) + 1];
60 vsnprintf(buffer,
sizeof(buffer), fmt, ap);
72 #if defined(RTE_LIBRTE_EVENTDEV_DEBUG)
73 #define RTE_PMD_DEBUG_TRACE(...) \
74 rte_pmd_debug_trace(__func__, __VA_ARGS__)
76 #define RTE_PMD_DEBUG_TRACE(...) (void)0
80 #define RTE_PROC_PRIMARY_OR_ERR_RET(retval) do { \
81 if (rte_eal_process_type() != RTE_PROC_PRIMARY) { \
82 RTE_PMD_DEBUG_TRACE("Cannot run in secondary processes\n"); \
87 #define RTE_PROC_PRIMARY_OR_RET() do { \
88 if (rte_eal_process_type() != RTE_PROC_PRIMARY) { \
89 RTE_PMD_DEBUG_TRACE("Cannot run in secondary processes\n"); \
95 #define RTE_FUNC_PTR_OR_ERR_RET(func, retval) do { \
96 if ((func) == NULL) { \
97 RTE_PMD_DEBUG_TRACE("Function not supported\n"); \
102 #define RTE_FUNC_PTR_OR_RET(func) do { \
103 if ((func) == NULL) { \
104 RTE_PMD_DEBUG_TRACE("Function not supported\n"); \
113 RTE_KDRV_UNKNOWN = 0,
116 RTE_KDRV_UIO_GENERIC,
151 #define RTE_DEV_NAME_MAX_LEN 64
196 const char *drvargs);
260 #define RTE_PMD_EXPORT_NAME_ARRAY(n, idx) n##idx[]
262 #define RTE_PMD_EXPORT_NAME(name, idx) \
263 static const char RTE_PMD_EXPORT_NAME_ARRAY(this_pmd_name, idx) \
264 __attribute__((used)) = RTE_STR(name)
266 #define DRV_EXP_TAG(name, tag) __##name##_##tag
268 #define RTE_PMD_REGISTER_PCI_TABLE(name, table) \
269 static const char DRV_EXP_TAG(name, pci_tbl_export)[] __attribute__((used)) = \
272 #define RTE_PMD_REGISTER_PARAM_STRING(name, str) \
273 static const char DRV_EXP_TAG(name, param_string_export)[] \
274 __attribute__((used)) = str
297 #define RTE_PMD_REGISTER_KMOD_DEP(name, str) \
298 static const char DRV_EXP_TAG(name, kmod_dep_export)[] \
299 __attribute__((used)) = str
344 typedef void *(*rte_dev_iterate_t)(
const void *start,
392 #define RTE_DEV_FOREACH(dev, devstr, it) \
393 for (rte_dev_iterator_init(it, devstr), \
394 dev = rte_dev_iterator_next(it); \
396 dev = rte_dev_iterator_next(it))
421 int __rte_experimental
423 rte_dev_event_cb_fn cb_fn,
445 int __rte_experimental
447 rte_dev_event_cb_fn cb_fn,
462 void __rte_experimental
476 int __rte_experimental
489 int __rte_experimental
502 int __rte_experimental
515 int __rte_experimental