From: Victor Julien Date: Tue, 26 Sep 2023 08:10:52 +0000 (+0200) Subject: detect/content-inspect: optimize struct layout X-Git-Tag: suricata-8.0.0-beta1~1947 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=06c809573bdae364bc18d5f411037376ce391970;p=thirdparty%2Fsuricata.git detect/content-inspect: optimize struct layout Move members used by DetectEngineContentInspection() to the same cache line. --- diff --git a/src/detect.h b/src/detect.h index 2b634e7617..36e4e2ba3b 100644 --- a/src/detect.h +++ b/src/detect.h @@ -1112,6 +1112,17 @@ typedef struct DetectEngineThreadCtx_ { * points to 1 byte after the start of the last pcre match if a pcre match happened. */ uint32_t pcre_match_start_offset; + /** SPM thread context used for scanning. This has been cloned from the + * prototype held by DetectEngineCtx. */ + SpmThreadCtx *spm_thread_ctx; + + /* byte_* values */ + uint64_t *byte_values; + + uint8_t *base64_decoded; + int base64_decoded_len; + int base64_decoded_len_max; + /* counter for the filestore array below -- up here for cache reasons. */ uint16_t filestore_cnt; @@ -1177,13 +1188,6 @@ typedef struct DetectEngineThreadCtx_ { MpmThreadCtx mtc; /**< thread ctx for the mpm */ PrefilterRuleStore pmq; - /** SPM thread context used for scanning. This has been cloned from the - * prototype held by DetectEngineCtx. */ - SpmThreadCtx *spm_thread_ctx; - - /* byte_* values */ - uint64_t *byte_values; - /* string to replace */ DetectReplaceList *replist; /* vars to store in post match function */ @@ -1205,10 +1209,6 @@ typedef struct DetectEngineThreadCtx_ { int global_keyword_ctxs_size; void **global_keyword_ctxs_array; - uint8_t *base64_decoded; - int base64_decoded_len; - int base64_decoded_len_max; - AppLayerDecoderEvents *decoder_events; uint16_t events;