From fdf541d482983426c593449a488fc2baf4604e8e Mon Sep 17 00:00:00 2001 From: Han Zhou Date: Mon, 6 Aug 2018 19:44:02 -0700 Subject: 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 Signed-off-by: Ben Pfaff Acked-by: Mark Michelson --- ovn/utilities/ovn-trace.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'ovn/utilities') 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); -- cgit v1.2.1