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"); \
243 #define RTE_PMD_EXPORT_NAME_ARRAY(n, idx) n##idx[]
245 #define RTE_PMD_EXPORT_NAME(name, idx) \
246 static const char RTE_PMD_EXPORT_NAME_ARRAY(this_pmd_name, idx) \
247 __attribute__((used)) = RTE_STR(name)
249 #define DRV_EXP_TAG(name, tag) __##name##_##tag
251 #define RTE_PMD_REGISTER_PCI_TABLE(name, table) \
252 static const char DRV_EXP_TAG(name, pci_tbl_export)[] __attribute__((used)) = \
255 #define RTE_PMD_REGISTER_PARAM_STRING(name, str) \
256 static const char DRV_EXP_TAG(name, param_string_export)[] \
257 __attribute__((used)) = str
void rte_eal_driver_unregister(struct rte_driver *driver)
int rte_eal_vdev_init(const char *name, const char *args)
void rte_eal_device_remove(struct rte_device *dev)
void rte_eal_device_insert(struct rte_device *dev)
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_dev_detach(const char *name)
int rte_eal_dev_init(void)
void rte_eal_driver_register(struct rte_driver *driver)
TAILQ_ENTRY(rte_driver) next
TAILQ_ENTRY(rte_device) next
int rte_eal_vdev_uninit(const char *name)
TAILQ_HEAD(rte_driver_list, rte_driver)
struct rte_devargs * devargs
struct rte_driver * driver