* [PATCH] dumpcap: fix warnings when primary exits
@ 2025-07-22 15:53 Stephen Hemminger
0 siblings, 0 replies; only message in thread
From: Stephen Hemminger @ 2025-07-22 15:53 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger
If primary process exits, there is no point in calling
pdump to release resources.
Bugzilla ID: 1760
Fixes: cbb44143be74 ("app/dumpcap: add new packet capture application")
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
app/dumpcap/main.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/app/dumpcap/main.c b/app/dumpcap/main.c
index 3d3c0dbc66..df649722ec 100644
--- a/app/dumpcap/main.c
+++ b/app/dumpcap/main.c
@@ -541,7 +541,7 @@ monitor_primary(void *arg __rte_unused)
rte_eal_alarm_set(MONITOR_INTERVAL, monitor_primary, NULL);
} else {
fprintf(stderr,
- "Primary process is no longer active, exiting...\n");
+ "\nPrimary process is no longer active, exiting...\n");
rte_atomic_store_explicit(&quit_signal, true, rte_memory_order_relaxed);
}
}
@@ -1058,10 +1058,11 @@ int main(int argc, char **argv)
else
pcap_dump_close(out.dumper);
- cleanup_pdump_resources();
-
- rte_ring_free(r);
- rte_mempool_free(mp);
+ if (rte_eal_primary_proc_alive(NULL)) {
+ cleanup_pdump_resources();
+ rte_ring_free(r);
+ rte_mempool_free(mp);
+ }
return rte_eal_cleanup() ? EXIT_FAILURE : 0;
}
--
2.47.2
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2025-07-22 15:53 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-07-22 15:53 [PATCH] dumpcap: fix warnings when primary exits Stephen Hemminger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).