MCPcopy Create free account
hub / github.com/F-Stack/f-stack / igbvf_dev_start

Function igbvf_dev_start

dpdk/drivers/net/e1000/igb_ethdev.c:3376–3442  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3374}
3375
3376static int
3377igbvf_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);

Callers

nothing calls this directly

Calls 12

rte_eal_process_typeFunction · 0.85
igbvf_set_vfta_allFunction · 0.85
eth_igbvf_tx_initFunction · 0.85
eth_igbvf_rx_initFunction · 0.85
igb_dev_clear_queuesFunction · 0.85
rte_intr_vec_list_allocFunction · 0.85
igbvf_intr_enableFunction · 0.85
rte_intr_cap_multipleFunction · 0.50
rte_intr_efd_enableFunction · 0.50
rte_intr_dp_is_enFunction · 0.50
rte_intr_enableFunction · 0.50

Tested by

no test coverage detected