app/testpmd: fix asynchronic port removal
When a removable device is plugged-out, a RMV interrupt is invoked and
the application can catch the event in order to stop the device
management.
The Testpmd wrong behavior in this case is to detach the removed device
using the EAL detach API.
The EAL API does not invalidate the ethdev port and the port keeps
appearing as valid from the ethdev point of view.
Thus, the next operations for the ethtev port X may trigger an invalid
rte_device access. For example, calling "show port info X" may cause
segfault.
Moreover, the removed port is not removed from the Testpmd data-path
structures. Therefore, the invalid device may still be used by the
Testpmd data-path.
Call the Testpmd detach_port() function which uses the ethdev detach
API, and prepare the Testpmd forward ports database for a new
forwarding session without the detached port.
Fixes:
284c908cc588 ("app/testpmd: request device removal interrupt")
Cc: stable@dpdk.org
Signed-off-by: Matan Azrad <matan@mellanox.com>