Skip to content
  • Ben Pfaff's avatar
    ovs-ofctl: Avoid unnecessary flow replacement in "replace-flows" command. · 6cc9d77c
    Ben Pfaff authored
    The ovs-ofctl "diff-flows" and "replace-flows" command compare the flows
    in two flow tables.  Until now, the "replace-flows" command has considered
    certain almost meaningless differences related to the version of OpenFlow
    used to add a flow as significant, which caused it to replace a flow by an
    identical-in-practice version, e.g. in the following, the "replace-flows"
    command prints a FLOW_MOD that adds the flow that was already added
    previously:
    
        $ cat > flows
        actions=resubmit(,1)
        $ ovs-vsctl add-br br0
        $ ovs-ofctl del-flows br0
        $ ovs-ofctl add-flows br0 flows
        $ ovs-ofctl -vvconn replace-flows br0 flows 2>&1 | grep FLOW_MOD
    
    Re-adding an existing flow has some effects, for example, it resets the
    flow's duration, so it's better to avoid it.
    
    This commit fixes the problem using the same trick previously used for a
    similar problem with the "diff-flows" command, which was fixed in commit
    98f7f427
    
     ("ovs-ofctl: Avoid printing false differences on "ovs-ofctl
    diff-flows".").
    
    Reported-by: default avatarKevin Lin <kevin@quilt.io>
    Signed-off-by: default avatarBen Pfaff <blp@ovn.org>
    Acked-by: default avatarAndy Zhou <azhou@ovn.org>
    6cc9d77c