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

Function i40e_dev_close

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

Source from the content-addressed store, hash-verified

2561}
2562
2563static int
2564i40e_dev_close(struct rte_eth_dev *dev)
2565{
2566 struct i40e_pf *pf = I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private);
2567 struct i40e_hw *hw = I40E_DEV_PRIVATE_TO_HW(dev->data->dev_private);
2568 struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(dev);
2569 struct rte_intr_handle *intr_handle = pci_dev->intr_handle;
2570 struct i40e_filter_control_settings settings;
2571 struct rte_flow *p_flow;
2572 uint32_t reg;
2573 int i;
2574 int ret;
2575 uint8_t aq_fail = 0;
2576 int retries = 0;
2577
2578 PMD_INIT_FUNC_TRACE();
2579 if (rte_eal_process_type() != RTE_PROC_PRIMARY)
2580 return 0;
2581
2582 ret = rte_eth_switch_domain_free(pf->switch_domain_id);
2583 if (ret)
2584 PMD_INIT_LOG(WARNING, "failed to free switch domain: %d", ret);
2585
2586
2587 ret = i40e_dev_stop(dev);
2588
2589 i40e_dev_free_queues(dev);
2590
2591 /* Disable interrupt */
2592 i40e_pf_disable_irq0(hw);
2593 rte_intr_disable(intr_handle);
2594
2595 /* shutdown and destroy the HMC */
2596 i40e_shutdown_lan_hmc(hw);
2597
2598 for (i = 0; i < pf->nb_cfg_vmdq_vsi; i++) {
2599 i40e_vsi_release(pf->vmdq[i].vsi);
2600 pf->vmdq[i].vsi = NULL;
2601 }
2602 rte_free(pf->vmdq);
2603 pf->vmdq = NULL;
2604
2605 /* release all the existing VSIs and VEBs */
2606 i40e_vsi_release(pf->main_vsi);
2607
2608 /* shutdown the adminq */
2609 i40e_aq_queue_shutdown(hw, true);
2610 i40e_shutdown_adminq(hw);
2611
2612 i40e_res_pool_destroy(&pf->qp_pool);
2613 i40e_res_pool_destroy(&pf->msix_pool);
2614
2615 /* Disable flexible payload in global configuration */
2616 if (!pf->support_multi_driver)
2617 i40e_flex_payload_reg_set_default(hw);
2618
2619 /* force a PF reset to clean anything leftover */
2620 reg = I40E_READ_REG(hw, I40E_PFGEN_CTRL);

Callers 1

eth_i40e_dev_uninitFunction · 0.85

Calls 15

rte_eal_process_typeFunction · 0.85
i40e_dev_stopFunction · 0.85
i40e_dev_free_queuesFunction · 0.85
i40e_pf_disable_irq0Function · 0.85
i40e_shutdown_lan_hmcFunction · 0.85
i40e_vsi_releaseFunction · 0.85
rte_freeFunction · 0.85
i40e_aq_queue_shutdownFunction · 0.85
i40e_shutdown_adminqFunction · 0.85
i40e_res_pool_destroyFunction · 0.85

Tested by

no test coverage detected