From e03f0d03bbe9d530a17c9297fb2d3bbc743fd569 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Tue, 30 Sep 2014 09:57:08 -0700 Subject: [PATCH] ovs-vswitchd: Better diagnose errors in DPDK command-line options. With DPDK compiled in, when the --dpdk option was given other than as the first command-line argument, ovs-vswitchd silently ignored it. Without DPDK compiled in, when the --dpdk option was given anywhere, ovs-vswitchd silently ignored it. However, in each case any options following --dpdk were not ignored, and since --dpdk is normally followed by additional DPDK-specific options, this caused even more confusing trouble. Signed-off-by: Ben Pfaff Acked-by: Daniele Di Proietto Tested-by: Daniele Di Proietto --- lib/netdev-dpdk.h | 7 ++++++- vswitchd/ovs-vswitchd.c | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/netdev-dpdk.h b/lib/netdev-dpdk.h index e4ba6fc37..c24d6da33 100644 --- a/lib/netdev-dpdk.h +++ b/lib/netdev-dpdk.h @@ -28,9 +28,14 @@ void thread_set_nonpmd(void); #else +#include "util.h" + static inline int -dpdk_init(int arg1 OVS_UNUSED, char **arg2 OVS_UNUSED) +dpdk_init(int argc, char **argv) { + if (argc >= 2 && !strcmp(argv[1], "--dpdk")) { + ovs_fatal(0, "DPDK support not built into this copy of Open vSwitch."); + } return 0; } diff --git a/vswitchd/ovs-vswitchd.c b/vswitchd/ovs-vswitchd.c index b0d08e8af..3c82f0fb4 100644 --- a/vswitchd/ovs-vswitchd.c +++ b/vswitchd/ovs-vswitchd.c @@ -215,6 +215,7 @@ parse_options(int argc, char *argv[], char **unixctl_pathp) exit(EXIT_FAILURE); case OPT_DPDK: + ovs_fatal(0, "--dpdk must be given at beginning of command line."); break; default: -- 2.39.2