net/vhost: fix deadlock on vring state change
authorYuan Wang <yuanx.wang@intel.com>
Mon, 27 Jun 2022 05:51:25 +0000 (13:51 +0800)
committerMaxime Coquelin <maxime.coquelin@redhat.com>
Fri, 1 Jul 2022 13:49:49 +0000 (15:49 +0200)
commit193edd75a94fe8d0d633d1702109779fd7b7d6a0
treed59740dc968a499c0158ac6575fa1444770c1234
parentb6eee3e834020fe7ffa0dc84d21be740998230ea
net/vhost: fix deadlock on vring state change

If vring state changes after pmd starts working, the locked vring
notifies pmd, thus calling update_queuing_status(), the latter
will wait for pmd to finish accessing vring, while pmd is also
waiting for vring to be unlocked, thus causing deadlock.

Actually, update_queuing_status() only needs to wait while
destroy/stopping the device, but not in other cases.

This patch adds a flag for whether or not to wait to fix this issue.

Fixes: 1ce3c7fe149f ("net/vhost: emulate device start/stop behavior")
Cc: stable@dpdk.org
Signed-off-by: Yuan Wang <yuanx.wang@intel.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
drivers/net/vhost/rte_eth_vhost.c