| 3374 | } |
| 3375 | |
| 3376 | static int |
| 3377 | igbvf_dev_start(struct rte_eth_dev *dev) |
| 3378 | { |
| 3379 | struct e1000_hw *hw = |
| 3380 | E1000_DEV_PRIVATE_TO_HW(dev->data->dev_private); |
| 3381 | struct e1000_adapter *adapter = |
| 3382 | E1000_DEV_PRIVATE(dev->data->dev_private); |
| 3383 | struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(dev); |
| 3384 | struct rte_intr_handle *intr_handle = pci_dev->intr_handle; |
| 3385 | int ret; |
| 3386 | uint32_t intr_vector = 0; |
| 3387 | |
| 3388 | /* |
| 3389 | * This function calls into the base driver, which in turn will use |
| 3390 | * function pointers, which are not guaranteed to be valid in secondary |
| 3391 | * processes, so avoid using this function in secondary processes. |
| 3392 | */ |
| 3393 | if (rte_eal_process_type() != RTE_PROC_PRIMARY) |
| 3394 | return -E_RTE_SECONDARY; |
| 3395 | |
| 3396 | PMD_INIT_FUNC_TRACE(); |
| 3397 | |
| 3398 | hw->mac.ops.reset_hw(hw); |
| 3399 | adapter->stopped = 0; |
| 3400 | |
| 3401 | /* Set all vfta */ |
| 3402 | igbvf_set_vfta_all(dev,1); |
| 3403 | |
| 3404 | eth_igbvf_tx_init(dev); |
| 3405 | |
| 3406 | /* This can fail when allocating mbufs for descriptor rings */ |
| 3407 | ret = eth_igbvf_rx_init(dev); |
| 3408 | if (ret) { |
| 3409 | PMD_INIT_LOG(ERR, "Unable to initialize RX hardware"); |
| 3410 | igb_dev_clear_queues(dev); |
| 3411 | return ret; |
| 3412 | } |
| 3413 | |
| 3414 | /* check and configure queue intr-vector mapping */ |
| 3415 | if (rte_intr_cap_multiple(intr_handle) && |
| 3416 | dev->data->dev_conf.intr_conf.rxq) { |
| 3417 | intr_vector = dev->data->nb_rx_queues; |
| 3418 | ret = rte_intr_efd_enable(intr_handle, intr_vector); |
| 3419 | if (ret) |
| 3420 | return ret; |
| 3421 | } |
| 3422 | |
| 3423 | /* Allocate the vector list */ |
| 3424 | if (rte_intr_dp_is_en(intr_handle)) { |
| 3425 | if (rte_intr_vec_list_alloc(intr_handle, "intr_vec", |
| 3426 | dev->data->nb_rx_queues)) { |
| 3427 | PMD_INIT_LOG(ERR, "Failed to allocate %d rx_queues" |
| 3428 | " intr_vec", dev->data->nb_rx_queues); |
| 3429 | return -ENOMEM; |
| 3430 | } |
| 3431 | } |
| 3432 | |
| 3433 | eth_igbvf_configure_msix_intr(dev); |
nothing calls this directly
no test coverage detected