From: Victor Julien Date: Fri, 17 Apr 2015 09:21:54 +0000 (+0200) Subject: autofp: reduce flow storage space requirement X-Git-Tag: suricata-2.1beta4~47 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1884227019183241b538587cb81c668f94a6c834;p=thirdparty%2Fsuricata.git autofp: reduce flow storage space requirement Use int16_t instead of a regular int to safe 2 bytes per flow. --- diff --git a/src/flow.h b/src/flow.h index b772986db6..79147112b0 100644 --- a/src/flow.h +++ b/src/flow.h @@ -326,7 +326,7 @@ typedef struct Flow_ SC_ATOMIC_DECLARE(FlowRefCount, use_cnt); /** flow queue id, used with autofp */ - SC_ATOMIC_DECLARE(int, autofp_tmqh_flow_qid); + SC_ATOMIC_DECLARE(int16_t, autofp_tmqh_flow_qid); uint32_t probing_parser_toserver_alproto_masks; uint32_t probing_parser_toclient_alproto_masks; diff --git a/src/tmqh-flow.c b/src/tmqh-flow.c index cebd34429f..1ec4bec526 100644 --- a/src/tmqh-flow.c +++ b/src/tmqh-flow.c @@ -229,7 +229,7 @@ void TmqhOutputFlowFreeCtx(void *ctx) */ void TmqhOutputFlowRoundRobin(ThreadVars *tv, Packet *p) { - int32_t qid = 0; + int16_t qid = 0; TmqhFlowCtx *ctx = (TmqhFlowCtx *)tv->outctx; @@ -271,7 +271,7 @@ void TmqhOutputFlowRoundRobin(ThreadVars *tv, Packet *p) */ void TmqhOutputFlowActivePackets(ThreadVars *tv, Packet *p) { - int32_t qid = 0; + int16_t qid = 0; TmqhFlowCtx *ctx = (TmqhFlowCtx *)tv->outctx; @@ -319,7 +319,7 @@ void TmqhOutputFlowActivePackets(ThreadVars *tv, Packet *p) */ void TmqhOutputFlowHash(ThreadVars *tv, Packet *p) { - int32_t qid = 0; + int16_t qid = 0; TmqhFlowCtx *ctx = (TmqhFlowCtx *)tv->outctx;