| 756 | } |
| 757 | |
| 758 | static int |
| 759 | txgbevf_dev_close(struct rte_eth_dev *dev) |
| 760 | { |
| 761 | struct txgbe_hw *hw = TXGBE_DEV_HW(dev); |
| 762 | struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(dev); |
| 763 | struct rte_intr_handle *intr_handle = pci_dev->intr_handle; |
| 764 | int ret; |
| 765 | |
| 766 | PMD_INIT_FUNC_TRACE(); |
| 767 | if (rte_eal_process_type() != RTE_PROC_PRIMARY) |
| 768 | return 0; |
| 769 | |
| 770 | hw->mac.reset_hw(hw); |
| 771 | |
| 772 | ret = txgbevf_dev_stop(dev); |
| 773 | |
| 774 | txgbe_dev_free_queues(dev); |
| 775 | |
| 776 | /** |
| 777 | * Remove the VF MAC address ro ensure |
| 778 | * that the VF traffic goes to the PF |
| 779 | * after stop, close and detach of the VF |
| 780 | **/ |
| 781 | txgbevf_remove_mac_addr(dev, 0); |
| 782 | |
| 783 | dev->rx_pkt_burst = NULL; |
| 784 | dev->tx_pkt_burst = NULL; |
| 785 | |
| 786 | /* Disable the interrupts for VF */ |
| 787 | txgbevf_intr_disable(dev); |
| 788 | |
| 789 | rte_free(dev->data->mac_addrs); |
| 790 | dev->data->mac_addrs = NULL; |
| 791 | |
| 792 | rte_intr_disable(intr_handle); |
| 793 | rte_intr_callback_unregister(intr_handle, |
| 794 | txgbevf_dev_interrupt_handler, dev); |
| 795 | |
| 796 | return ret; |
| 797 | } |
| 798 | |
| 799 | /* |
| 800 | * Reset VF device |
no test coverage detected