* Virtual Function device init */
| 903 | * Virtual Function device init |
| 904 | */ |
| 905 | static int |
| 906 | eth_igbvf_dev_init(struct rte_eth_dev *eth_dev) |
| 907 | { |
| 908 | struct rte_pci_device *pci_dev; |
| 909 | struct rte_intr_handle *intr_handle; |
| 910 | struct e1000_adapter *adapter = |
| 911 | E1000_DEV_PRIVATE(eth_dev->data->dev_private); |
| 912 | struct e1000_hw *hw = |
| 913 | E1000_DEV_PRIVATE_TO_HW(eth_dev->data->dev_private); |
| 914 | int diag; |
| 915 | struct rte_ether_addr *perm_addr = |
| 916 | (struct rte_ether_addr *)hw->mac.perm_addr; |
| 917 | |
| 918 | PMD_INIT_FUNC_TRACE(); |
| 919 | |
| 920 | eth_dev->dev_ops = &igbvf_eth_dev_ops; |
| 921 | eth_dev->rx_descriptor_status = eth_igb_rx_descriptor_status; |
| 922 | eth_dev->tx_descriptor_status = eth_igb_tx_descriptor_status; |
| 923 | eth_dev->rx_pkt_burst = ð_igb_recv_pkts; |
| 924 | eth_dev->tx_pkt_burst = ð_igb_xmit_pkts; |
| 925 | eth_dev->tx_pkt_prepare = ð_igb_prep_pkts; |
| 926 | |
| 927 | /* for secondary processes, we don't initialise any further as primary |
| 928 | * has already done this work. Only check we don't need a different |
| 929 | * RX function */ |
| 930 | if (rte_eal_process_type() != RTE_PROC_PRIMARY){ |
| 931 | if (eth_dev->data->scattered_rx) |
| 932 | eth_dev->rx_pkt_burst = ð_igb_recv_scattered_pkts; |
| 933 | return 0; |
| 934 | } |
| 935 | |
| 936 | pci_dev = RTE_ETH_DEV_TO_PCI(eth_dev); |
| 937 | rte_eth_copy_pci_info(eth_dev, pci_dev); |
| 938 | |
| 939 | hw->device_id = pci_dev->id.device_id; |
| 940 | hw->vendor_id = pci_dev->id.vendor_id; |
| 941 | hw->hw_addr = (void *)pci_dev->mem_resource[0].addr; |
| 942 | adapter->stopped = 0; |
| 943 | |
| 944 | /* Initialize the shared code (base driver) */ |
| 945 | diag = e1000_setup_init_funcs(hw, TRUE); |
| 946 | if (diag != 0) { |
| 947 | PMD_INIT_LOG(ERR, "Shared code init failed for igbvf: %d", |
| 948 | diag); |
| 949 | return -EIO; |
| 950 | } |
| 951 | |
| 952 | /* init_mailbox_params */ |
| 953 | hw->mbx.ops.init_params(hw); |
| 954 | |
| 955 | /* Disable the interrupts for VF */ |
| 956 | igbvf_intr_disable(hw); |
| 957 | |
| 958 | diag = hw->mac.ops.reset_hw(hw); |
| 959 | |
| 960 | /* Allocate memory for storing MAC addresses */ |
| 961 | eth_dev->data->mac_addrs = rte_zmalloc("igbvf", RTE_ETHER_ADDR_LEN * |
| 962 | hw->mac.rar_entry_count, 0); |
nothing calls this directly
no test coverage detected