Skip to content

Commit

Permalink
dpdk: reset stats just before the start of packet receive loop
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Lukas Sismis authored and victorjulien committed Sep 15, 2023
1 parent 3eac0f1 commit af4bb91
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/source-dpdk.c
Original file line number Diff line number Diff line change
Expand Up @@ -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!");
Expand Down

0 comments on commit af4bb91

Please sign in to comment.