diff options
author | Flavio Leitner <fbl@redhat.com> | 2020-09-30 16:23:59 -0300 |
---|---|---|
committer | Ilya Maximets <i.maximets@ovn.org> | 2020-10-08 16:44:44 +0200 |
commit | b0672f4ba23a0201553d78ada964aec5e9b5b13b (patch) | |
tree | f21ba35ad69638de97072db06aa1d04a0a900259 /ofproto | |
parent | cade1c4642064f472b9c9796fc4194fbe13a3789 (diff) | |
download | openvswitch-b0672f4ba23a0201553d78ada964aec5e9b5b13b.tar.gz |
ofproto-dpif-upcall: Log the emergency flow flush.
When the number of flows in the datapath reaches twice the
maximum, revalidators will delete all flows as an emergency
action to recover. In that case, log a message with values
and increase a coverage counter.
Signed-off-by: Flavio Leitner <fbl@redhat.com>
Acked-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
Diffstat (limited to 'ofproto')
-rw-r--r-- | ofproto/ofproto-dpif-upcall.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/ofproto/ofproto-dpif-upcall.c b/ofproto/ofproto-dpif-upcall.c index 195b01c13..e022fde27 100644 --- a/ofproto/ofproto-dpif-upcall.c +++ b/ofproto/ofproto-dpif-upcall.c @@ -57,6 +57,7 @@ COVERAGE_DEFINE(upcall_ukey_contention); COVERAGE_DEFINE(upcall_ukey_replace); COVERAGE_DEFINE(revalidate_missed_dp_flow); COVERAGE_DEFINE(upcall_flow_limit_hit); +COVERAGE_DEFINE(upcall_flow_limit_kill); /* A thread that reads upcalls from dpif, forwards each upcall's packet, * and possibly sets up a kernel flow as a cache. */ @@ -2607,6 +2608,7 @@ revalidate(struct revalidator *revalidator) struct udpif *udpif = revalidator->udpif; struct dpif_flow_dump_thread *dump_thread; uint64_t dump_seq, reval_seq; + bool kill_warn_print = true; unsigned int flow_limit; dump_seq = seq_read(udpif->dump_seq); @@ -2623,6 +2625,7 @@ revalidate(struct revalidator *revalidator) long long int max_idle; long long int now; + size_t kill_all_limit; size_t n_dp_flows; bool kill_them_all; @@ -2650,7 +2653,23 @@ revalidate(struct revalidator *revalidator) COVERAGE_INC(upcall_flow_limit_hit); } - kill_them_all = n_dp_flows > flow_limit * 2; + kill_them_all = false; + kill_all_limit = flow_limit * 2; + if (OVS_UNLIKELY(n_dp_flows > kill_all_limit)) { + static struct vlog_rate_limit rlem = VLOG_RATE_LIMIT_INIT(1, 1); + + kill_them_all = true; + COVERAGE_INC(upcall_flow_limit_kill); + if (kill_warn_print) { + kill_warn_print = false; + VLOG_WARN_RL(&rlem, + "Number of datapath flows (%"PRIuSIZE") twice as high as " + "current dynamic flow limit (%"PRIuSIZE"). " + "Starting to delete flows unconditionally " + "as an emergency measure.", n_dp_flows, kill_all_limit); + } + } + max_idle = n_dp_flows > flow_limit ? 100 : ofproto_max_idle; udpif->dpif->current_ms = time_msec(); |