]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
dpdk: reset stats just before the start of packet receive loop 9492/head
authorLukas Sismis <lsismis@oisf.net>
Fri, 15 Sep 2023 10:15:23 +0000 (06:15 -0400)
committerVictor Julien <victor@inliniac.net>
Fri, 15 Sep 2023 15:09:01 +0000 (17:09 +0200)
While Suricata initializes, the device must be started to e.g.
apply rte_flow rules on some devices. But in the meantime, the
NIC started receiving packets but accounted those as missed.
Stats reset was added to better represent true packet drop.

src/source-dpdk.c

index ddbb2976c961fb4eb018e77df2a77bee5767ad90..54503e212271194c71fe6f3ec1e6bfb56ab526b7 100644 (file)
@@ -373,8 +373,10 @@ static TmEcode ReceiveDPDKLoop(ThreadVars *tv, void *data, void *slot)
     // Indicate that the thread is actually running its application level code (i.e., it can poll
     // packets)
     TmThreadsSetFlag(tv, THV_RUNNING);
-
     PacketPoolWait();
+
+    rte_eth_stats_reset(ptv->port_id);
+    rte_eth_xstats_reset(ptv->port_id);
     while (1) {
         if (unlikely(suricata_ctl_flags != 0)) {
             SCLogDebug("Stopping Suricata!");