#ifndef MLX4_UTILS_H_
#define MLX4_UTILS_H_
+#include <stddef.h>
+#include <stdio.h>
+
#include <rte_common.h>
#include <rte_log.h>
#define WARN(...) PMD_DRV_LOG(WARNING, __VA_ARGS__)
#define ERROR(...) PMD_DRV_LOG(ERR, __VA_ARGS__)
+/* Allocate a buffer on the stack and fill it with a printf format string. */
+#define MKSTR(name, ...) \
+ char name[snprintf(NULL, 0, __VA_ARGS__) + 1]; \
+ \
+ snprintf(name, sizeof(name), __VA_ARGS__)
+
/* mlx4_utils.c */
int mlx4_fd_set_non_blocking(int fd);