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)(
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_ETHDEV_DEBUG) || \
73 defined(RTE_LIBRTE_CRYPTODEV_DEBUG) || \
74 defined(RTE_LIBRTE_EVENTDEV_DEBUG)
75 #define RTE_PMD_DEBUG_TRACE(...) \
76 rte_pmd_debug_trace(__func__, __VA_ARGS__)
78 #define RTE_PMD_DEBUG_TRACE(...) (void)0
82 #define RTE_PROC_PRIMARY_OR_ERR_RET(retval) do { \
83 if (rte_eal_process_type() != RTE_PROC_PRIMARY) { \
84 RTE_PMD_DEBUG_TRACE("Cannot run in secondary processes\n"); \
89 #define RTE_PROC_PRIMARY_OR_RET() do { \
90 if (rte_eal_process_type() != RTE_PROC_PRIMARY) { \
91 RTE_PMD_DEBUG_TRACE("Cannot run in secondary processes\n"); \
97 #define RTE_FUNC_PTR_OR_ERR_RET(func, retval) do { \
98 if ((func) == NULL) { \
99 RTE_PMD_DEBUG_TRACE("Function not supported\n"); \
104 #define RTE_FUNC_PTR_OR_RET(func) do { \
105 if ((func) == NULL) { \
106 RTE_PMD_DEBUG_TRACE("Function not supported\n"); \
115 RTE_KDRV_UNKNOWN = 0,
118 RTE_KDRV_UIO_GENERIC,
153 #define RTE_DEV_NAME_MAX_LEN 64
208 const char *devargs);
224 const char *devname);
247 #define RTE_PMD_EXPORT_NAME_ARRAY(n, idx) n##idx[]
249 #define RTE_PMD_EXPORT_NAME(name, idx) \
250 static const char RTE_PMD_EXPORT_NAME_ARRAY(this_pmd_name, idx) \
251 __attribute__((used)) = RTE_STR(name)
253 #define DRV_EXP_TAG(name, tag) __##name##_##tag
255 #define RTE_PMD_REGISTER_PCI_TABLE(name, table) \
256 static const char DRV_EXP_TAG(name, pci_tbl_export)[] __attribute__((used)) = \
259 #define RTE_PMD_REGISTER_PARAM_STRING(name, str) \
260 static const char DRV_EXP_TAG(name, param_string_export)[] \
261 __attribute__((used)) = str
284 #define RTE_PMD_REGISTER_KMOD_DEP(name, str) \
285 static const char DRV_EXP_TAG(name, kmod_dep_export)[] \
286 __attribute__((used)) = str
311 int __rte_experimental
313 rte_dev_event_cb_fn cb_fn,
335 int __rte_experimental
337 rte_dev_event_cb_fn cb_fn,
350 int __rte_experimental
363 int __rte_experimental