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

Function txgbe_dev_start

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

* Configure device link speed and setup link. * It returns 0 on success. */

Source from the content-addressed store, hash-verified

1674 * It returns 0 on success.
1675 */
1676static int
1677txgbe_dev_start(struct rte_eth_dev *dev)
1678{
1679 struct txgbe_hw *hw = TXGBE_DEV_HW(dev);
1680 struct txgbe_hw_stats *hw_stats = TXGBE_DEV_STATS(dev);
1681 struct txgbe_vf_info *vfinfo = *TXGBE_DEV_VFDATA(dev);
1682 struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(dev);
1683 struct rte_intr_handle *intr_handle = pci_dev->intr_handle;
1684 uint32_t intr_vector = 0;
1685 int err;
1686 bool link_up = false, negotiate = 0;
1687 uint32_t speed = 0;
1688 uint32_t allowed_speeds = 0;
1689 int mask = 0;
1690 int status;
1691 uint16_t vf, idx;
1692 uint32_t *link_speeds;
1693 struct txgbe_tm_conf *tm_conf = TXGBE_DEV_TM_CONF(dev);
1694
1695 PMD_INIT_FUNC_TRACE();
1696
1697 /* Stop the link setup handler before resetting the HW. */
1698 rte_eal_alarm_cancel(txgbe_dev_detect_sfp, dev);
1699 txgbe_dev_wait_setup_link_complete(dev, 0);
1700
1701 /* disable uio/vfio intr/eventfd mapping */
1702 rte_intr_disable(intr_handle);
1703
1704 /* stop adapter */
1705 hw->adapter_stopped = 0;
1706 txgbe_stop_hw(hw);
1707
1708 /* reinitialize adapter
1709 * this calls reset and start
1710 */
1711 hw->nb_rx_queues = dev->data->nb_rx_queues;
1712 hw->nb_tx_queues = dev->data->nb_tx_queues;
1713 status = txgbe_pf_reset_hw(hw);
1714 if (status != 0)
1715 return -1;
1716 hw->mac.start_hw(hw);
1717 hw->mac.get_link_status = true;
1718 hw->dev_start = true;
1719
1720 txgbe_set_pcie_master(hw, true);
1721
1722 /* workaround for GPIO intr lost when mng_veto bit is set */
1723 if (txgbe_check_reset_blocked(hw))
1724 txgbe_reinit_gpio_intr(hw);
1725
1726 /* configure PF module if SRIOV enabled */
1727 txgbe_pf_host_configure(dev);
1728
1729 txgbe_dev_phy_intr_setup(dev);
1730
1731 /* check and configure queue intr-vector mapping */
1732 if ((rte_intr_cap_multiple(intr_handle) ||
1733 !RTE_ETH_DEV_SRIOV(dev).active) &&

Callers

nothing calls this directly

Calls 15

txgbe_stop_hwFunction · 0.85
txgbe_pf_reset_hwFunction · 0.85
txgbe_set_pcie_masterFunction · 0.85
txgbe_reinit_gpio_intrFunction · 0.85
txgbe_pf_host_configureFunction · 0.85
txgbe_dev_phy_intr_setupFunction · 0.85
rte_intr_vec_list_allocFunction · 0.85
txgbe_configure_msixFunction · 0.85
txgbe_dev_tx_initFunction · 0.85
txgbe_dev_rx_initFunction · 0.85

Tested by

no test coverage detected