diff options
author | Han Zhou <zhouhan@gmail.com> | 2018-08-06 19:44:02 -0700 |
---|---|---|
committer | Ben Pfaff <blp@ovn.org> | 2018-08-07 15:19:13 -0700 |
commit | fdf541d482983426c593449a488fc2baf4604e8e (patch) | |
tree | 5a32be76f653be5d65b023a15fee21f9e2141a24 | |
parent | 5cf668728a7411d22c27f31aacda776a781f56b5 (diff) | |
download | openvswitch-fdf541d482983426c593449a488fc2baf4604e8e.tar.gz |
ovn-trace: Fix warnings when port is found but not in current datapath.
When port group is used, ovn-trace may print warnings like this:
$ ovn-trace ls1 'inport == "lp111" && eth.src == f0:00:00:00:01:11 && eth.dst == f0:00:00:00:01:12 && ip4.src == 192.168.11.1 && ip4.dst == 192.168.11.2 && ip.ttl == 10'
2018-08-02T01:43:23Z|00001|ovntrace|WARN|lp211: not in datapath ls1
2018-08-02T01:43:23Z|00002|ovntrace|WARN|lp211: unknown logical port
2018-08-02T01:43:23Z|00003|ovntrace|WARN|lp221: not in datapath ls1
2018-08-02T01:43:23Z|00004|ovntrace|WARN|lp221: unknown logical port
2018-08-02T01:43:23Z|00005|ovntrace|WARN|lp231: not in datapath ls1
2018-08-02T01:43:23Z|00006|ovntrace|WARN|lp231: unknown logical port
There are 2 warnings:
For the first one, it might be reasonable
before port group is supported, but now since ports in a port group
can span across multiple datapaths, this situation is normal, and
warning should not be printed.
For the second one, it is misleading, and it should not be printed
in this situation even before port group is supported. It should be
printed only if the port is not found at all.
This patch fixes both.
Signed-off-by: Han Zhou <hzhou8@ebay.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Mark Michelson <mmichels@redhat.com>
-rw-r--r-- | ovn/utilities/ovn-trace.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/ovn/utilities/ovn-trace.c b/ovn/utilities/ovn-trace.c index 1fd48f22e..7ca3d97aa 100644 --- a/ovn/utilities/ovn-trace.c +++ b/ovn/utilities/ovn-trace.c @@ -1020,7 +1020,9 @@ ovntrace_lookup_port(const void *dp_, const char *port_name, *portp = port->tunnel_key; return true; } - VLOG_WARN("%s: not in datapath %s", port_name, dp->name); + /* The port is found but not in this datapath. It happens when port + * group is used in match conditions. */ + return false; } const struct ovntrace_mcgroup *mcgroup = ovntrace_mcgroup_find_by_name(dp, port_name); |