#include <sys/stat.h>
#include <getopt.h>
+#include <rte_errno.h>
#include <rte_log.h>
#include <rte_memzone.h>
#include <rte_version.h>
.write = dpdk_log_write,
};
-static void
+static bool
dpdk_init__(const struct smap *ovs_other_config)
{
char **argv = NULL, **argv_to_release = NULL;
/* Make sure things are initialized ... */
result = rte_eal_init(argc, argv);
- if (result < 0) {
- ovs_abort(result, "Cannot init EAL");
- }
argv_release(argv, argv_to_release, argc);
/* Set the main thread affinity back to pre rte_eal_init() value */
}
}
+ if (result < 0) {
+ VLOG_EMER("Unable to initialize DPDK: %s", ovs_strerror(rte_errno));
+ return false;
+ }
+
rte_memzone_dump(stdout);
/* We are called from the main thread here */
/* Finally, register the dpdk classes */
netdev_dpdk_register();
+ return true;
}
void
if (ovsthread_once_start(&once_enable)) {
VLOG_INFO("Using %s", rte_version());
VLOG_INFO("DPDK Enabled - initializing...");
- dpdk_init__(ovs_other_config);
- enabled = true;
- VLOG_INFO("DPDK Enabled - initialized");
+ enabled = dpdk_init__(ovs_other_config);
+ if (enabled) {
+ VLOG_INFO("DPDK Enabled - initialized");
+ } else {
+ ovs_abort(rte_errno, "Cannot init EAL");
+ }
ovsthread_once_done(&once_enable);
+ } else {
+ VLOG_ERR_ONCE("DPDK Initialization Failed.");
}
} else {
VLOG_INFO_ONCE("DPDK Disabled - Use other_config:dpdk-init to enable");