summaryrefslogtreecommitdiff
path: root/ofproto
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 /ofproto
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 'ofproto')
-rw-r--r--ofproto/ofproto-dpif.c4
-rw-r--r--ofproto/ofproto.c2
2 files changed, 2 insertions, 4 deletions
diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c
index 329a77582..16aeaec90 100644
--- a/ofproto/ofproto-dpif.c
+++ b/ofproto/ofproto-dpif.c
@@ -1734,11 +1734,9 @@ flush(struct ofproto *ofproto_)
static void
query_tables(struct ofproto *ofproto,
- struct ofputil_table_features *features,
+ struct ofputil_table_features *features OVS_UNUSED,
struct ofputil_table_stats *stats)
{
- strcpy(features->name, "classifier");
-
if (stats) {
int i;
diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c
index 6e360a8fc..02dd12b50 100644
--- a/ofproto/ofproto.c
+++ b/ofproto/ofproto.c
@@ -3221,7 +3221,7 @@ query_tables(struct ofproto *ofproto,
struct ofputil_table_features *f = &features[i];
f->table_id = i;
- sprintf(f->name, "table%d", i);
+ f->name[0] = '\0';
f->metadata_match = OVS_BE64_MAX;
f->metadata_write = OVS_BE64_MAX;
atomic_read_relaxed(&ofproto->tables[i].miss_config, &f->miss_config);