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

Function eth_em_stop

dpdk/drivers/net/e1000/em_ethdev.c:730–781  ·  view source on GitHub ↗

* * This routine disables all traffic on the adapter by issuing a * global reset on the MAC. * **********************************************************************/

Source from the content-addressed store, hash-verified

728 *
729 **********************************************************************/
730static int
731eth_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
783static int
784eth_em_close(struct rte_eth_dev *dev)

Callers 2

eth_em_startFunction · 0.85
eth_em_closeFunction · 0.85

Calls 14

rte_eal_process_typeFunction · 0.85
eth_em_rxtx_controlFunction · 0.85
em_rxq_intr_disableFunction · 0.85
em_lsc_intr_disableFunction · 0.85
e1000_reset_hwFunction · 0.85
em_flush_desc_ringsFunction · 0.85
e1000_power_down_phyFunction · 0.85
em_dev_clear_queuesFunction · 0.85
memsetFunction · 0.85
rte_eth_linkstatus_setFunction · 0.85
rte_intr_vec_list_freeFunction · 0.85
rte_intr_allow_othersFunction · 0.50

Tested by

no test coverage detected