net/vhost: fix unix socket not removed as closing
authorJianfeng Tan <jianfeng.tan@intel.com>
Tue, 24 Jan 2017 08:37:38 +0000 (08:37 +0000)
committerYuanhan Liu <yuanhan.liu@linux.intel.com>
Mon, 30 Jan 2017 13:19:48 +0000 (14:19 +0100)
commit954820dc7d9eeef76274adcc55d5b9ca4f425ec2
tree66c0237ca3d890bafd12e407f44062098277d98c
parent68759bbe73fe036c6fe1c3b61586ebb169686831
net/vhost: fix unix socket not removed as closing

The commit aed0b12930b3 ("net/vhost: fix socket file deleted on stop")
moves rte_vhost_driver_register and rte_vhost_driver_unregister from
dev_start() and dev_stop() into driver's probe() and remove().

Apps, like testpmd, using vhost pmd in server mode, usually calls
dev_stop() and dev_close() as quitting, instead of driver-specific
remove(). Then those unix socket files have no chance to get removed.

Semantically, device-specific things should be put into device-specific
APIs. Fix this issue by moving rte_vhost_driver_unregister, plus other
structure free into dev_close().

Fixes: aed0b12930b3 ("net/vhost: fix socket file deleted on stop")
Cc: stable@dpdk.org
Reported-by: Lei Yao <lei.a.yao@intel.com>
Signed-off-by: Jianfeng Tan <jianfeng.tan@intel.com>
Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
drivers/net/vhost/rte_eth_vhost.c