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

Function eth_igb_dev_init

dpdk/drivers/net/e1000/igb_ethdev.c:711–887  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

709}
710
711static int
712eth_igb_dev_init(struct rte_eth_dev *eth_dev)
713{
714 int error = 0;
715 struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(eth_dev);
716 struct e1000_hw *hw =
717 E1000_DEV_PRIVATE_TO_HW(eth_dev->data->dev_private);
718 struct e1000_vfta * shadow_vfta =
719 E1000_DEV_PRIVATE_TO_VFTA(eth_dev->data->dev_private);
720 struct e1000_filter_info *filter_info =
721 E1000_DEV_PRIVATE_TO_FILTER_INFO(eth_dev->data->dev_private);
722 struct e1000_adapter *adapter =
723 E1000_DEV_PRIVATE(eth_dev->data->dev_private);
724
725 uint32_t ctrl_ext;
726
727 eth_dev->dev_ops = &eth_igb_ops;
728 eth_dev->rx_queue_count = eth_igb_rx_queue_count;
729 eth_dev->rx_descriptor_status = eth_igb_rx_descriptor_status;
730 eth_dev->tx_descriptor_status = eth_igb_tx_descriptor_status;
731 eth_dev->rx_pkt_burst = &eth_igb_recv_pkts;
732 eth_dev->tx_pkt_burst = &eth_igb_xmit_pkts;
733 eth_dev->tx_pkt_prepare = &eth_igb_prep_pkts;
734
735 /* for secondary processes, we don't initialise any further as primary
736 * has already done this work. Only check we don't need a different
737 * RX function */
738 if (rte_eal_process_type() != RTE_PROC_PRIMARY){
739 if (eth_dev->data->scattered_rx)
740 eth_dev->rx_pkt_burst = &eth_igb_recv_scattered_pkts;
741 return 0;
742 }
743
744 rte_eth_copy_pci_info(eth_dev, pci_dev);
745
746 hw->hw_addr= (void *)pci_dev->mem_resource[0].addr;
747
748 igb_identify_hardware(eth_dev, pci_dev);
749 if (e1000_setup_init_funcs(hw, FALSE) != E1000_SUCCESS) {
750 error = -EIO;
751 goto err_late;
752 }
753
754 e1000_get_bus_info(hw);
755
756 /* Reset any pending lock */
757 if (igb_reset_swfw_lock(hw) != E1000_SUCCESS) {
758 error = -EIO;
759 goto err_late;
760 }
761
762 /* Finish initialization */
763 if (e1000_setup_init_funcs(hw, TRUE) != E1000_SUCCESS) {
764 error = -EIO;
765 goto err_late;
766 }
767
768 hw->mac.autoneg = 1;

Callers 1

eth_igb_resetFunction · 0.85

Calls 15

rte_eal_process_typeFunction · 0.85
rte_eth_copy_pci_infoFunction · 0.85
igb_identify_hardwareFunction · 0.85
e1000_setup_init_funcsFunction · 0.85
e1000_get_bus_infoFunction · 0.85
igb_reset_swfw_lockFunction · 0.85
igb_pf_reset_hwFunction · 0.85
e1000_read_mac_addrFunction · 0.85
rte_zmallocFunction · 0.85
rte_ether_addr_copyFunction · 0.85
memsetFunction · 0.85

Tested by

no test coverage detected