net/vhost: fix crash when creating vdev dynamically
authorJunjie Chen <junjie.j.chen@intel.com>
Fri, 30 Mar 2018 06:58:31 +0000 (14:58 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 30 Mar 2018 12:08:44 +0000 (14:08 +0200)
commit30a701a53737a0b6f7953412cc3b3d36c1d49122
tree41dc6893740512d88765c83f85c4e85e5e7884bb
parent394313fff39d0f994325c47f7eab39daf5dc9e11
net/vhost: fix crash when creating vdev dynamically

When creating vdev dynamically, vhost pmd driver starts directly without
checking TX/RX queues are ready or not, and thus causes segmentation fault
when vhost library accesses queues. This patch adds a flag to check whether
queues are setup or not, and adds queues setup into dev_start function to
allow user to start them after setting up.

Fixes: aed0b12930b3 ("net/vhost: fix socket file deleted on stop")
Cc: stable@dpdk.org
Signed-off-by: Junjie Chen <junjie.j.chen@intel.com>
Tested-by: Zhiyong Yang <zhiyong.yang@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
drivers/net/vhost/rte_eth_vhost.c