Bug 1290 - rte_exit will hang if called from worker or service thread
Summary: rte_exit will hang if called from worker or service thread
Status: UNCONFIRMED
Alias: None
Product: DPDK
Classification: Unclassified
Component: core (show other bugs)
Version: 23.07
Hardware: All All
: Normal normal
Target Milestone: ---
Assignee: dev
URL:
Depends on:
Blocks:
 
Reported: 2023-09-18 20:53 CEST by Stephen Hemminger
Modified: 2023-09-18 20:53 CEST (History)
0 users



Attachments

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.

Note You need to log in before you can comment on or make changes to this bug.