[pve-devel] [PATCH] add DPDK_OPT to /etc/default/openvswitch-switch

Alexandre Derumier aderumier at odiso.com
Tue May 3 14:04:26 CEST 2016


Like ubuntu, to enable DPDK in openvswitch-switch

DPDK_OPTS='--dpdk -c 0x1 -n 4'

Signed-off-by: Alexandre Derumier <aderumier at odiso.com>
---
 pvepatches/ovs-ctl-dpdk.patch | 39 +++++++++++++++++++++++++++++++++++++++
 pvepatches/series             |  1 +
 2 files changed, 40 insertions(+)
 create mode 100644 pvepatches/ovs-ctl-dpdk.patch

diff --git a/pvepatches/ovs-ctl-dpdk.patch b/pvepatches/ovs-ctl-dpdk.patch
new file mode 100644
index 0000000..b2d1579
--- /dev/null
+++ b/pvepatches/ovs-ctl-dpdk.patch
@@ -0,0 +1,39 @@
+--- 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
+diff --git a/debian/openvswitch-switch.template b/debian/openvswitch-switch.template
+index d7c7796..3cc76ca 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
++# DPDK_OPTS='--dpdk -c 0x1 -n 4'
++
+diff --git a/utilities/ovs-ctl.in b/utilities/ovs-ctl.in
+index 7b3a3bf..e3bf2f5 100755
+--- a/utilities/ovs-ctl.in
++++ b/utilities/ovs-ctl.in
+@@ -12,6 +12,7 @@
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ # See the License for the specific language governing permissions and
+ # limitations under the License.
++test -e /etc/default/openvswitch-switch && . /etc/default/openvswitch-switch
+ 
+ case $0 in
+     */*) dir0=`echo "$0" | sed 's,/[^/]*$,,'` ;;
diff --git a/pvepatches/series b/pvepatches/series
index f39df21..ed59bc8 100644
--- a/pvepatches/series
+++ b/pvepatches/series
@@ -4,3 +4,4 @@ fix-init-depends.patch
 install-systemd-services.patch
 use-systemctl-inside-ifupdown.patch
 enable-dpdk.patch
+ovs-ctl-dpdk.patch
-- 
2.1.4




More information about the pve-devel mailing list