| 5627 | } |
| 5628 | |
| 5629 | static int |
| 5630 | ixgbevf_dev_close(struct rte_eth_dev *dev) |
| 5631 | { |
| 5632 | struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private); |
| 5633 | struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(dev); |
| 5634 | struct rte_intr_handle *intr_handle = pci_dev->intr_handle; |
| 5635 | int ret; |
| 5636 | |
| 5637 | PMD_INIT_FUNC_TRACE(); |
| 5638 | if (rte_eal_process_type() != RTE_PROC_PRIMARY) |
| 5639 | return 0; |
| 5640 | |
| 5641 | ixgbe_reset_hw(hw); |
| 5642 | |
| 5643 | ret = ixgbevf_dev_stop(dev); |
| 5644 | |
| 5645 | ixgbe_dev_free_queues(dev); |
| 5646 | |
| 5647 | /** |
| 5648 | * Remove the VF MAC address ro ensure |
| 5649 | * that the VF traffic goes to the PF |
| 5650 | * after stop, close and detach of the VF |
| 5651 | **/ |
| 5652 | ixgbevf_remove_mac_addr(dev, 0); |
| 5653 | |
| 5654 | rte_intr_disable(intr_handle); |
| 5655 | rte_intr_callback_unregister(intr_handle, |
| 5656 | ixgbevf_dev_interrupt_handler, dev); |
| 5657 | |
| 5658 | return ret; |
| 5659 | } |
| 5660 | |
| 5661 | /* |
| 5662 | * Reset VF device |
no test coverage detected