From e892d99827be4422dbd3c42847551eeafac80240 Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Wed, 30 Apr 2014 12:30:30 +0200 Subject: [PATCH] flow: new flow queue: flow_recycle_q This queue will be used by the FlowManager to pass timed out flows to another thread that will do the actual cleanup. --- src/flow-private.h | 3 +++ src/flow.c | 2 ++ 2 files changed, 5 insertions(+) diff --git a/src/flow-private.h b/src/flow-private.h index fc26e04f60..bd25960b2b 100644 --- a/src/flow-private.h +++ b/src/flow-private.h @@ -78,6 +78,9 @@ FlowProto flow_proto[FLOW_PROTO_MAX]; /** spare/unused/prealloced flows live here */ FlowQueue flow_spare_q; +/** queue to pass flows to cleanup/log thread(s) */ +FlowQueue flow_recycle_q; + FlowBucket *flow_hash; FlowConfig flow_config; diff --git a/src/flow.c b/src/flow.c index 9f9e2bd4bd..b18697bd1b 100644 --- a/src/flow.c +++ b/src/flow.c @@ -304,6 +304,7 @@ void FlowInitConfig(char quiet) SC_ATOMIC_INIT(flow_memuse); SC_ATOMIC_INIT(flow_prune_idx); FlowQueueInit(&flow_spare_q); + FlowQueueInit(&flow_recycle_q); unsigned int seed = RandomTimePreseed(); /* set defaults */ @@ -470,6 +471,7 @@ void FlowShutdown(void) } (void) SC_ATOMIC_SUB(flow_memuse, flow_config.hash_size * sizeof(FlowBucket)); FlowQueueDestroy(&flow_spare_q); + FlowQueueDestroy(&flow_recycle_q); SC_ATOMIC_DESTROY(flow_prune_idx); SC_ATOMIC_DESTROY(flow_memuse);