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>
close_port(port_id);
printf("removing device %s\n", dev->device->name);
rte_eal_dev_detach(dev->device);
- dev->state = RTE_ETH_DEV_UNUSED;
}
/* This function is used by the interrupt thread */
if (ret < 0)
goto err;
+ rte_eth_devices[port_id].state = RTE_ETH_DEV_UNUSED;
return 0;
err: