Un initialize octeontx device */
| 1696 | |
| 1697 | /* Un initialize octeontx device */ |
| 1698 | static int |
| 1699 | octeontx_remove(struct rte_vdev_device *dev) |
| 1700 | { |
| 1701 | char octtx_name[OCTEONTX_MAX_NAME_LEN]; |
| 1702 | struct rte_eth_dev *eth_dev = NULL; |
| 1703 | struct octeontx_nic *nic = NULL; |
| 1704 | int i; |
| 1705 | |
| 1706 | if (dev == NULL) |
| 1707 | return -EINVAL; |
| 1708 | |
| 1709 | for (i = 0; i < OCTEONTX_VDEV_DEFAULT_MAX_NR_PORT; i++) { |
| 1710 | sprintf(octtx_name, "eth_octeontx_%d", i); |
| 1711 | |
| 1712 | eth_dev = rte_eth_dev_allocated(octtx_name); |
| 1713 | if (eth_dev == NULL) |
| 1714 | continue; /* port already released */ |
| 1715 | |
| 1716 | if (rte_eal_process_type() != RTE_PROC_PRIMARY) { |
| 1717 | rte_eth_dev_release_port(eth_dev); |
| 1718 | continue; |
| 1719 | } |
| 1720 | |
| 1721 | nic = octeontx_pmd_priv(eth_dev); |
| 1722 | rte_event_dev_stop(nic->evdev); |
| 1723 | PMD_INIT_LOG(INFO, "Closing octeontx device %s", octtx_name); |
| 1724 | octeontx_dev_close(eth_dev); |
| 1725 | rte_eth_dev_release_port(eth_dev); |
| 1726 | } |
| 1727 | |
| 1728 | if (rte_eal_process_type() != RTE_PROC_PRIMARY) |
| 1729 | return 0; |
| 1730 | |
| 1731 | /* Free FC resource */ |
| 1732 | octeontx_pko_fc_free(); |
| 1733 | |
| 1734 | return 0; |
| 1735 | } |
| 1736 | |
| 1737 | /* Initialize octeontx device */ |
| 1738 | static int |
no test coverage detected