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

Function i40e_dev_start

dpdk/drivers/net/i40e/i40e_ethdev.c:2319–2498  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2317}
2318
2319static int
2320i40e_dev_start(struct rte_eth_dev *dev)
2321{
2322 struct i40e_pf *pf = I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private);
2323 struct i40e_hw *hw = I40E_DEV_PRIVATE_TO_HW(dev->data->dev_private);
2324 struct i40e_vsi *main_vsi = pf->main_vsi;
2325 int ret, i;
2326 struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(dev);
2327 struct rte_intr_handle *intr_handle = pci_dev->intr_handle;
2328 uint32_t intr_vector = 0;
2329 struct i40e_vsi *vsi;
2330 uint16_t nb_rxq, nb_txq;
2331 uint16_t max_frame_size;
2332
2333 hw->adapter_stopped = 0;
2334
2335 rte_intr_disable(intr_handle);
2336
2337 if ((rte_intr_cap_multiple(intr_handle) ||
2338 !RTE_ETH_DEV_SRIOV(dev).active) &&
2339 dev->data->dev_conf.intr_conf.rxq != 0) {
2340 intr_vector = dev->data->nb_rx_queues;
2341 ret = rte_intr_efd_enable(intr_handle, intr_vector);
2342 if (ret)
2343 return ret;
2344 }
2345
2346 if (rte_intr_dp_is_en(intr_handle)) {
2347 if (rte_intr_vec_list_alloc(intr_handle, "intr_vec",
2348 dev->data->nb_rx_queues)) {
2349 PMD_INIT_LOG(ERR,
2350 "Failed to allocate %d rx_queues intr_vec",
2351 dev->data->nb_rx_queues);
2352 return -ENOMEM;
2353 }
2354 }
2355
2356 /* Initialize VSI */
2357 ret = i40e_dev_rxtx_init(pf);
2358 if (ret != I40E_SUCCESS) {
2359 PMD_DRV_LOG(ERR, "Failed to init rx/tx queues");
2360 return ret;
2361 }
2362
2363 /* Map queues with MSIX interrupt */
2364 main_vsi->nb_used_qps = dev->data->nb_rx_queues -
2365 pf->nb_cfg_vmdq_vsi * RTE_LIBRTE_I40E_QUEUE_NUM_PER_VM;
2366 ret = i40e_vsi_queues_bind_intr(main_vsi, I40E_ITR_INDEX_DEFAULT);
2367 if (ret < 0)
2368 return ret;
2369 i40e_vsi_enable_queues_intr(main_vsi);
2370
2371 /* Map VMDQ VSI queues with MSIX interrupt */
2372 for (i = 0; i < pf->nb_cfg_vmdq_vsi; i++) {
2373 pf->vmdq[i].vsi->nb_used_qps = RTE_LIBRTE_I40E_QUEUE_NUM_PER_VM;
2374 ret = i40e_vsi_queues_bind_intr(pf->vmdq[i].vsi,
2375 I40E_ITR_INDEX_DEFAULT);
2376 if (ret < 0)

Callers

nothing calls this directly

Calls 15

rte_intr_vec_list_allocFunction · 0.85
i40e_dev_rxtx_initFunction · 0.85
i40e_dev_rx_queue_startFunction · 0.85
i40e_dev_tx_queue_startFunction · 0.85
i40e_aq_set_lb_modesFunction · 0.85
i40e_apply_link_speedFunction · 0.85
i40e_pf_config_irq0Function · 0.85
i40e_pf_enable_irq0Function · 0.85

Tested by

no test coverage detected