50 #include <sys/queue.h>
52 #include <rte_config.h>
55 __attribute__((format(printf, 2, 0)))
57 rte_pmd_debug_trace(const
char *func_name, const
char *fmt, ...)
64 char buffer[vsnprintf(NULL, 0, fmt, ap) + 1];
69 vsnprintf(buffer,
sizeof(buffer), fmt, ap);
81 #if defined(RTE_LIBRTE_ETHDEV_DEBUG) || \
82 defined(RTE_LIBRTE_CRYPTODEV_DEBUG) || \
83 defined(RTE_LIBRTE_EVENTDEV_DEBUG)
84 #define RTE_PMD_DEBUG_TRACE(...) \
85 rte_pmd_debug_trace(__func__, __VA_ARGS__)
87 #define RTE_PMD_DEBUG_TRACE(...) (void)0
91 #define RTE_PROC_PRIMARY_OR_ERR_RET(retval) do { \
92 if (rte_eal_process_type() != RTE_PROC_PRIMARY) { \
93 RTE_PMD_DEBUG_TRACE("Cannot run in secondary processes\n"); \
98 #define RTE_PROC_PRIMARY_OR_RET() do { \
99 if (rte_eal_process_type() != RTE_PROC_PRIMARY) { \
100 RTE_PMD_DEBUG_TRACE("Cannot run in secondary processes\n"); \
106 #define RTE_FUNC_PTR_OR_ERR_RET(func, retval) do { \
107 if ((func) == NULL) { \
108 RTE_PMD_DEBUG_TRACE("Function not supported\n"); \
113 #define RTE_FUNC_PTR_OR_RET(func) do { \
114 if ((func) == NULL) { \
115 RTE_PMD_DEBUG_TRACE("Function not supported\n"); \
124 RTE_KDRV_UNKNOWN = 0,
127 RTE_KDRV_UIO_GENERIC,
162 #define RTE_DEV_NAME_MAX_LEN 64
217 const char *devargs);
255 #define RTE_PMD_EXPORT_NAME_ARRAY(n, idx) n##idx[]
257 #define RTE_PMD_EXPORT_NAME(name, idx) \
258 static const char RTE_PMD_EXPORT_NAME_ARRAY(this_pmd_name, idx) \
259 __attribute__((used)) = RTE_STR(name)
261 #define DRV_EXP_TAG(name, tag) __##name##_##tag
263 #define RTE_PMD_REGISTER_PCI_TABLE(name, table) \
264 static const char DRV_EXP_TAG(name, pci_tbl_export)[] __attribute__((used)) = \
267 #define RTE_PMD_REGISTER_PARAM_STRING(name, str) \
268 static const char DRV_EXP_TAG(name, param_string_export)[] \
269 __attribute__((used)) = str
292 #define RTE_PMD_REGISTER_KMOD_DEP(name, str) \
293 static const char DRV_EXP_TAG(name, kmod_dep_export)[] \
294 __attribute__((used)) = str
int rte_log(uint32_t level, uint32_t logtype, const char *format,...)
int rte_eal_dev_attach(const char *name, const char *devargs)
int rte_eal_hotplug_add(const char *busname, const char *devname, const char *devargs)
int rte_eal_dev_detach(struct rte_device *dev)
TAILQ_ENTRY(rte_driver) next
TAILQ_ENTRY(rte_device) next
char name[RTE_DEV_NAME_MAX_LEN]
struct rte_devargs * devargs
int rte_eal_hotplug_remove(const char *busname, const char *devname)
const struct rte_driver * driver
int(* rte_dev_cmp_t)(const struct rte_device *dev, const void *data)