]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
autofp: reduce flow storage space requirement
authorVictor Julien <victor@inliniac.net>
Fri, 17 Apr 2015 09:21:54 +0000 (11:21 +0200)
committerVictor Julien <victor@inliniac.net>
Fri, 24 Apr 2015 10:32:31 +0000 (12:32 +0200)
Use int16_t instead of a regular int to safe 2 bytes per flow.

src/flow.h
src/tmqh-flow.c

index b772986db6d1fa338591e9621de97f29c868257a..79147112b0096eef24540c192bc048cf6a523f8a 100644 (file)
@@ -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;
index cebd34429f4cc1935285afdf7d2cc426d0422a07..1ec4bec526b933be27bff5188d1bbc62a9e8e834 100644 (file)
@@ -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;