]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
threading: improve/add thread queues explanations
authorVictor Julien <vjulien@oisf.net>
Sat, 22 Oct 2022 12:33:05 +0000 (14:33 +0200)
committerVictor Julien <vjulien@oisf.net>
Tue, 25 Oct 2022 08:39:10 +0000 (10:39 +0200)
src/flow-worker.c
src/threadvars.h
src/tm-threads.c

index a14b4c35233c80ff4e437c292404378665cc3d89..9ddb34773b4601a453131a53d64f53470429c407 100644 (file)
@@ -78,7 +78,8 @@ typedef struct FlowWorkerThreadData_ {
     uint16_t local_bypass_bytes;
     uint16_t both_bypass_pkts;
     uint16_t both_bypass_bytes;
-
+    /** Queue to put pseudo packets that have been created by the stream (RST response) and by the
+     * flush logic following a protocol change. */
     PacketQueueNoLock pq;
     FlowLookupStruct fls;
 
@@ -401,7 +402,7 @@ static inline void FlowWorkerStreamTCPUpdate(ThreadVars *tv, FlowWorkerThreadDat
         if (timeout) {
             PacketPoolReturnPacket(x);
         } else {
-            /* put these packets in the preq queue so that they are
+            /* put these packets in the decode queue so that they are processed
              * by the other thread modules before packet 'p'. */
             PacketEnqueueNoLock(&tv->decode_pq, x);
         }
index 3827a73fe72a82a804a78aac2f7addce925e45df..1d866073c9f7210be775514c4c0c34209000e923 100644 (file)
@@ -104,8 +104,10 @@ typedef struct ThreadVars_ {
     void *outctx;
     void (*tmqh_out)(struct ThreadVars_ *, struct Packet_ *);
 
-    /** queue for decoders to temporarily store extra packets they
-     *  generate. */
+    /** Queue for decoders to temporarily store extra packets they
+     *  generate. These packets are generated as part of the tunnel
+     *  handling, and are processed directly after the "real" packet
+     *  from the current position in the pipeline. */
     PacketQueueNoLock decode_pq;
 
     /** Stream packet queue for flow time out injection. Either a pointer to the
index 7bd6cfa8bcb519c3c524e6f6142914a0b1119067..4ae4aade2b1ee35f23975a989f7dacd245ddc153 100644 (file)
@@ -125,7 +125,7 @@ TmEcode TmThreadsSlotVarRun(ThreadVars *tv, Packet *p, TmSlot *slot)
             return TM_ECODE_FAILED;
         }
 
-        /* handle new packets */
+        /* handle new pseudo packets immediately */
         while (tv->decode_pq.top != NULL) {
             Packet *extra_p = PacketDequeueNoLock(&tv->decode_pq);
             if (unlikely(extra_p == NULL))