afu_dev->device.name, i);
ethdev = rte_eth_dev_allocated(afu_dev->device.name);
- if (!ethdev)
- return -ENODEV;
-
- rte_eth_dev_destroy(ethdev, ipn3ke_rpst_uninit);
+ if (ethdev != NULL)
+ rte_eth_dev_destroy(ethdev, ipn3ke_rpst_uninit);
}
ret = rte_eth_switch_domain_free(hw->switch_domain_id);
/* find the ethdev entry */
eth_dev = rte_eth_dev_allocated(name);
- if (eth_dev == NULL)
- return -1;
-
- if (rte_eal_process_type() != RTE_PROC_PRIMARY) {
- eth_kni_dev_stop(eth_dev);
- return rte_eth_dev_release_port(eth_dev);
+ if (eth_dev != NULL) {
+ if (rte_eal_process_type() != RTE_PROC_PRIMARY) {
+ eth_kni_dev_stop(eth_dev);
+ return rte_eth_dev_release_port(eth_dev);
+ }
+ eth_kni_close(eth_dev);
+ rte_eth_dev_release_port(eth_dev);
}
- eth_kni_close(eth_dev);
- rte_eth_dev_release_port(eth_dev);
-
is_kni_initialized--;
if (is_kni_initialized == 0)
rte_kni_close();
eth_dev = rte_eth_dev_allocated(dev->device.name);
if (!eth_dev)
- return -ENODEV;
+ return 0; /* port already released */
ret = eth_hn_dev_uninit(eth_dev);
if (ret)
int port = 0;
eth_dev = rte_eth_dev_allocated(pci_dev->device.name);
+ if (eth_dev == NULL)
+ return 0; /* port already released */
if ((pci_dev->id.device_id == PCI_DEVICE_ID_NFP4000_PF_NIC) ||
(pci_dev->id.device_id == PCI_DEVICE_ID_NFP6000_PF_NIC)) {
port = get_pf_port_number(eth_dev->data->name);
pci_dev->device.name, i);
PMD_DRV_LOG(DEBUG, "Removing eth_dev %s", name);
eth_dev = rte_eth_dev_allocated(name);
- if (!eth_dev) {
- PMD_DRV_LOG(ERR, "eth_dev %s not found", name);
- retval = retval ? retval : -ENODEV;
- }
+ if (eth_dev == NULL)
+ continue; /* port already released */
ret = rte_szedata2_eth_dev_uninit(eth_dev);
if (ret != 0) {