* * This routine disables all traffic on the adapter by issuing a * global reset on the MAC. * **********************************************************************/
| 728 | * |
| 729 | **********************************************************************/ |
| 730 | static int |
| 731 | eth_em_stop(struct rte_eth_dev *dev) |
| 732 | { |
| 733 | struct rte_eth_link link; |
| 734 | struct e1000_hw *hw = E1000_DEV_PRIVATE_TO_HW(dev->data->dev_private); |
| 735 | struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(dev); |
| 736 | struct rte_intr_handle *intr_handle = pci_dev->intr_handle; |
| 737 | |
| 738 | /* |
| 739 | * This function calls into the base driver, which in turn will use |
| 740 | * function pointers, which are not guaranteed to be valid in secondary |
| 741 | * processes, so avoid using this function in secondary processes. |
| 742 | */ |
| 743 | if (rte_eal_process_type() != RTE_PROC_PRIMARY) |
| 744 | return -E_RTE_SECONDARY; |
| 745 | |
| 746 | dev->data->dev_started = 0; |
| 747 | |
| 748 | eth_em_rxtx_control(dev, false); |
| 749 | em_rxq_intr_disable(hw); |
| 750 | em_lsc_intr_disable(hw); |
| 751 | |
| 752 | e1000_reset_hw(hw); |
| 753 | |
| 754 | /* Flush desc rings for i219 */ |
| 755 | if (hw->mac.type == e1000_pch_spt || hw->mac.type == e1000_pch_cnp) |
| 756 | em_flush_desc_rings(dev); |
| 757 | |
| 758 | if (hw->mac.type >= e1000_82544) |
| 759 | E1000_WRITE_REG(hw, E1000_WUC, 0); |
| 760 | |
| 761 | /* Power down the phy. Needed to make the link go down */ |
| 762 | e1000_power_down_phy(hw); |
| 763 | |
| 764 | em_dev_clear_queues(dev); |
| 765 | |
| 766 | /* clear the recorded link status */ |
| 767 | memset(&link, 0, sizeof(link)); |
| 768 | rte_eth_linkstatus_set(dev, &link); |
| 769 | |
| 770 | if (!rte_intr_allow_others(intr_handle)) |
| 771 | /* resume to the default handler */ |
| 772 | rte_intr_callback_register(intr_handle, |
| 773 | eth_em_interrupt_handler, |
| 774 | (void *)dev); |
| 775 | |
| 776 | /* Clean datapath event and queue/vec mapping */ |
| 777 | rte_intr_efd_disable(intr_handle); |
| 778 | rte_intr_vec_list_free(intr_handle); |
| 779 | |
| 780 | return 0; |
| 781 | } |
| 782 | |
| 783 | static int |
| 784 | eth_em_close(struct rte_eth_dev *dev) |
no test coverage detected