Project

General

Profile

Actions

Bug #1071

closed

master-2013-12-02: packet stats are run on every packet

Added by Mark Solaris almost 11 years ago. Updated almost 11 years ago.

Status:
Rejected
Priority:
Normal
Assignee:
-
Target version:
-
Affected Versions:
Effort:
Difficulty:
Label:

Description

This diff puts last_dump outside of the PcapCallbackLoop() function. It'll survive for comparison for the next time through the function.

The net effect is a drop of up to a million ioctls a minute (whatever your packet rate is) to just a few hundred (60 stat scans and the normal ones).

--- ../../suricata-master.orig/src/source-pcap.c        Sun Dec  1 21:37:52 2013
+++ source-pcap.c       Wed Dec 18 00:01:05 2013
@@ -224,12 +224,13 @@

 #endif

+time_t last_dump = 0;
+
 void PcapCallbackLoop(char *user, struct pcap_pkthdr *h, u_char *pkt) {
     SCEnter();

     PcapThreadVars *ptv = (PcapThreadVars *)user;
     Packet *p = PacketGetFromQueueOrAlloc();
-    time_t last_dump = 0;
     struct timeval current_time;

     if (unlikely(p == NULL)) {
Actions #1

Updated by Victor Julien almost 11 years ago

  • Status changed from New to Rejected
Actions #2

Updated by Mark Solaris almost 11 years ago

Lol, I just found that out in the tree a minute ago :) Irony.

Actions

Also available in: Atom PDF