* Virtual Function device init */
| 161 | * Virtual Function device init |
| 162 | */ |
| 163 | static int |
| 164 | eth_txgbevf_dev_init(struct rte_eth_dev *eth_dev) |
| 165 | { |
| 166 | int err; |
| 167 | uint32_t tc, tcs; |
| 168 | struct txgbe_adapter *ad = eth_dev->data->dev_private; |
| 169 | struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(eth_dev); |
| 170 | struct rte_intr_handle *intr_handle = pci_dev->intr_handle; |
| 171 | struct txgbe_hw *hw = TXGBE_DEV_HW(eth_dev); |
| 172 | struct txgbe_vfta *shadow_vfta = TXGBE_DEV_VFTA(eth_dev); |
| 173 | struct txgbe_hwstrip *hwstrip = TXGBE_DEV_HWSTRIP(eth_dev); |
| 174 | struct rte_ether_addr *perm_addr = |
| 175 | (struct rte_ether_addr *)hw->mac.perm_addr; |
| 176 | |
| 177 | PMD_INIT_FUNC_TRACE(); |
| 178 | |
| 179 | eth_dev->dev_ops = &txgbevf_eth_dev_ops; |
| 180 | eth_dev->rx_descriptor_status = txgbe_dev_rx_descriptor_status; |
| 181 | eth_dev->tx_descriptor_status = txgbe_dev_tx_descriptor_status; |
| 182 | eth_dev->rx_pkt_burst = &txgbe_recv_pkts; |
| 183 | eth_dev->tx_pkt_burst = &txgbe_xmit_pkts; |
| 184 | |
| 185 | /* for secondary processes, we don't initialise any further as primary |
| 186 | * has already done this work. Only check we don't need a different |
| 187 | * RX function |
| 188 | */ |
| 189 | if (rte_eal_process_type() != RTE_PROC_PRIMARY) { |
| 190 | struct txgbe_tx_queue *txq; |
| 191 | uint16_t nb_tx_queues = eth_dev->data->nb_tx_queues; |
| 192 | /* TX queue function in primary, set by last queue initialized |
| 193 | * Tx queue may not initialized by primary process |
| 194 | */ |
| 195 | if (eth_dev->data->tx_queues) { |
| 196 | txq = eth_dev->data->tx_queues[nb_tx_queues - 1]; |
| 197 | txgbe_set_tx_function(eth_dev, txq); |
| 198 | } else { |
| 199 | /* Use default TX function if we get here */ |
| 200 | PMD_INIT_LOG(NOTICE, |
| 201 | "No TX queues configured yet. Using default TX function."); |
| 202 | } |
| 203 | |
| 204 | txgbe_set_rx_function(eth_dev); |
| 205 | |
| 206 | return 0; |
| 207 | } |
| 208 | |
| 209 | __atomic_clear(&ad->link_thread_running, __ATOMIC_SEQ_CST); |
| 210 | rte_eth_copy_pci_info(eth_dev, pci_dev); |
| 211 | |
| 212 | hw->device_id = pci_dev->id.device_id; |
| 213 | hw->vendor_id = pci_dev->id.vendor_id; |
| 214 | hw->subsystem_device_id = pci_dev->id.subsystem_device_id; |
| 215 | hw->subsystem_vendor_id = pci_dev->id.subsystem_vendor_id; |
| 216 | hw->hw_addr = (void *)pci_dev->mem_resource[0].addr; |
| 217 | |
| 218 | /* initialize the vfta */ |
| 219 | memset(shadow_vfta, 0, sizeof(*shadow_vfta)); |
| 220 |
no test coverage detected