ovs-vswitchd: Better diagnose errors in DPDK command-line options.
authorBen Pfaff <blp@nicira.com>
Tue, 30 Sep 2014 16:57:08 +0000 (09:57 -0700)
committerBen Pfaff <blp@nicira.com>
Tue, 30 Sep 2014 18:18:09 +0000 (11:18 -0700)
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 <blp@nicira.com>
Acked-by: Daniele Di Proietto <ddiproietto@vmware.com>
Tested-by: Daniele Di Proietto <ddiproietto@vmware.com>
lib/netdev-dpdk.h
vswitchd/ovs-vswitchd.c

index e4ba6fc..c24d6da 100644 (file)
@@ -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;
 }
 
index b0d08e8..3c82f0f 100644 (file)
@@ -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: