MCPcopy Create free account
hub / github.com/F-Stack/f-stack / txgbevf_dev_close

Function txgbevf_dev_close

dpdk/drivers/net/txgbe/txgbe_ethdev_vf.c:758–797  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

756}
757
758static int
759txgbevf_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

Callers 1

eth_txgbevf_dev_uninitFunction · 0.85

Calls 8

rte_eal_process_typeFunction · 0.85
txgbevf_dev_stopFunction · 0.85
txgbe_dev_free_queuesFunction · 0.85
txgbevf_remove_mac_addrFunction · 0.85
txgbevf_intr_disableFunction · 0.85
rte_freeFunction · 0.85
rte_intr_disableFunction · 0.50

Tested by

no test coverage detected