]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
flow-bypass: Set bypass thread to running state
authorVincent Li <vincent.mc.li@gmail.com>
Fri, 4 Aug 2023 17:49:35 +0000 (17:49 +0000)
committerVictor Julien <victor@inliniac.net>
Wed, 17 Jan 2024 16:20:26 +0000 (17:20 +0100)
When running Suricata in XDP bypass mode (bypass: yes),

Suricata started up with error:
Error: threads: thread "FB" failed to start in time: flags 0003

"FB" thread does not transition from THV_INIT_DONE to THV_RUNNING.

Set "FB" thread THV_RUNNING state in BypassedFlowManager().

Bug: #6254

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
src/flow-bypass.c

index 8dbb5ab17d748a7cfeb0caa199a9f20437a17d54..10ecf91f494e7e26e66f49d44390af9a7c90c832 100644 (file)
@@ -93,7 +93,14 @@ static TmEcode BypassedFlowManager(ThreadVars *th_v, void *thread_data)
     if (!found)
         return TM_ECODE_OK;
 
+    TmThreadsSetFlag(th_v, THV_RUNNING);
+
     while (1) {
+        if (TmThreadsCheckFlag(th_v, THV_PAUSE)) {
+            TmThreadsSetFlag(th_v, THV_PAUSED);
+            TmThreadTestThreadUnPaused(th_v);
+            TmThreadsUnsetFlag(th_v, THV_PAUSED);
+        }
         SCLogDebug("Dumping the table");
         gettimeofday(&tv, NULL);
         TIMEVAL_TO_TIMESPEC(&tv, &curtime);