mirror of https://github.com/OISF/suricata
cybersecurityidsintrusion-detection-systemintrusion-prevention-systemipsnetwork-monitornetwork-monitoringnsmsecuritysuricatathreat-hunting
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
When there are many threads and/or the packet pool (max-pending-packets) is small, a potential dead lock exists between the packet pool return pool logic and the capture threads. The autofp workers together can have all the packets in their return pools, while the capture thread(s) are waiting at an empty pool. A race between the worker threads and the capture thread, where the latter signals the former, is lost by the capture thread. Now everyone is waiting. To avoid this scenario, this patch makes the previously hardcoded 'return pool' threshold dynamic based on the number of threads and the packet pool size. It sets the threshold to the max pending packets value, divided by the number of lister threads. The max value hasn't changed. Normally, in the autofp runmode these are the stream/detect/log worker threads. The max_pending_return_packets value needs to stay below the packet pool size of the 'producers' (normally pkt capture threads but also flow timeout injection) to avoid the deadlock. As it's quite impossible at this time to learn how many threads will be created before starting the runmodes, and thus spawning the threads and already initializing the packet pools, this code sets a global variable after runmode setup, but before the threads are 'unpaused'. |
10 years ago | |
|---|---|---|
| benches | 17 years ago | |
| contrib | 11 years ago | |
| doc | 11 years ago | |
| lua | 11 years ago | |
| m4 | 16 years ago | |
| qa | 10 years ago | |
| rules | 11 years ago | |
| scripts | 10 years ago | |
| src | 10 years ago | |
| .gitignore | 12 years ago | |
| .travis.yml | 10 years ago | |
| COPYING | 10 years ago | |
| ChangeLog | 11 years ago | |
| LICENSE | 10 years ago | |
| Makefile.am | 11 years ago | |
| Makefile.cvs | 17 years ago | |
| acsite.m4 | 16 years ago | |
| autogen.sh | 13 years ago | |
| classification.config | 16 years ago | |
| config.rpath | 13 years ago | |
| configure.ac | 10 years ago | |
| doxygen.cfg | 12 years ago | |
| reference.config | 11 years ago | |
| suricata.yaml.in | 10 years ago | |
| threshold.config | 13 years ago | |