[ovs-dev] [PATCH 2/2] ovs-dev.py: add option to run with dpdk

Daniele Di Proietto ddiproietto at vmware.com
Thu May 8 22:51:48 UTC 2014


Signed-off-by: Daniele Di Proietto <ddiproietto at vmware.com>
---
 utilities/ovs-dev.py | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/utilities/ovs-dev.py b/utilities/ovs-dev.py
index 7a4425f..814a9d0 100755
--- a/utilities/ovs-dev.py
+++ b/utilities/ovs-dev.py
@@ -224,6 +224,12 @@ def run():
         % (root_uuid, version))
 
     cmd = [BUILD_GCC + "/vswitchd/ovs-vswitchd"]
+
+    if options.dpdk:
+        cmd.append("--dpdk")
+        cmd.extend(options.dpdk)
+        cmd.append("--")
+
     if options.gdb:
         cmd = ["gdb", "--args"] + cmd
     elif options.valgrind:
@@ -312,6 +318,16 @@ Commands:
     sys.exit(0)
 commands.append(doc)
 
+def parse_subargs(option, opt_str, value, parser):
+    subopts = []
+
+    while parser.rargs:
+        dpdkarg = parser.rargs.pop(0)
+        if dpdkarg == "--":
+            break
+        subopts.append(dpdkarg)
+
+    setattr(parser.values, option.dest, subopts)
 
 def main():
     global options
@@ -344,6 +360,9 @@ def main():
                      help="run ovs-vswitchd under gdb")
     group.add_option("--valgrind", dest="valgrind", action="store_true",
                      help="run ovs-vswitchd under valgrind")
+    group.add_option("--dpdk", dest="dpdk", action="callback",
+                     callback=parse_subargs,
+                     help="run ovs-vswitchd with dpdk subopts (ended by --)")
     parser.add_option_group(group)
 
     options, args = parser.parse_args()
-- 
2.0.0.rc0




More information about the dev mailing list