summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorBen Pfaff <blp@ovn.org>2017-07-06 16:40:30 -0700
committerBen Pfaff <blp@ovn.org>2017-08-03 13:52:37 -0700
commit6cc9d77c78f684c3f01a2ca66691b08bf9bec791 (patch)
tree6b9e199e7e100006c5c6166c0ba7f0c73153ecf9 /include
parent2142be1f91af9650d3e95e2ebfe1428c65c761b8 (diff)
downloadopenvswitch-6cc9d77c78f684c3f01a2ca66691b08bf9bec791.tar.gz
ovs-ofctl: Avoid unnecessary flow replacement in "replace-flows" command.
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 98f7f427bf8b ("ovs-ofctl: Avoid printing false differences on "ovs-ofctl diff-flows"."). Reported-by: Kevin Lin <kevin@quilt.io> Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Andy Zhou <azhou@ovn.org>
Diffstat (limited to 'include')
-rw-r--r--include/openvswitch/ofp-actions.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/openvswitch/ofp-actions.h b/include/openvswitch/ofp-actions.h
index 4357f4e28..ad8e1bec0 100644
--- a/include/openvswitch/ofp-actions.h
+++ b/include/openvswitch/ofp-actions.h
@@ -1050,6 +1050,8 @@ bool ofpacts_output_to_group(const struct ofpact[], size_t ofpacts_len,
uint32_t group_id);
bool ofpacts_equal(const struct ofpact a[], size_t a_len,
const struct ofpact b[], size_t b_len);
+bool ofpacts_equal_stringwise(const struct ofpact a[], size_t a_len,
+ const struct ofpact b[], size_t b_len);
const struct mf_field *ofpact_get_mf_dst(const struct ofpact *ofpact);
uint32_t ofpacts_get_meter(const struct ofpact[], size_t ofpacts_len);