From 06c809573bdae364bc18d5f411037376ce391970 Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Tue, 26 Sep 2023 10:10:52 +0200 Subject: [PATCH] detect/content-inspect: optimize struct layout Move members used by DetectEngineContentInspection() to the same cache line. --- src/detect.h | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) 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; -- 2.47.2