Reset and stop device. The device can not be restarted. */
| 158 | |
| 159 | /* Reset and stop device. The device can not be restarted. */ |
| 160 | static int |
| 161 | nfp_netvf_close(struct rte_eth_dev *dev) |
| 162 | { |
| 163 | struct nfp_net_hw *net_hw; |
| 164 | struct rte_pci_device *pci_dev; |
| 165 | |
| 166 | if (rte_eal_process_type() != RTE_PROC_PRIMARY) |
| 167 | return 0; |
| 168 | |
| 169 | net_hw = dev->data->dev_private; |
| 170 | pci_dev = RTE_ETH_DEV_TO_PCI(dev); |
| 171 | |
| 172 | rte_free(net_hw->eth_xstats_base); |
| 173 | |
| 174 | /* |
| 175 | * We assume that the DPDK application is stopping all the |
| 176 | * threads/queues before calling the device close function. |
| 177 | */ |
| 178 | nfp_net_disable_queues(dev); |
| 179 | |
| 180 | /* Clear queues */ |
| 181 | nfp_net_close_tx_queue(dev); |
| 182 | nfp_net_close_rx_queue(dev); |
| 183 | |
| 184 | rte_intr_disable(pci_dev->intr_handle); |
| 185 | |
| 186 | /* Unregister callback func from eal lib */ |
| 187 | rte_intr_callback_unregister(pci_dev->intr_handle, |
| 188 | nfp_net_dev_interrupt_handler, (void *)dev); |
| 189 | |
| 190 | /* Cancel possible impending LSC work here before releasing the port */ |
| 191 | rte_eal_alarm_cancel(nfp_net_dev_interrupt_delayed_handler, (void *)dev); |
| 192 | |
| 193 | return 0; |
| 194 | } |
| 195 | |
| 196 | /* Initialise and register VF driver with DPDK Application */ |
| 197 | static const struct eth_dev_ops nfp_netvf_eth_dev_ops = { |
no test coverage detected