Scripts that integrate OVS with a distribution often save and
restore flows across distruptive events, such as an upgrade. The
ovs-save utility generates a script to assist with this.

When flows include tunnel metadata, we also need to restore the
TLV mappings before the flows are re-added. Otherwise, the instance
of OVS receiving the new flows won't know the meaning of these
fields and will ignore them.

Signed-off-by: Jesse Gross <je...@kernel.org>
---
 utilities/ovs-save | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/utilities/ovs-save b/utilities/ovs-save
index d4d3c35..4ae8fde 100755
--- a/utilities/ovs-save
+++ b/utilities/ovs-save
@@ -106,6 +106,12 @@ save_flows () {
     fi
 
     for bridge in "$@"; do
+        echo -n "ovs-ofctl add-tlv-map ${bridge} '"
+        ovs-ofctl dump-tlv-map br-int | \
+        awk '/^ 0x/ {if (cnt != 0) printf ","; \
+             cnt++;printf "{class="$1",type="$2",len="$3"}->"$4}'
+        echo "'"
+
         echo "ovs-ofctl add-flows ${bridge} - << EOF"
         ovs-ofctl dump-flows "${bridge}" | sed -e '/NXST_FLOW/d' \
             -e 's/\(idle\|hard\)_age=[^,]*,//g'
-- 
2.7.4

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

Reply via email to