| 709 | } |
| 710 | |
| 711 | static int |
| 712 | eth_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 = ð_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 = ð_igb_recv_pkts; |
| 732 | eth_dev->tx_pkt_burst = ð_igb_xmit_pkts; |
| 733 | eth_dev->tx_pkt_prepare = ð_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 = ð_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; |
no test coverage detected