* Virtual Function device init */
| 1586 | * Virtual Function device init |
| 1587 | */ |
| 1588 | static int |
| 1589 | eth_ixgbevf_dev_init(struct rte_eth_dev *eth_dev) |
| 1590 | { |
| 1591 | int diag; |
| 1592 | uint32_t tc, tcs; |
| 1593 | struct ixgbe_adapter *ad = eth_dev->data->dev_private; |
| 1594 | struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(eth_dev); |
| 1595 | struct rte_intr_handle *intr_handle = pci_dev->intr_handle; |
| 1596 | struct ixgbe_hw *hw = |
| 1597 | IXGBE_DEV_PRIVATE_TO_HW(eth_dev->data->dev_private); |
| 1598 | struct ixgbe_vfta *shadow_vfta = |
| 1599 | IXGBE_DEV_PRIVATE_TO_VFTA(eth_dev->data->dev_private); |
| 1600 | struct ixgbe_hwstrip *hwstrip = |
| 1601 | IXGBE_DEV_PRIVATE_TO_HWSTRIP_BITMAP(eth_dev->data->dev_private); |
| 1602 | struct rte_ether_addr *perm_addr = |
| 1603 | (struct rte_ether_addr *)hw->mac.perm_addr; |
| 1604 | |
| 1605 | PMD_INIT_FUNC_TRACE(); |
| 1606 | |
| 1607 | eth_dev->dev_ops = &ixgbevf_eth_dev_ops; |
| 1608 | eth_dev->rx_descriptor_status = ixgbe_dev_rx_descriptor_status; |
| 1609 | eth_dev->tx_descriptor_status = ixgbe_dev_tx_descriptor_status; |
| 1610 | eth_dev->rx_pkt_burst = &ixgbe_recv_pkts; |
| 1611 | eth_dev->tx_pkt_burst = &ixgbe_xmit_pkts; |
| 1612 | |
| 1613 | /* for secondary processes, we don't initialise any further as primary |
| 1614 | * has already done this work. Only check we don't need a different |
| 1615 | * RX function |
| 1616 | */ |
| 1617 | if (rte_eal_process_type() != RTE_PROC_PRIMARY) { |
| 1618 | struct ixgbe_tx_queue *txq; |
| 1619 | /* TX queue function in primary, set by last queue initialized |
| 1620 | * Tx queue may not initialized by primary process |
| 1621 | */ |
| 1622 | if (eth_dev->data->tx_queues) { |
| 1623 | txq = eth_dev->data->tx_queues[eth_dev->data->nb_tx_queues - 1]; |
| 1624 | ixgbe_set_tx_function(eth_dev, txq); |
| 1625 | } else { |
| 1626 | /* Use default TX function if we get here */ |
| 1627 | PMD_INIT_LOG(NOTICE, |
| 1628 | "No TX queues configured yet. Using default TX function."); |
| 1629 | } |
| 1630 | |
| 1631 | ixgbe_set_rx_function(eth_dev); |
| 1632 | |
| 1633 | return 0; |
| 1634 | } |
| 1635 | |
| 1636 | /* NOTE: review for potential ordering optimization */ |
| 1637 | __atomic_clear(&ad->link_thread_running, __ATOMIC_SEQ_CST); |
| 1638 | ixgbevf_parse_devargs(eth_dev->data->dev_private, |
| 1639 | pci_dev->device.devargs); |
| 1640 | |
| 1641 | rte_eth_copy_pci_info(eth_dev, pci_dev); |
| 1642 | eth_dev->data->dev_flags |= RTE_ETH_DEV_AUTOFILL_QUEUE_XSTATS; |
| 1643 | |
| 1644 | hw->device_id = pci_dev->id.device_id; |
| 1645 | hw->vendor_id = pci_dev->id.vendor_id; |
no test coverage detected