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

Function ixgbe_dev_start

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

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

Source from the content-addressed store, hash-verified

2600 * It returns 0 on success.
2601 */
2602static int
2603ixgbe_dev_start(struct rte_eth_dev *dev)
2604{
2605 struct ixgbe_hw *hw =
2606 IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
2607 struct ixgbe_vf_info *vfinfo =
2608 *IXGBE_DEV_PRIVATE_TO_P_VFDATA(dev->data->dev_private);
2609 struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(dev);
2610 struct rte_intr_handle *intr_handle = pci_dev->intr_handle;
2611 uint32_t intr_vector = 0;
2612 int err;
2613 bool link_up = false, negotiate = 0;
2614 uint32_t speed = 0;
2615 uint32_t allowed_speeds = 0;
2616 int mask = 0;
2617 int status;
2618 uint16_t vf, idx;
2619 uint32_t *link_speeds;
2620 struct ixgbe_tm_conf *tm_conf =
2621 IXGBE_DEV_PRIVATE_TO_TM_CONF(dev->data->dev_private);
2622 struct ixgbe_macsec_setting *macsec_setting =
2623 IXGBE_DEV_PRIVATE_TO_MACSEC_SETTING(dev->data->dev_private);
2624
2625 /*
2626 * This function calls into the base driver, which in turn will use
2627 * function pointers, which are not guaranteed to be valid in secondary
2628 * processes, so avoid using this function in secondary processes.
2629 */
2630 if (rte_eal_process_type() != RTE_PROC_PRIMARY)
2631 return -E_RTE_SECONDARY;
2632
2633 PMD_INIT_FUNC_TRACE();
2634
2635 /* Stop the link setup handler before resetting the HW. */
2636 ixgbe_dev_wait_setup_link_complete(dev, 0);
2637
2638 /* disable uio/vfio intr/eventfd mapping */
2639 rte_intr_disable(intr_handle);
2640
2641 /* stop adapter */
2642 hw->adapter_stopped = 0;
2643 ixgbe_stop_adapter(hw);
2644
2645 /* reinitialize adapter
2646 * this calls reset and start
2647 */
2648 status = ixgbe_pf_reset_hw(hw);
2649 if (status != 0)
2650 return -1;
2651 hw->mac.ops.start_hw(hw);
2652 hw->mac.get_link_status = true;
2653
2654 /* configure PF module if SRIOV enabled */
2655 ixgbe_pf_host_configure(dev);
2656
2657 ixgbe_dev_phy_intr_setup(dev);
2658
2659 /* check and configure queue intr-vector mapping */

Callers

nothing calls this directly

Calls 15

rte_eal_process_typeFunction · 0.85
ixgbe_stop_adapterFunction · 0.85
ixgbe_pf_reset_hwFunction · 0.85
ixgbe_pf_host_configureFunction · 0.85
ixgbe_dev_phy_intr_setupFunction · 0.85
rte_intr_vec_list_allocFunction · 0.85
ixgbe_configure_msixFunction · 0.85
ixgbe_dev_tx_initFunction · 0.85
ixgbe_dev_rx_initFunction · 0.85

Tested by

no test coverage detected