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 <b...@nicira.com>
---
 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 e4ba6fc..c24d6da 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 b0d08e8..3c82f0f 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.1.0

_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to