flow_to_string() is relatively expensive. It is better to avoid it if the string is not actually going to be used.
Signed-off-by: Ben Pfaff <b...@ovn.org> --- ofproto/tunnel.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/ofproto/tunnel.c b/ofproto/tunnel.c index 1676f4d46fdf..9896d715a6f7 100644 --- a/ofproto/tunnel.c +++ b/ofproto/tunnel.c @@ -309,10 +309,11 @@ tnl_port_receive(const struct flow *flow) OVS_EXCLUDED(rwlock) tnl_port = tnl_find(flow); ofport = tnl_port ? tnl_port->ofport : NULL; if (!tnl_port) { - char *flow_str = flow_to_string(flow, NULL); - - VLOG_WARN_RL(&rl, "receive tunnel port not found (%s)", flow_str); - free(flow_str); + if (!VLOG_DROP_WARN(&rl)) { + char *flow_str = flow_to_string(flow, NULL); + VLOG_WARN("receive tunnel port not found (%s)", flow_str); + free(flow_str); + } goto out; } -- 2.10.2 _______________________________________________ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev