[Public] Hi Khadem,
Snipped > > Caution: This message originated from an External Source. Use proper caution > when opening attachments, clicking links, or responding. > > > Hi Vipin Varghese, > Thank you for your feedback! > > Yes we need graceful exit, directly calling eal_cleanup from secondary was not > working, we can do the following workaround to use `eal_cleanup`. > > diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index > b7affa6da9..5ef6008a3c 100644 > --- a/app/test-pmd/testpmd.c > +++ b/app/test-pmd/testpmd.c > @@ -4347,7 +4347,12 @@ monitor_primary(void *arg __rte_unused) > * is no longer valid. Calling any cleanup code is going to > * run into use after free. > */ > + int ret; > fprintf(stderr, "\nPrimary process is no longer active, > exiting...\n"); > + ret = rte_eal_cleanup(); > + if (ret != 0) > + rte_exit(EXIT_FAILURE, > + "EAL cleanup failed: %s\n", strerror(-ret)); > exit(EXIT_FAILURE); > } > } > diff --git a/lib/eal/linux/eal.c b/lib/eal/linux/eal.c index > 52efb8626b..087a4b1137 > 100644 > --- a/lib/eal/linux/eal.c > +++ b/lib/eal/linux/eal.c > @@ -1333,9 +1333,12 @@ rte_eal_cleanup(void) #ifdef VFIO_PRESENT > vfio_mp_sync_cleanup(); > #endif > - rte_mp_channel_cleanup(); > + if (rte_eal_process_type() == RTE_PROC_PRIMARY) { > + rte_mp_channel_cleanup(); > + rte_eal_alarm_cleanup(); > + } > + > eal_bus_cleanup(); > - rte_eal_alarm_cleanup(); > rte_trace_save(); > eal_trace_fini(); > eal_mp_dev_hotplug_cleanup(); > > If Stephen and others are agree, I can supersede this patch with the newer > ones > containing cleanup changes. In the email follow up earlier, there is mention from your end as soon as primary is down secondary goes segment fault. As far I recollect testing for multiprocess using dpdk 22.11 and 23.03 the behavior were different. 1. Primary can exit or segfault. 2. Secondary can still continue to use mbuf and pmd calls without fail. But if you are seeing there difference in behviour, can you please let us know which version onwards it changed. With respect to synchronization, when dpdk library-based application is started there is also a MP thread that were created. Are you sharing that this is no longer functional? Note: I am trying to understand the behavior observed at your end. > > Thank you, > Best Regards, > Khadem