app/testpmd: use hotplug failure handler
authorJeff Guo <jia.guo@intel.com>
Mon, 15 Oct 2018 11:27:27 +0000 (19:27 +0800)
committerThomas Monjalon <thomas@monjalon.net>
Mon, 15 Oct 2018 20:19:00 +0000 (22:19 +0200)
commit2049c5113fe878fc36131430c2be4e71d006cd59
tree53d32f454bea6939c47f4282ad4f72c1f674d665
parent0fc54536b14aa0edef4d36567f49fb382251bfe9
app/testpmd: use hotplug failure handler

This patch use testpmd for example, to show how an app smoothly handle
failure when device be hot-unplug. Except that app should enabled the
device event monitor and register the hotplug event’s callback, it also
need enable hotplug handle mechanism before running. Once app detect the
removal event, the hot-unplug callback would be called. It will first stop
the packet forwarding, then stop the port, close the port, and finally
detach the port to clean the device and release the resources.

Signed-off-by: Jeff Guo <jia.guo@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
app/test-pmd/testpmd.c