Eric Leblond
073b251df7
affinity: drop capability after setting thread prio
...
Setting thread priority can require privilege if a low nice value
has to be set up.
13 years ago
Eric Leblond
efc3faaa0a
affinity: add log message
13 years ago
Eric Leblond
16bdcbeb0e
tm-thread: suppress rarely used variable.
13 years ago
Eric Leblond
7e09cdc265
Delay Detect threads initialization
...
This patch modifies the init of Detect threads. They are now started
with a dummy function and their initialisation is done after the
signatures are loaded. Just after this, the dummy function is switched
to normal one.
In IPS mode, this permit to route packets without waiting for the
signature to start and should fix #488 .
Offline mode such as pcap file don't use this mode to be sure to
analyse all packets in the file.
The patch introduces a "delayed-detect" configuration variable
under detect-engine. It can be used to activate the feature
(set to "yes" to have signature loaded after capture is started).
13 years ago
Anoop Saldanha
5f198e3a1d
Suricata shutdown updates + minor cleanup
13 years ago
Eric Leblond
452d3c4308
tm-thread: exit loop if suri want to quit
13 years ago
Eric Leblond
f389a1201f
tm-thread: run thread init function sequentially.
...
On some setup you want to run each thread init function sequentially.
For example, if I use flow_cpu load balancing on AF_PACKET, my target
is to have CPU 0 (first socket in the group) to be link with the
thread 0 in detect cpu set (first thread to be initialised). A good
way to achieve this is to run only one thread init function at a time
to avoid any possible race condition.
13 years ago
Anoop Saldanha
34f0897163
check if all packets are processed before disabling detect threads + kill all threads <= detect after FFR + other minor fixes
13 years ago
Anoop Saldanha
ba5f757c47
sc_atomic_cas replaced with sc_atomic_set
13 years ago
Eric Leblond
0227a87fcb
cleaning: fix warning when building with clang.
...
clang was issuing some warnings related to unused return in function.
This patch adds some needed error treatment and ignore the rest of the
warnings by adding a cast to void.
13 years ago
Anoop Saldanha
2bc7d0792d
update clean up of old detection engine contexts for live rule swap
13 years ago
Anoop Saldanha
31eb5fa2f6
Introduce util-signal.[ch]. Move our signal setup functions here
13 years ago
Anoop Saldanha
ecad4a24fa
live rule support added
...
To reload ruleset during engine runtime, send the USR2 signal to the engine, and the ruleset would be reloaded from the same yaml file supplied at engine startup
13 years ago
Anoop Saldanha
5e02cb2365
slot_data updated as an atomic var no
13 years ago
Anoop Saldanha
081b0e05a2
restructure disabling receive threads. Introduce new flag to indicate that threads have finised running
13 years ago
Anoop Saldanha
fea6a426a5
cleanup killing threads. As a consequence fixes invalid read/writes in tmqh flow
13 years ago
Anoop Saldanha
5ffb050ada
Adapt flow tmqh counters to be atomic vars. Remove support for active flows q handler. Introduce SC_ATOMIC_SET
14 years ago
Victor Julien
d908e707d7
profiling: add per lock location profiling
...
Add profiling per lock location in the code. Accounts how often a
lock is requested, how often it was contended, the max number of
ticks spent waiting for it, avg number of ticks waiting for it and
the total ticks for that location.
Added a new configure flag --enable-profiling-locks to enable this
feature.
14 years ago
Victor Julien
979edf0b97
Add way to profile mutex/spin locks per thread module.
14 years ago
Victor Julien
d72b82fae0
Misc fixes.
14 years ago
Victor Julien
e237841a8e
Fix compilation with profiling enabled. Minor unittest fixes.
14 years ago
Victor Julien
372ab9c433
Another batch of minor fixed for issues found by Coverity.
14 years ago
Victor Julien
11bdf4838f
Various improvements to error handling found by Coverity.
14 years ago
Victor Julien
cdba2f50d1
Various fixes and improvements based on feedback by Coverity analyzer.
14 years ago
Victor Julien
cd987ae7a5
Threading: do not keep a slots post_pq locked while processing the packets.
14 years ago
Anoop Saldanha
420befb180
Changed my email address to anoopsaldanha at gmail dot com from my current one
14 years ago
Eric Leblond
5cec22ac37
threads: Add sanity check.
14 years ago
Victor Julien
1be65e7b68
Fixes for building in Cygwin.
14 years ago
Victor Julien
404868c28b
Get rid of strcasestr call as win32 doesn't have it.
14 years ago
Anoop Saldanha
d23e775ae2
fix threading bug. Main thread's restart TV code waiting on a failed TV. Now main thread sets the de_init flag before waiting on the failed thread. Thanks to Eric Leblond for reporting it
14 years ago
Anoop Saldanha
d68f182ebd
introduce SCPerfSyncCounters/SCPerfSyncCounters macro to synchronize counters
14 years ago
pilcrow
ed69eeab14
Safer macro parenthesization and do/while use
14 years ago
Victor Julien
1ab6443e44
Fix compilation when profiling is enabled.
14 years ago
Anoop Saldanha
7c729d2d53
some more code cleanup + comments added
14 years ago
Anoop Saldanha
3f1c4efceb
Add new flags var to tm module. TMs can now set flags to identify special properties. Also use these to identify receive TMs
14 years ago
Anoop Saldanha
54f6e4ff4d
Merge thread kill functions. Merge slot's tm_id with the one used by packet profiling. Remove some junk unused code from ms sync pts. Timeout setup cleanup as well. packet q dbg_maxlen now u32 var.
14 years ago
Anoop Saldanha
6c95526423
Introduce a new wrapper macro that wait loops till the flag(s) in question have been set
14 years ago
Anoop Saldanha
a7acf9ea8f
Remove all code introduced earlier concerned with ms sync points
14 years ago
Anoop Saldanha
b0a588beeb
Introduce another solution to solve stream timeout shutdown issue using thread flags. No more MSSyncPts
14 years ago
Anoop Saldanha
f2bcf9ea2c
modify post_pq packet handling.
...
- Lock the q just once, once we have detected the presence of packet(s)
in the queue. Unlock it when we consume all packets from the q.
14 years ago
Anoop Saldanha
9256c7bf0a
always keep queue locked till we exit flowprune. Should prevent potential threading issues
14 years ago
Anoop Saldanha
a559bfc165
signal the post pq if possible, whenever pseudo packets are injected into engine flow. Also carry out post pq processing irrespective of packet retrieval from the flow.
14 years ago
Anoop Saldanha
8363533a02
support for forced stream reassembly for to be pruned flows
14 years ago
Anoop Saldanha
15359dc47e
Slot structure now holds the TV it belongs to
14 years ago
Anoop Saldanha
c365bafbf6
We now inspect timed out streams + streams not processed as yet, at engine shutdown
14 years ago
Anoop Saldanha
56432cee16
Single thread kill also checks if inq is cleared before shutting down
14 years ago
Anoop Saldanha
8fa923c5ac
- All threads also check to see if their inq is cleared before they shutdown.
14 years ago
Anoop Saldanha
a844eecb0e
- Updated all runmodes to use synchronization points, right before each thread(slot function) tries to de-init the thread. - Main thread now first disables receive thread(s) before it kills receive and rest of the threads.
14 years ago
Anoop Saldanha
e567c2d002
Introduce master-slave synchronization support for ThreadVars
14 years ago
Anoop Saldanha
94c5ecb069
introduce inline function version of TmThreadsSlotProcessPkt macro. Retain the macro as well
14 years ago