[ovs-dev,RFC,2/2] rhel: tell ovsctl to freeze the datapath

Message ID 20180112191935.1589-3-aconole@redhat.com
State RFC
Headers show
Series
  • 'Graceful restart' of OvS
Related show

Commit Message

Aaron Conole Jan. 12, 2018, 7:19 p.m.
This commit uses the previous to stop it from deleting active flows in the
datapath.

Signed-off-by: Aaron Conole <aconole@redhat.com>
---
 rhel/usr_lib_systemd_system_ovs-vswitchd.service.in | 2 +-
 utilities/ovs-ctl.in                                | 4 ++++
 2 files changed, 5 insertions(+), 1 deletion(-)

Patch

diff --git a/rhel/usr_lib_systemd_system_ovs-vswitchd.service.in b/rhel/usr_lib_systemd_system_ovs-vswitchd.service.in
index c6d9aa1b8..4c0703b23 100644
--- a/rhel/usr_lib_systemd_system_ovs-vswitchd.service.in
+++ b/rhel/usr_lib_systemd_system_ovs-vswitchd.service.in
@@ -23,7 +23,7 @@  ExecStart=/usr/share/openvswitch/scripts/ovs-ctl \
           start $OPTIONS
 ExecStop=/usr/share/openvswitch/scripts/ovs-ctl --no-ovsdb-server stop
 ExecReload=/usr/share/openvswitch/scripts/ovs-ctl --no-ovsdb-server \
-          --no-monitor --system-id=random \
+          --no-monitor --system-id=random --freeze-datapath \
           --ovs-user=${OVS_USER_ID} \
           restart $OPTIONS
 TimeoutSec=300
diff --git a/utilities/ovs-ctl.in b/utilities/ovs-ctl.in
index f1b01d1d3..3e02613eb 100755
--- a/utilities/ovs-ctl.in
+++ b/utilities/ovs-ctl.in
@@ -306,6 +306,9 @@  ovs_save () {
 }
 
 save_flows_if_required () {
+    if test X"$FREEZE_DATAPATH" != Xyes; then
+        action "Freezing datapath" ovs-appctl dpctl/datapath-icing system@ovs-system enabled
+    fi
     if test X"$DELETE_BRIDGES" != Xyes; then
         action "Saving flows" ovs_save save-flows "${script_flows}"
     fi
@@ -494,6 +497,7 @@  set_defaults () {
 
     DELETE_BRIDGES=no
     DELETE_TRANSIENT_PORTS=no
+    FREEZE_DATAPATH=no
 
     DAEMON_CWD=/
     FORCE_COREFILES=yes