dumpcap: fix warnings when primary exits
PATCH 1/1 dumpcap: fix warnings when primary exits
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 <[email protected]>
--- app/dumpcap/main.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)
app/dumpcap/main.c +6 -5
@@ -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 ; }
Signature · 1 line
2.47.2
PATCH v2 1/1 dumpcap: fix warnings when primary exits
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 <[email protected]>
---
v2 - fix indentation
app/dumpcap/main.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)
app/dumpcap/main.c +6 -5
@@ -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 ; }
Signature · 1 line
2.47.2