Dear Stephen,

Thank you very much for your reply. Please see my answers inline.

On 9/17/2023 11:27 PM, Stephen Hemminger wrote:
On Sun, 17 Sep 2023 21:37:30 +0200
Gabor LENCSE <[email protected]> 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);
        }
}

Thank you very much for the detailed explanation!

I have modified the send function of siitperf (just at one point as a quick hack) and also the bash shell script. Now it works well and produces meaningful self-test results without any problem with program termination. So, the issue is solved. :-)

Of course, I will review all my rte_exit calls... It'll take a while...

I am just curious, as I have no idea, why my old code worked all right with DPDK 16.11. Has rte_exit() been changed since then?

(But, please do not spend too much time with this question!)

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.

Yes I think it definitely SHOULD be mentioned in DPDK documentation that the rte_exit() function may be called only from the main lcore.

Now I have learnt it for all my life, but it will be useful for a lot of DPDK users. :-)

Once again, thank you very much for your help!

Best regards,

Gábor

p.s.: I have another, even worse problem with siitperf running with the new versions of DPDK. I will report it with a different subject line.


        

Reply via email to