| 5464 | } |
| 5465 | |
| 5466 | static int |
| 5467 | ixgbevf_dev_start(struct rte_eth_dev *dev) |
| 5468 | { |
| 5469 | struct ixgbe_hw *hw = |
| 5470 | IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private); |
| 5471 | uint32_t intr_vector = 0; |
| 5472 | struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(dev); |
| 5473 | struct rte_intr_handle *intr_handle = pci_dev->intr_handle; |
| 5474 | |
| 5475 | int err, mask = 0; |
| 5476 | |
| 5477 | /* |
| 5478 | * This function calls into the base driver, which in turn will use |
| 5479 | * function pointers, which are not guaranteed to be valid in secondary |
| 5480 | * processes, so avoid using this function in secondary processes. |
| 5481 | */ |
| 5482 | if (rte_eal_process_type() != RTE_PROC_PRIMARY) |
| 5483 | return -E_RTE_SECONDARY; |
| 5484 | |
| 5485 | PMD_INIT_FUNC_TRACE(); |
| 5486 | |
| 5487 | /* Stop the link setup handler before resetting the HW. */ |
| 5488 | ixgbe_dev_wait_setup_link_complete(dev, 0); |
| 5489 | |
| 5490 | err = hw->mac.ops.reset_hw(hw); |
| 5491 | |
| 5492 | /** |
| 5493 | * In this case, reuses the MAC address assigned by VF |
| 5494 | * initialization. |
| 5495 | */ |
| 5496 | if (err != IXGBE_SUCCESS && err != IXGBE_ERR_INVALID_MAC_ADDR) { |
| 5497 | PMD_INIT_LOG(ERR, "Unable to reset vf hardware (%d)", err); |
| 5498 | return err; |
| 5499 | } |
| 5500 | |
| 5501 | hw->mac.get_link_status = true; |
| 5502 | |
| 5503 | /* negotiate mailbox API version to use with the PF. */ |
| 5504 | ixgbevf_negotiate_api(hw); |
| 5505 | |
| 5506 | ixgbevf_dev_tx_init(dev); |
| 5507 | |
| 5508 | /* This can fail when allocating mbufs for descriptor rings */ |
| 5509 | err = ixgbevf_dev_rx_init(dev); |
| 5510 | if (err) { |
| 5511 | PMD_INIT_LOG(ERR, "Unable to initialize RX hardware (%d)", err); |
| 5512 | ixgbe_dev_clear_queues(dev); |
| 5513 | return err; |
| 5514 | } |
| 5515 | |
| 5516 | /* Set vfta */ |
| 5517 | ixgbevf_set_vfta_all(dev, 1); |
| 5518 | |
| 5519 | /* Set HW strip */ |
| 5520 | mask = RTE_ETH_VLAN_STRIP_MASK | RTE_ETH_VLAN_FILTER_MASK | |
| 5521 | RTE_ETH_VLAN_EXTEND_MASK; |
| 5522 | err = ixgbevf_vlan_offload_config(dev, mask); |
| 5523 | if (err) { |
nothing calls this directly
no test coverage detected