flow: update bypassed flows on shutdown/recycle

pull/16497/head
Philippe Antoine 3 months ago committed by Victor Julien
parent a6740d021a
commit 9ab8fa19d2

@ -1094,6 +1094,19 @@ static void Recycler(ThreadVars *tv, FlowRecyclerThreadData *ftd, Flow *f)
{
FLOWLOCK_WRLOCK(f);
#ifdef CAPTURE_OFFLOAD
// If the flow was timed out already, we already updated the stats
if ((f->flow_end_flags & FLOW_END_FLAG_TIMEOUT) == 0) {
FlowTimeoutCounters counters = { 0 };
FlowBypassedTimeout(f, TimeGet(), &counters);
// TODO use the counters to update
// like StatsCounterAddI64(&tv->stats, ftd->cnt.flow_bypassed_cnt_clo,
// (int64_t)counters.bypassed_count); same for bypassed_pkts and bypassed_bytes needs to
// check if the flow recycler thread can update these stats and give it access to the
// StatsCounterId flow_bypassed_cnt_clo and such
}
#endif
(void)OutputFlowLog(tv, ftd->output_thread_data, f);
FlowEndCountersUpdate(tv, &ftd->fec, f);

@ -407,8 +407,9 @@ static inline void FlowRemoveHash(void)
}
/* in case of additional work, we pull the flow out of the
* hash and xfer ownership to the injected packet(s) */
if (FlowNeedsReassembly(f)) {
* hash and xfer ownership to the injected packet(s)
* Bypassed flows will be handled by Recycler */
if (FlowNeedsReassembly(f) && !FlowIsBypassed(f)) {
RemoveFromHash(f, prev_f);
f->flow_end_flags |= FLOW_END_FLAG_SHUTDOWN;
FlowSendToLocalThread(f);

Loading…
Cancel
Save