[PATCH] examples/vdpa: fix devices cleanup

Stephen Hemminger stephen at networkplumber.org
Mon Dec 26 19:05:00 CET 2022


On Mon, 26 Dec 2022 14:51:06 +0800
Yajun Wu <yajunw at nvidia.com> wrote:

> Move rte_eal_cleanup to function vdpa_sample_quit which
> handling all example app quit.
> Otherwise rte_eal_cleanup won't be called on receiving signal
> like SIGINT(control + c).
> 
> Fixes: 10aa3757 ("examples: add eal cleanup to examples")
> Cc: stable at dpdk.org
> 
> Signed-off-by: Yajun Wu <yajunw at nvidia.com>
> Acked-by: Matan Azrad <matan at nvidia.com>

NAK

rte_eal_cleanup is not signal safe.
This (and several other applications) are not managing termination
signals correctly. It is not safe to call many DPDK functions
from a signal handler. Imagine the case of getting SIGINT in
the middle of a driver holding a spin lock, then calling the
close function of that driver which then acquires the same lock.

The only safe way to handle signals is to set a flag
and do the shutdown and cleanup from the main loop.


More information about the dev mailing list