diff options
author | Ben Pfaff <blp@ovn.org> | 2017-12-28 12:34:48 -0800 |
---|---|---|
committer | Ben Pfaff <blp@ovn.org> | 2018-01-04 10:28:47 -0800 |
commit | 3194a7906c97752782c1fd6fedcc5117e2b6e3b0 (patch) | |
tree | b9b04d82f04991052553fc961c6c5fe5084b0a37 /ofproto/tunnel.c | |
parent | 77b7d23230fecf774c2a707b7b42fdb8a65a8892 (diff) | |
download | openvswitch-3194a7906c97752782c1fd6fedcc5117e2b6e3b0.tar.gz |
tunnel: Avoid flow_to_string() call when rate-limited.
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 <blp@ovn.org>
Reviewed-by: Yifeng Sun <pkusunyifeng@gmail.com>
Acked-by: Ansis Atteka <aatteka@ovn.org>
Diffstat (limited to 'ofproto/tunnel.c')
-rw-r--r-- | ofproto/tunnel.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/ofproto/tunnel.c b/ofproto/tunnel.c index 1676f4d46..9896d715a 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; } |