To enable DPDK it needs a positional parameter to ovs-vswitchd.
Since everybody is encouranged to use the project provided ovs-ctl
scripts to start/stop the daemons it should allow an external setting of
these options via an environment variable.

This patch adds $DPDK_OPTS which will be inserted in the call to
ovs-vswitchd arguments early.

Signed-off-by: Christian Ehrhardt <christian.ehrha...@canonical.com>
---
 debian/openvswitch-switch.template | 4 ++++
 utilities/ovs-ctl.in               | 6 +++++-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/debian/openvswitch-switch.template 
b/debian/openvswitch-switch.template
index d7c7796..27cf7b5 100644
--- a/debian/openvswitch-switch.template
+++ b/debian/openvswitch-switch.template
@@ -6,3 +6,7 @@
 # OVS_CTL_OPTS: Extra options to pass to ovs-ctl.  This is, for example,
 # a suitable place to specify --ovs-vswitchd-wrapper=valgrind.
 # OVS_CTL_OPTS=
+
+# DPDK options - see /usr/share/doc/openvswitch-common/INSTALL.DPDK.md.gz
+# these are passed to ovs-vswitchd obeying to the positional requirements
+# DPDK_OPTS='--dpdk -vhost_sock_dir /var/run/openvswitch-vhost -c 0x1 -n 4'
diff --git a/utilities/ovs-ctl.in b/utilities/ovs-ctl.in
index 0082bed..7b3a3bf 100755
--- a/utilities/ovs-ctl.in
+++ b/utilities/ovs-ctl.in
@@ -215,7 +215,11 @@ start_forwarding () {
         fi
 
            # Start ovs-vswitchd.
-           set ovs-vswitchd unix:"$DB_SOCK"
+           set ovs-vswitchd
+           if test X"$DPDK_OPTS" != X; then
+               set "$@" $DPDK_OPTS --
+           fi
+           set "$@" unix:"$DB_SOCK"
            set "$@" -vconsole:emer -vsyslog:err -vfile:info
            if test X"$MLOCKALL" != Xno; then
                set "$@" --mlockall
-- 
1.9.1

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

Reply via email to