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

Function ixgbe_dev_stop

dpdk/drivers/net/ixgbe/ixgbe_ethdev.c:2901–2981  ·  view source on GitHub ↗

* Stop device: disable rx and tx functions to allow for reconfiguring. */

Source from the content-addressed store, hash-verified

2899 * Stop device: disable rx and tx functions to allow for reconfiguring.
2900 */
2901static int
2902ixgbe_dev_stop(struct rte_eth_dev *dev)
2903{
2904 struct rte_eth_link link;
2905 struct ixgbe_adapter *adapter = dev->data->dev_private;
2906 struct ixgbe_hw *hw =
2907 IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
2908 struct ixgbe_vf_info *vfinfo =
2909 *IXGBE_DEV_PRIVATE_TO_P_VFDATA(dev->data->dev_private);
2910 struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(dev);
2911 struct rte_intr_handle *intr_handle = pci_dev->intr_handle;
2912 int vf;
2913 struct ixgbe_tm_conf *tm_conf =
2914 IXGBE_DEV_PRIVATE_TO_TM_CONF(dev->data->dev_private);
2915
2916 if (hw->adapter_stopped)
2917 return 0;
2918
2919 PMD_INIT_FUNC_TRACE();
2920
2921 /*
2922 * This function calls into the base driver, which in turn will use
2923 * function pointers, which are not guaranteed to be valid in secondary
2924 * processes, so avoid using this function in secondary processes.
2925 */
2926 if (rte_eal_process_type() != RTE_PROC_PRIMARY)
2927 return -E_RTE_SECONDARY;
2928
2929 ixgbe_dev_wait_setup_link_complete(dev, 0);
2930
2931 /* disable interrupts */
2932 ixgbe_disable_intr(hw);
2933
2934 /* reset the NIC */
2935 ixgbe_pf_reset_hw(hw);
2936 hw->adapter_stopped = 0;
2937
2938 /* stop adapter */
2939 ixgbe_stop_adapter(hw);
2940
2941 for (vf = 0; vfinfo != NULL && vf < pci_dev->max_vfs; vf++)
2942 vfinfo[vf].clear_to_send = false;
2943
2944 if (hw->mac.ops.get_media_type(hw) == ixgbe_media_type_copper) {
2945 /* Turn off the copper */
2946 ixgbe_set_phy_power(hw, false);
2947 } else {
2948 /* Turn off the laser */
2949 ixgbe_disable_tx_laser(hw);
2950 }
2951
2952 ixgbe_dev_clear_queues(dev);
2953
2954 /* Clear stored conf */
2955 dev->data->scattered_rx = 0;
2956 dev->data->lro = 0;
2957
2958 /* Clear recorded link status */

Callers 1

ixgbe_dev_closeFunction · 0.85

Calls 14

rte_eal_process_typeFunction · 0.85
ixgbe_disable_intrFunction · 0.85
ixgbe_pf_reset_hwFunction · 0.85
ixgbe_stop_adapterFunction · 0.85
ixgbe_set_phy_powerFunction · 0.85
ixgbe_disable_tx_laserFunction · 0.85
ixgbe_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