From: Victor Julien Date: Mon, 11 Sep 2023 15:04:15 +0000 (+0200) Subject: detect/tx: improve branch prediction X-Git-Tag: suricata-8.0.0-beta1~374 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=39b030b7912898bb4ea69830060af5f1d1133ea0;p=thirdparty%2Fsuricata.git detect/tx: improve branch prediction --- diff --git a/src/detect.c b/src/detect.c index 125b43e893..3343033f38 100644 --- a/src/detect.c +++ b/src/detect.c @@ -1328,14 +1328,14 @@ static DetectTransaction GetDetectTx(const uint8_t ipproto, const AppProto alpro } uint64_t detect_flags = (flow_flags & STREAM_TOSERVER) ? txd->detect_flags_ts : txd->detect_flags_tc; - if (detect_flags & APP_LAYER_TX_INSPECTED_FLAG) { + if (unlikely(detect_flags & APP_LAYER_TX_INSPECTED_FLAG)) { SCLogDebug("%"PRIu64" tx already fully inspected for %s. Flags %016"PRIx64, tx_id, flow_flags & STREAM_TOSERVER ? "toserver" : "toclient", detect_flags); DetectTransaction no_tx = NO_TX; return no_tx; } - if (detect_flags & APP_LAYER_TX_SKIP_INSPECT_FLAG) { + if (unlikely(detect_flags & APP_LAYER_TX_SKIP_INSPECT_FLAG)) { SCLogDebug("%" PRIu64 " tx should not be inspected in direction %s. Flags %016" PRIx64, tx_id, flow_flags & STREAM_TOSERVER ? "toserver" : "toclient", detect_flags); DetectTransaction no_tx = NO_TX;