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

Function txgbe_dev_stop

dpdk/drivers/net/txgbe/txgbe_ethdev.c:1922–2002  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

1920 * Stop device: disable rx and tx functions to allow for reconfiguring.
1921 */
1922static int
1923txgbe_dev_stop(struct rte_eth_dev *dev)
1924{
1925 struct rte_eth_link link;
1926 struct txgbe_adapter *adapter = TXGBE_DEV_ADAPTER(dev);
1927 struct txgbe_hw *hw = TXGBE_DEV_HW(dev);
1928 struct txgbe_vf_info *vfinfo = *TXGBE_DEV_VFDATA(dev);
1929 struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(dev);
1930 struct rte_intr_handle *intr_handle = pci_dev->intr_handle;
1931 int vf;
1932 struct txgbe_tm_conf *tm_conf = TXGBE_DEV_TM_CONF(dev);
1933
1934 if (hw->adapter_stopped)
1935 goto out;
1936
1937 PMD_INIT_FUNC_TRACE();
1938
1939 rte_eal_alarm_cancel(txgbe_dev_detect_sfp, dev);
1940 txgbe_dev_wait_setup_link_complete(dev, 0);
1941
1942 /* disable interrupts */
1943 txgbe_disable_intr(hw);
1944
1945 /* workaround for GPIO intr lost when mng_veto bit is set */
1946 if (txgbe_check_reset_blocked(hw))
1947 txgbe_reinit_gpio_intr(hw);
1948
1949 /* reset the NIC */
1950 txgbe_pf_reset_hw(hw);
1951 hw->adapter_stopped = 0;
1952
1953 /* stop adapter */
1954 txgbe_stop_hw(hw);
1955
1956 for (vf = 0; vfinfo != NULL && vf < pci_dev->max_vfs; vf++)
1957 vfinfo[vf].clear_to_send = false;
1958
1959 txgbe_dev_clear_queues(dev);
1960
1961 /* Clear stored conf */
1962 dev->data->scattered_rx = 0;
1963 dev->data->lro = 0;
1964
1965 /* Clear recorded link status */
1966 memset(&link, 0, sizeof(link));
1967 rte_eth_linkstatus_set(dev, &link);
1968
1969 if (!rte_intr_allow_others(intr_handle))
1970 /* resume to the default handler */
1971 rte_intr_callback_register(intr_handle,
1972 txgbe_dev_interrupt_handler,
1973 (void *)dev);
1974
1975 /* Clean datapath event and queue/vec mapping */
1976 rte_intr_efd_disable(intr_handle);
1977 rte_intr_vec_list_free(intr_handle);
1978
1979 /* reset hierarchy commit */

Callers 1

txgbe_dev_closeFunction · 0.85

Calls 15

txgbe_disable_intrFunction · 0.85
txgbe_reinit_gpio_intrFunction · 0.85
txgbe_pf_reset_hwFunction · 0.85
txgbe_stop_hwFunction · 0.85
txgbe_dev_clear_queuesFunction · 0.85
memsetFunction · 0.85
rte_eth_linkstatus_setFunction · 0.85
rte_intr_vec_list_freeFunction · 0.85
txgbe_set_pcie_masterFunction · 0.85
rte_eal_alarm_cancelFunction · 0.50

Tested by

no test coverage detected