Skip to contentSkip to conversation

pdump: clear statistics when enabled

PATCH Applied Stephen Hemminger 2 participants 2 messages Dec 19, 2024 – Mar 19, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 pdump: clear statistics when enabled

The pdump statistics are used to keep track of the number of packets captured, filtered, etc. These need not be cumalative and instead should be start counting when capture starts.

This fixes the issue where multiple invocations of dumpcap would include counts from previous invocations.

Bugzilla ID: 1604

Fixes 10f726efe26c ("pdump: support pcapng and filtering")
---
 lib/pdump/rte_pdump.c | 3 +++
 1 file changed, 3 insertions(+)
lib/pdump/rte_pdump.c +3 -0
index 679c3dd0b5..0e6ffc167b 100644
@@ -199,6 +199,8 @@ pdump_register_rx_callbacks(enum pdump_version ver,
 					rte_errno);
 				return rte_errno;
 			}
+
+			memset(&pdump_stats->rx[port][qid], 0, sizeof(struct rte_pdump_stats));
 		} else if (operation == DISABLE) {
 			int ret;
 
@@ -257,6 +259,7 @@ pdump_register_tx_callbacks(enum pdump_version ver,
 					rte_errno);
 				return rte_errno;
 			}
+			memset(&pdump_stats->tx[port][qid], 0, sizeof(struct rte_pdump_stats));
 		} else if (operation == DISABLE) {
 			int ret;
 
Signature · 1 line
2.45.2
#1 lore raw

20/12/2024 00:58, Stephen Hemminger:

Quoted 4 lines

The pdump statistics are used to keep track of the number of packets captured, filtered, etc. These need not be cumalative and instead should be start counting when capture starts.

Quoted 8 lines

This fixes the issue where multiple invocations of dumpcap would include counts from previous invocations.

Bugzilla ID: 1604

Fixes 10f726efe26c ("pdump: support pcapng and filtering")

Sorry this "christmas" patch was forgotten.

Applied, thanks.