app/testpmd: fix exit for virtio-user
authorZhiyong Yang <zhiyong.yang@intel.com>
Fri, 18 May 2018 09:59:37 +0000 (17:59 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 22 May 2018 22:35:00 +0000 (00:35 +0200)
commit124909d7e1bf299c959b58c2db7c5fbd7abbb7c0
treeb9176d1f4e59b37f5dad29d6bfa274199bcc66bc
parent4462814d850fadcbdbbadb324d125aefbb83a2b8
app/testpmd: fix exit for virtio-user

For vdev, just calling rte_eth_dev_close() isn't enough to free all
the resources allocated during device probe, e.g. for virtio-user,
virtio_user_pmd_remove(), i.e. the remove() method of a vdev driver,
needs to be called to unlink the socket file created during device
probe. So this patch calls the rte_eth_dev_detach() for vdev when
quitting testpmd.

vdevs detach on testpmd exit implemented as workaround to fix
a virtio-user issue. The issue was virtio-user cleanup is not
called and existing socket file not cleaned up which will fail
next run.

Added a comment that this workaround should be converted to a proper
cleanup, not something specific to virtio-user, and not something
specific to vdev and testpmd.

Fixes: af75078fece3 ("first public release")
Fixes: bd8f50a45d0f ("net/virtio-user: support server mode")
Cc: stable@dpdk.org
Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
Tested-by: Lei Yao <lei.a.yao@intel.com>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
app/test-pmd/testpmd.c