From 1884227019183241b538587cb81c668f94a6c834 Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Fri, 17 Apr 2015 11:21:54 +0200 Subject: [PATCH] autofp: reduce flow storage space requirement Use int16_t instead of a regular int to safe 2 bytes per flow. --- src/flow.h | 2 +- src/tmqh-flow.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) 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;