* Reset and stop device. */
| 959 | * Reset and stop device. |
| 960 | */ |
| 961 | static int |
| 962 | ionic_dev_close(struct rte_eth_dev *eth_dev) |
| 963 | { |
| 964 | struct ionic_lif *lif = IONIC_ETH_DEV_TO_LIF(eth_dev); |
| 965 | struct ionic_adapter *adapter = lif->adapter; |
| 966 | |
| 967 | IONIC_PRINT_CALL(); |
| 968 | if (rte_eal_process_type() != RTE_PROC_PRIMARY) |
| 969 | return 0; |
| 970 | |
| 971 | ionic_lif_stop(lif); |
| 972 | |
| 973 | IONIC_PRINT(NOTICE, "Removing device %s", eth_dev->device->name); |
| 974 | if (adapter->intf->unconfigure_intr) |
| 975 | (*adapter->intf->unconfigure_intr)(adapter); |
| 976 | |
| 977 | ionic_port_reset(adapter); |
| 978 | ionic_reset(adapter); |
| 979 | |
| 980 | ionic_lif_free_queues(lif); |
| 981 | ionic_lif_deinit(lif); |
| 982 | ionic_lif_free(lif); /* Does not free LIF object */ |
| 983 | |
| 984 | if (adapter->intf->unmap_bars) |
| 985 | (*adapter->intf->unmap_bars)(adapter); |
| 986 | |
| 987 | lif->adapter = NULL; |
| 988 | rte_free(adapter); |
| 989 | |
| 990 | return 0; |
| 991 | } |
| 992 | |
| 993 | int |
| 994 | eth_ionic_dev_init(struct rte_eth_dev *eth_dev, void *init_params) |
no test coverage detected