From: Stephen Hemminger <stephen@networkplumber.org>
To: dev@dpdk.org
Cc: Stephen Hemminger <stephen@networkplumber.org>
Subject: [PATCH] dumpcap: fix warnings when primary exits
Date: Tue, 22 Jul 2025 08:53:19 -0700 [thread overview]
Message-ID: <20250722155319.168601-1-stephen@networkplumber.org> (raw)
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
reply other threads:[~2025-07-22 15:53 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250722155319.168601-1-stephen@networkplumber.org \
--to=stephen@networkplumber.org \
--cc=dev@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).