]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
detect/tx: improve branch prediction
authorVictor Julien <vjulien@oisf.net>
Mon, 11 Sep 2023 15:04:15 +0000 (17:04 +0200)
committerVictor Julien <victor@inliniac.net>
Tue, 25 Feb 2025 14:49:32 +0000 (15:49 +0100)
src/detect.c

index 125b43e893583ae485ce109422ea946bf62901b3..3343033f3865b2feb7feb1578fccf7ef84d9c1ed 100644 (file)
@@ -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;