Bug 1290

Summary: rte_exit will hang if called from worker or service thread
Product: DPDK Reporter: Stephen Hemminger (stephen)
Component: coreAssignee: dev
Status: UNCONFIRMED ---    
Severity: normal    
Priority: Normal    
Version: 23.07   
Target Milestone: ---   
Hardware: All   
OS: All   

Description Stephen Hemminger 2023-09-18 20:53:06 CEST
Calling rte_exit in a thread other than main thread won't work because
the cleanup code is calling rte_eal_cleanup, and inside that it ends
up waiting for all workers.  Since the thread you are calling from
is a worker, it ends up waiting for itself.

rte_exit()
	rte_eal_cleanup()
		rte_service_finalize()
			rte_eal_mp_wait_lcore()


void
rte_eal_mp_wait_lcore(void)
{
	unsigned lcore_id;

	RTE_LCORE_FOREACH_WORKER(lcore_id) {
		rte_eal_wait_lcore(lcore_id);
	}
}

Either service handling needs to be smarter, the rte_exit() function
check if it is called from main lcore, and/or documentation needs update.
Not a simple fix because in order to safely do the cleanup logic
all threads have to gone to a quiescent state.