SHA256
1
0
forked from pool/openvswitch
openvswitch/0001-utilities-Add-script-to-support-DPDK-option-migratio.patch
Markos Chandras e6bd8f037c Accepting request 461859 from home:markoschandras:network
- Version bump to 2.7.0 (fate#321541). Some of the changes are:
  * Utilities and daemons that support SSL now allow protocols and
    ciphers to be configured with --ssl-protocols and --ssl-ciphers.
  * OVN:
    - QoS is now implemented via egress shaping rather than ingress policing.
    - DSCP marking is now supported, via the new northbound QoS table.
    - IPAM now supports fixed MAC addresses.
    - Support for source IP address based routing.
    - ovn-trace:
      * New --ovs option to also print OpenFlow flows.
      * put_dhcp_opts and put_dhcp_optsv6 actions may now be traced.
    - Support for managing SSL and remote connection configuration in
      northbound and southbound databases.
  * Fixed regression in table stats maintenance introduced in OVS
    2.3.0, wherein the number of OpenFlow table hits and misses was
    not accurate.
  * OpenFlow:
    - OFPT_PACKET_OUT messages are now supported in bundles.
    - A new "selection_method=dp_hash" type for OpenFlow select group
      bucket selection that uses the datapath computed 5-tuple hash
      without making datapath flows match the 5-tuple fields, which
      is useful for more efficient load balancing, for example.  This
      uses the Netronome extension to OpenFlow 1.5+ that allows
      control over the OpenFlow select groups selection method.  See
      "selection_method" and related options in ovs-ofctl(8) for
      details.
    - The "sample" action now supports "ingress" and "egress" options.
    - The "ct" action now supports the TFTP ALG where support is available.
    - New actions "clone" and "ct_clear".
  * ovs-ofctl:

OBS-URL: https://build.opensuse.org/request/show/461859
OBS-URL: https://build.opensuse.org/package/show/network/openvswitch?expand=0&rev=111
2017-03-13 15:00:26 +00:00

129 lines
4.2 KiB
Diff

From 4f543e486836e9e48fd771ce64808136ac9ce887 Mon Sep 17 00:00:00 2001
From: Markos Chandras <mchandras@suse.de>
Date: Fri, 10 Feb 2017 09:51:03 +0000
Subject: [PATCH] utilities: Add script to support DPDK option migration from
OvS<2.6
Open vSwitch 2.6 now requires DPDK options to be in the Open vSwitch
database so add a script to migration options from
/etc/sysconfig/openvswitch to the database.
Commit: bab6940971336510c1f4342cde0bc17da46b99f1 ("netdev-dpdk: Convert
initialization from cmdline to db")
Signed-off-by: Markos Chandras <mchandras@suse.de>
---
rhel/usr_lib_systemd_system_openvswitch.service | 1 +
utilities/ovs-dpdk-migrate-2.6.sh | 88 +++++++++++++++++++++++++
2 files changed, 89 insertions(+)
create mode 100644 utilities/ovs-dpdk-migrate-2.6.sh
diff --git a/rhel/usr_lib_systemd_system_openvswitch.service b/rhel/usr_lib_systemd_system_openvswitch.service
index e823c5454..4cdb8e75d 100644
--- a/rhel/usr_lib_systemd_system_openvswitch.service
+++ b/rhel/usr_lib_systemd_system_openvswitch.service
@@ -9,6 +9,7 @@ BindsTo=ovs-vswitchd.service
[Service]
Type=oneshot
ExecStart=/bin/true
+ExecStartPost=/usr/share/openvswitch/scripts/ovs-dpdk-migrate-2.6.sh
ExecReload=/bin/true
ExecStop=/bin/true
RemainAfterExit=yes
diff --git a/utilities/ovs-dpdk-migrate-2.6.sh b/utilities/ovs-dpdk-migrate-2.6.sh
new file mode 100644
index 000000000..6a3f1e08c
--- /dev/null
+++ b/utilities/ovs-dpdk-migrate-2.6.sh
@@ -0,0 +1,88 @@
+#!/bin/bash
+
+# Copyright (c) 2017 SUSE LINUX GmbH
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at:
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# 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.
+#
+# Author: Markos Chandras <mchandras@suse.de>
+# Maintainer: Markos Chandras <mchandras@suse.de>
+
+
+# The script will try its best to migrate the DPDK options from
+# /etc/sysconfig/openvswitch to the new Open vSwitch db options introduced
+# in Open vSwitch 2.6
+
+set -eu
+
+extra_string=''
+
+do_ovs_print() {
+ logger="$(which logger || false) -t $(basename $0) -- [dpdk options migration]"
+ echo "[dpdk options migration]" $@
+ eval $logger $@
+}
+
+do_ovs_db() {
+ field=$1; shift
+ args="$@"
+ ovsctl="ovs-vsctl set Open_vSwitch . other_config:$field='$args'"
+ do_ovs_print "Executing '$ovsctl'"
+ eval $ovsctl
+}
+
+OVS_SYSCONFIG=/etc/sysconfig/openvswitch
+
+# Exit if for whatever reason there is no sysconfig file
+[[ ! -e $OVS_SYSCONFIG ]] && exit 0
+
+source $OVS_SYSCONFIG
+
+# Exit if no DPDK_OPTIONS are set
+[[ "${DPDK_OPTIONS:-x__unset__x}" == "x__unset__x" ]] && exit 0
+
+# If other_config:dpdk-init exists in db then we don't need to do anything
+$(type -p ovs-vsctl) get Open_vSwitch . other_config:dpdk-init &> /dev/null && exit 0
+
+OPTIONS=$(getopt -u -o b:c:d:l:m:n:r:v:w: --long xen-dom0:,syslog,socket-mem:,lcores:,master-lcore:,huge-dir,proc-type,file-prefix,vmware-tsc-map,vdev:,base-virtaddr,create-uio-dev,no-shconf,no-pci,no-hpet,no-huge -n ${0} -- $DPDK_OPTIONS)
+
+set -- $OPTIONS
+
+do_ovs_db dpdk-init true
+
+while true; do
+ case $1 in
+ -c) do_ovs_db dpdk-lcore-mask $2; shift 2;;
+ --socket-mem) do_ovs_db dpdk-socket-mem $2; shift 2;;
+ --) shift; break ;;
+ *)
+ if [[ ${2:-x__unset__x} != x__unset__x ]]; then
+ extra_string+="$1 $2 " && shift 2
+ else
+ extra_string+="$1 " && shift 1
+ fi
+ ;;
+ esac
+done
+
+[[ -n "$extra_string" ]] && do_ovs_db dpdk-extra "$extra_string"
+
+# And now disable DPDK_OPTIONS
+sed -i -e '/^DPDK_OPTIONS=/i \
+# ------------------------ WARNING -------------------------- \
+# DPDK options now belong to the Open vSwitch database. See \
+# man ovs-vswitchd.conf.db(5)' -e 's/^DPDK_OPTIONS=/#&/' $OVS_SYSCONFIG
+
+# Restart it so new changes take effect
+systemctl -q restart openvswitch
+
+exit 0
--
2.11.0