summaryrefslogtreecommitdiff
path: root/ovn/utilities
diff options
context:
space:
mode:
authorBen Pfaff <blp@ovn.org>2018-01-05 16:59:13 -0800
committerBen Pfaff <blp@ovn.org>2018-02-01 10:08:32 -0800
commit4bc938ccb3124282c873084a7d11cd8bc37e27a7 (patch)
tree1e890e37284ea4a4f4618d073e064b2a194d244a /ovn/utilities
parenta203f653b1a6a2544603be00966b8d4731d91b69 (diff)
downloadopenvswitch-4bc938ccb3124282c873084a7d11cd8bc37e27a7.tar.gz
Support accepting and displaying table names in OVS tools.
OpenFlow has little-known support for naming tables. Open vSwitch has supported table names for ages, but it has never used or displayed them outside of commands dedicated to table manipulation. This commit adds support for table names in ovs-ofctl. When a table has a name, it displays that name in flows and actions, so that, for example, the following: table=1, arp, actions=resubmit(,2) might become: table=ingress_acl, arp, actions=resubmit(,mac_learning) given appropriately named tables. For backward compatibility, only interactive ovs-ofctl commands by default display table names; to display them in scripts, use the new --names option. This feature was inspired by a talk that Kei Nohguchi presented at Open vSwitch 2017 Fall Conference. CC: Kei Nohguchi <kei@nohguchi.com> Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Mark Michelson <mmichels@redhat.com> Reviewed-by: Yifeng Sun <pkusunyifeng@gmail.com>
Diffstat (limited to 'ovn/utilities')
-rw-r--r--ovn/utilities/ovn-sbctl.c2
-rw-r--r--ovn/utilities/ovn-trace.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/ovn/utilities/ovn-sbctl.c b/ovn/utilities/ovn-sbctl.c
index 0cb8ea480..dc56d864c 100644
--- a/ovn/utilities/ovn-sbctl.c
+++ b/ovn/utilities/ovn-sbctl.c
@@ -796,7 +796,7 @@ sbctl_dump_openflow(struct vconn *vconn, const struct uuid *uuid, bool stats)
ds_clear(&s);
if (stats) {
- ofp_print_flow_stats(&s, fs, NULL, true);
+ ofp_print_flow_stats(&s, fs, NULL, NULL, true);
} else {
ds_put_format(&s, "%stable=%s%"PRIu8" ",
colors.special, colors.end, fs->table_id);
diff --git a/ovn/utilities/ovn-trace.c b/ovn/utilities/ovn-trace.c
index 06d4ddf8e..7e88594fa 100644
--- a/ovn/utilities/ovn-trace.c
+++ b/ovn/utilities/ovn-trace.c
@@ -1936,7 +1936,7 @@ trace_openflow(const struct ovntrace_flow *f, struct ovs_list *super)
struct ds s = DS_EMPTY_INITIALIZER;
for (size_t i = 0; i < n_fses; i++) {
ds_clear(&s);
- ofp_print_flow_stats(&s, &fses[i], NULL, true);
+ ofp_print_flow_stats(&s, &fses[i], NULL, NULL, true);
ovntrace_node_append(super, OVNTRACE_NODE_ACTION,
"%s", ds_cstr(&s));
}