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

Function txgbevf_dev_start

dpdk/drivers/net/txgbe/txgbe_ethdev_vf.c:612–715  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

610}
611
612static int
613txgbevf_dev_start(struct rte_eth_dev *dev)
614{
615 struct txgbe_hw *hw = TXGBE_DEV_HW(dev);
616 uint32_t intr_vector = 0;
617 struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(dev);
618 struct rte_intr_handle *intr_handle = pci_dev->intr_handle;
619
620 int err, mask = 0;
621
622 PMD_INIT_FUNC_TRACE();
623
624 /* Stop the link setup handler before resetting the HW. */
625 txgbe_dev_wait_setup_link_complete(dev, 0);
626
627 err = hw->mac.reset_hw(hw);
628 if (err) {
629 PMD_INIT_LOG(ERR, "Unable to reset vf hardware (%d)", err);
630 return err;
631 }
632 hw->mac.get_link_status = true;
633 hw->dev_start = true;
634
635 /* negotiate mailbox API version to use with the PF. */
636 txgbevf_negotiate_api(hw);
637
638 txgbevf_dev_tx_init(dev);
639
640 /* This can fail when allocating mbufs for descriptor rings */
641 err = txgbevf_dev_rx_init(dev);
642
643 /**
644 * In this case, reuses the MAC address assigned by VF
645 * initialization.
646 */
647 if (err != 0 && err != TXGBE_ERR_INVALID_MAC_ADDR) {
648 PMD_INIT_LOG(ERR, "Unable to initialize RX hardware (%d)", err);
649 txgbe_dev_clear_queues(dev);
650 return err;
651 }
652
653 /* Set vfta */
654 txgbevf_set_vfta_all(dev, 1);
655
656 /* Set HW strip */
657 mask = RTE_ETH_VLAN_STRIP_MASK | RTE_ETH_VLAN_FILTER_MASK |
658 RTE_ETH_VLAN_EXTEND_MASK;
659 err = txgbevf_vlan_offload_config(dev, mask);
660 if (err) {
661 PMD_INIT_LOG(ERR, "Unable to set VLAN offload (%d)", err);
662 txgbe_dev_clear_queues(dev);
663 return err;
664 }
665
666 txgbevf_dev_rxtx_start(dev);
667
668 /* check and configure queue intr-vector mapping */
669 if (rte_intr_cap_multiple(intr_handle) &&

Callers

nothing calls this directly

Calls 15

txgbevf_negotiate_apiFunction · 0.85
txgbevf_dev_tx_initFunction · 0.85
txgbevf_dev_rx_initFunction · 0.85
txgbe_dev_clear_queuesFunction · 0.85
txgbevf_set_vfta_allFunction · 0.85
txgbevf_dev_rxtx_startFunction · 0.85
rte_intr_vec_list_allocFunction · 0.85
txgbevf_configure_msixFunction · 0.85
txgbevf_intr_enableFunction · 0.85
txgbevf_dev_link_updateFunction · 0.85

Tested by

no test coverage detected