flow: more accurate flow counters

Don't increment the flow timeout counter for flows that are not
really timeout (as use_cnt is non zero). And also don't take into
account bypassed flows in the counter for flow timeout in use.
pull/6324/head
Eric Leblond 4 years ago committed by Victor Julien
parent c51042e093
commit 9a4ef6b8fc

@ -392,20 +392,22 @@ static void FlowManagerHashRowTimeout(FlowManagerTimeoutThread *td,
Flow *next_flow = f->next; Flow *next_flow = f->next;
counters->flows_timeout++;
/* never prune a flow that is used by a packet we /* never prune a flow that is used by a packet we
* are currently processing in one of the threads */ * are currently processing in one of the threads */
if (f->use_cnt > 0 || !FlowBypassedTimeout(f, ts, counters)) { if (f->use_cnt > 0 || !FlowBypassedTimeout(f, ts, counters)) {
FLOWLOCK_UNLOCK(f); FLOWLOCK_UNLOCK(f);
prev_f = f; prev_f = f;
counters->flows_timeout_inuse++; if (f->use_cnt > 0) {
counters->flows_timeout_inuse++;
}
f = f->next; f = f->next;
continue; continue;
} }
f->flow_end_flags |= FLOW_END_FLAG_TIMEOUT; f->flow_end_flags |= FLOW_END_FLAG_TIMEOUT;
counters->flows_timeout++;
RemoveFromHash(f, prev_f); RemoveFromHash(f, prev_f);
FlowQueuePrivateAppendFlow(&td->aside_queue, f); FlowQueuePrivateAppendFlow(&td->aside_queue, f);

Loading…
Cancel
Save