]> git.ipfire.org Git - thirdparty/snort3.git/commitdiff
Merge pull request #1356 in SNORT/snort3 from offload_latency to master
authorMichael Altizer (mialtize) <mialtize@cisco.com>
Tue, 11 Sep 2018 22:52:05 +0000 (18:52 -0400)
committerMichael Altizer (mialtize) <mialtize@cisco.com>
Tue, 11 Sep 2018 22:52:05 +0000 (18:52 -0400)
Squashed commit of the following:

commit dd1db94f1e3c8a74f64c7f08912507b358646123
Author: Carter Waxman <cwaxman@cisco.com>
Date:   Fri Sep 7 12:37:37 2018 -0400

    Latency: added cleanup for RegexOffload threads

src/detection/regex_offload.cc
src/detection/regex_offload.h
src/latency/packet_latency.cc
src/latency/rule_latency.cc

index 9163ff5299b16503e7c54d563e8f05b367165df3..57986b52b2eaf86c9388f838b62a2d96f732aebb 100644 (file)
@@ -34,6 +34,8 @@
 #include <thread>
 
 #include "main/snort_config.h"
+#include "latency/packet_latency.h"
+#include "latency/rule_latency.h"
 #include "fp_detect.h"
 #include "ips_context.h"
 
@@ -112,6 +114,14 @@ void RegexOffload::worker(RegexRequest* req)
 
         req->offload = false;
     }
+    tterm();
+}
+
+void RegexOffload::tterm()
+{
+    // FIXIT-M break this overcoupling. In reality we shouldn't be evaluating latency in offload.
+    PacketLatency::tterm();
+    RuleLatency::tterm();
 }
 
 void RegexOffload::put(unsigned id, snort::Packet* p)
index e12d21942154cb34831301acee288180f47726af..198071569b0d68a5889bb8826db0abde7cc433e8 100644 (file)
@@ -62,6 +62,7 @@ public:
 
 private:
     static void worker(RegexRequest*);
+    static void tterm();
 
 private:
     std::list<RegexRequest*> busy;
index ace4331be2e4428425b3606b6c44cd4cb8ee3f20..1aeec41e21f1835d4dbd7e10e10af9056435e4bb 100644 (file)
@@ -204,6 +204,7 @@ static struct SnortLogHandler : public EventHandler
 
 static THREAD_LOCAL Impl<>* impl = nullptr;
 
+// FIXIT-L this should probably be put in a tinit
 static inline Impl<>& get_impl()
 {
     if ( !impl )
index 234635da0b0810acfd2ac6ddc4f0894e26d0df05..c70b2472f5c02c03eac9dd0f38847b7d7e53bf28 100644 (file)
@@ -323,6 +323,7 @@ static struct SnortLogHandler : public EventHandler
 
 static THREAD_LOCAL Impl<>* impl = nullptr;
 
+// FIXIT-L this should probably be put in a tinit
 static inline Impl<>& get_impl()
 {
     if ( !impl )