Message ID | 1472591796-80057-1-git-send-email-jesse@kernel.org |
---|---|
State | Accepted |
Headers | show |
On Tue, Aug 30, 2016 at 02:16:36PM -0700, Jesse Gross wrote: > 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 <jesse@kernel.org> Good catch. Acked-by: Ben Pfaff <blp@ovn.org>
On Tue, Aug 30, 2016 at 3:34 PM, Ben Pfaff <blp@ovn.org> wrote: > On Tue, Aug 30, 2016 at 02:16:36PM -0700, Jesse Gross wrote: >> 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 <jesse@kernel.org> > > Good catch. > > Acked-by: Ben Pfaff <blp@ovn.org> Applied to master, branch-2.6, and branch-2.5 as well.
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'
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 <jesse@kernel.org> --- utilities/ovs-save | 6 ++++++ 1 file changed, 6 insertions(+)