From: Victor Julien Date: Tue, 31 May 2016 12:18:04 +0000 (+0200) Subject: pfring: improve profiling X-Git-Tag: suricata-3.1RC1~41 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6f7740807dd6719c9b17403dd64db463a3bee26a;p=thirdparty%2Fsuricata.git pfring: improve profiling Reset packet profiling after pfring_recv. The packet was taken from the packet pool before this call. The packet will already have it's start ticks initialized. To avoid including ticks while pfring_recv waits for traffic, reset the ticks right after it. --- diff --git a/src/source-pfring.c b/src/source-pfring.c index 655031fb71..5cee51344a 100644 --- a/src/source-pfring.c +++ b/src/source-pfring.c @@ -48,6 +48,7 @@ #include "util-device.h" #include "util-host-info.h" #include "runmodes.h" +#include "util-profiling.h" #ifdef __SC_CUDA_SUPPORT__ @@ -355,6 +356,10 @@ TmEcode ReceivePfringLoop(ThreadVars *tv, void *data, void *slot) } if (likely(r == 1)) { + /* profiling started before blocking pfring_recv call, so + * reset it here */ + PACKET_PROFILING_RESTART(p); + //printf("RecievePfring src %" PRIu32 " sport %" PRIu32 " dst %" PRIu32 " dstport %" PRIu32 "\n", // hdr.parsed_pkt.ipv4_src,hdr.parsed_pkt.l4_src_port, hdr.parsed_pkt.ipv4_dst,hdr.parsed_pkt.l4_dst_port);