Bug 1193

Summary: examples/vdpa closes port in non signal safe manner
Product: DPDK Reporter: Stephen Hemminger (stephen)
Component: examplesAssignee: dev
Status: UNCONFIRMED ---    
Severity: normal    
Priority: Normal    
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: All   

Description Stephen Hemminger 2023-03-20 18:02:57 CET
The vdpa sample application does:

signal(SIGINT, signal_handler);

Then signal_handler() doess
    vdpa_signal_quit() which calls close_vdpa()
    close_vdpa() calls rte_vhost_driver_detach_vdpa_device and unregister

These close and detach routines are not signal safe. It could cause a race condition in vdpa driver if signal was received and processed by one thread while another thread was in middle of interacting with host.

The correct way to handle this is to set a flag in the signal handler,
and exit the main processing loop; then cleanup.