ethdev: fix device state on detach
authorGaetan Rivet <gaetan.rivet@6wind.com>
Wed, 26 Jul 2017 13:35:52 +0000 (15:35 +0200)
committerThomas Monjalon <thomas@monjalon.net>
Mon, 31 Jul 2017 12:08:17 +0000 (14:08 +0200)
commitf2b24fb03e8fcd21d10d5144ce257d0fe221adbc
treef71b68443c081929fad371ed31e35d3dfe1c3552
parent1c35f666df0786541cd2c83fbad332c1af2a78e7
ethdev: fix device state on detach

The device state should be handled by the ethdev layer when possible.
Applications should not have to do it.

Not setting the state to UNUSED will make the port_id of the device
valid for all ethdev API functions, usually resulting in segfault.

Fixes: 284c908cc588 ("app/testpmd: request device removal interrupt")
Cc: stable@dpdk.org
Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
Tested-by: Shachar Beiser <shacharbe@mellanox.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
app/test-pmd/testpmd.c
lib/librte_ether/rte_ethdev.c