|
|
|
@ -110,6 +110,7 @@ typedef struct FlowTimeoutCounters_ {
|
|
|
|
|
uint32_t new;
|
|
|
|
|
uint32_t est;
|
|
|
|
|
uint32_t clo;
|
|
|
|
|
uint32_t byp;
|
|
|
|
|
uint32_t tcp_reuse;
|
|
|
|
|
|
|
|
|
|
uint32_t flows_checked;
|
|
|
|
@ -380,6 +381,10 @@ static uint32_t FlowManagerHashRowTimeout(Flow *f, struct timeval *ts,
|
|
|
|
|
case FLOW_STATE_CLOSED:
|
|
|
|
|
counters->clo++;
|
|
|
|
|
break;
|
|
|
|
|
case FLOW_STATE_LOCAL_BYPASSED:
|
|
|
|
|
case FLOW_STATE_CAPTURE_BYPASSED:
|
|
|
|
|
counters->byp++;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
counters->flows_removed++;
|
|
|
|
|
} else {
|
|
|
|
@ -555,6 +560,7 @@ typedef struct FlowManagerThreadData_ {
|
|
|
|
|
uint16_t flow_mgr_cnt_clo;
|
|
|
|
|
uint16_t flow_mgr_cnt_new;
|
|
|
|
|
uint16_t flow_mgr_cnt_est;
|
|
|
|
|
uint16_t flow_mgr_cnt_byp;
|
|
|
|
|
uint16_t flow_mgr_spare;
|
|
|
|
|
uint16_t flow_emerg_mode_enter;
|
|
|
|
|
uint16_t flow_emerg_mode_over;
|
|
|
|
@ -605,6 +611,7 @@ static TmEcode FlowManagerThreadInit(ThreadVars *t, void *initdata, void **data)
|
|
|
|
|
ftd->flow_mgr_cnt_clo = StatsRegisterCounter("flow_mgr.closed_pruned", t);
|
|
|
|
|
ftd->flow_mgr_cnt_new = StatsRegisterCounter("flow_mgr.new_pruned", t);
|
|
|
|
|
ftd->flow_mgr_cnt_est = StatsRegisterCounter("flow_mgr.est_pruned", t);
|
|
|
|
|
ftd->flow_mgr_cnt_est = StatsRegisterCounter("flow_mgr.bypassed_pruned", t);
|
|
|
|
|
ftd->flow_mgr_spare = StatsRegisterCounter("flow.spare", t);
|
|
|
|
|
ftd->flow_emerg_mode_enter = StatsRegisterCounter("flow.emerg_mode_entered", t);
|
|
|
|
|
ftd->flow_emerg_mode_over = StatsRegisterCounter("flow.emerg_mode_over", t);
|
|
|
|
@ -691,7 +698,7 @@ static TmEcode FlowManager(ThreadVars *th_v, void *thread_data)
|
|
|
|
|
FlowUpdateSpareFlows();
|
|
|
|
|
|
|
|
|
|
/* try to time out flows */
|
|
|
|
|
FlowTimeoutCounters counters = { 0, 0, 0, 0, 0,0,0,0,0,0,0,0,0,0,};
|
|
|
|
|
FlowTimeoutCounters counters = { 0, 0, 0, 0, 0,0,0,0,0,0,0,0,0,0,0};
|
|
|
|
|
FlowTimeoutHash(&ts, 0 /* check all */, ftd->min, ftd->max, &counters);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -711,6 +718,7 @@ static TmEcode FlowManager(ThreadVars *th_v, void *thread_data)
|
|
|
|
|
StatsAddUI64(th_v, ftd->flow_mgr_cnt_clo, (uint64_t)counters.clo);
|
|
|
|
|
StatsAddUI64(th_v, ftd->flow_mgr_cnt_new, (uint64_t)counters.new);
|
|
|
|
|
StatsAddUI64(th_v, ftd->flow_mgr_cnt_est, (uint64_t)counters.est);
|
|
|
|
|
StatsAddUI64(th_v, ftd->flow_mgr_cnt_byp, (uint64_t)counters.byp);
|
|
|
|
|
StatsAddUI64(th_v, ftd->flow_tcp_reuse, (uint64_t)counters.tcp_reuse);
|
|
|
|
|
|
|
|
|
|
StatsSetUI64(th_v, ftd->flow_mgr_flows_checked, (uint64_t)counters.flows_checked);
|
|
|
|
@ -1363,7 +1371,7 @@ static int FlowMgrTest05 (void)
|
|
|
|
|
struct timeval ts;
|
|
|
|
|
TimeGet(&ts);
|
|
|
|
|
/* try to time out flows */
|
|
|
|
|
FlowTimeoutCounters counters = { 0, 0, 0, 0, 0,0,0,0,0,0,0,0,0,0,};
|
|
|
|
|
FlowTimeoutCounters counters = { 0, 0, 0, 0, 0,0,0,0,0,0,0,0,0,0,0};
|
|
|
|
|
FlowTimeoutHash(&ts, 0 /* check all */, 0, flow_config.hash_size, &counters);
|
|
|
|
|
|
|
|
|
|
if (flow_recycle_q.len > 0) {
|
|
|
|
|