rte_exit() does not terminate the program -- is it a bug or a new feature?

Stephen Hemminger stephen at networkplumber.org
Sun Sep 17 23:27:53 CEST 2023


On Sun, 17 Sep 2023 21:37:30 +0200
Gabor LENCSE <lencse at hit.bme.hu> wrote:

> However, l2fwd also uses the "rte_exit()" function to terminate the 
> program. The only difference is that it calls the "rte_exit()" function 
> from the main program, and I do so in a thread started by the 
> "rte_eal_remote_launch()" function.

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.
	


More information about the users mailing list