]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
decode: optimize DecodeThreadVars layout
authorVictor Julien <victor@inliniac.net>
Sat, 30 May 2015 09:48:34 +0000 (11:48 +0200)
committerVictor Julien <victor@inliniac.net>
Wed, 10 Jun 2015 10:35:46 +0000 (12:35 +0200)
Put common counters on the first cache line. Please the flow output
pointer last as it's use depends on the flow logging being enabled
and even then it's only called very rarely.

src/decode.h

index a07b24bd8ba9f3bb058f11db979b7ad6514f5711..1c1bba5f54dd495108c35f30ba6ab7c36c7347c1 100644 (file)
@@ -581,24 +581,26 @@ typedef struct DecodeThreadVars_
 
     int vlan_disabled;
 
-    /* thread data for flow logging api */
-    void *output_flow_thread_data;
-
     /** stats/counters */
     uint16_t counter_pkts;
     uint16_t counter_bytes;
+    uint16_t counter_avg_pkt_size;
+    uint16_t counter_max_pkt_size;
+
     uint16_t counter_invalid;
+
+    uint16_t counter_eth;
     uint16_t counter_ipv4;
     uint16_t counter_ipv6;
-    uint16_t counter_eth;
-    uint16_t counter_sll;
-    uint16_t counter_raw;
-    uint16_t counter_null;
     uint16_t counter_tcp;
     uint16_t counter_udp;
-    uint16_t counter_sctp;
     uint16_t counter_icmpv4;
     uint16_t counter_icmpv6;
+
+    uint16_t counter_sll;
+    uint16_t counter_raw;
+    uint16_t counter_null;
+    uint16_t counter_sctp;
     uint16_t counter_ppp;
     uint16_t counter_gre;
     uint16_t counter_vlan;
@@ -608,8 +610,6 @@ typedef struct DecodeThreadVars_
     uint16_t counter_mpls;
     uint16_t counter_ipv4inipv6;
     uint16_t counter_ipv6inipv6;
-    uint16_t counter_avg_pkt_size;
-    uint16_t counter_max_pkt_size;
     uint16_t counter_erspan;
 
     /** frag stats - defrag runs in the context of the decoder. */
@@ -621,6 +621,10 @@ typedef struct DecodeThreadVars_
     uint16_t counter_defrag_ipv6_timeouts;
     uint16_t counter_defrag_max_hit;
 
+    /* thread data for flow logging api: only used at forced
+     * flow recycle during lookups */
+    void *output_flow_thread_data;
+
 #ifdef __SC_CUDA_SUPPORT__
     CudaThreadVars cuda_vars;
 #endif