Bug 1193 - examples/vdpa closes port in non signal safe manner
Summary: examples/vdpa closes port in non signal safe manner
Status: UNCONFIRMED
Alias: None
Product: DPDK
Classification: Unclassified
Component: examples (show other bugs)
Version: unspecified
Hardware: All All
: Normal normal
Target Milestone: ---
Assignee: dev
URL:
Depends on:
Blocks:
 
Reported: 2023-03-20 18:02 CET by Stephen Hemminger
Modified: 2023-03-20 18:02 CET (History)
0 users



Attachments

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.

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