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

Function eth_igb_close

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

Source from the content-addressed store, hash-verified

1528}
1529
1530static int
1531eth_igb_close(struct rte_eth_dev *dev)
1532{
1533 struct e1000_hw *hw = E1000_DEV_PRIVATE_TO_HW(dev->data->dev_private);
1534 struct rte_eth_link link;
1535 struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(dev);
1536 struct rte_intr_handle *intr_handle = pci_dev->intr_handle;
1537 struct e1000_filter_info *filter_info =
1538 E1000_DEV_PRIVATE_TO_FILTER_INFO(dev->data->dev_private);
1539 int ret;
1540
1541 if (rte_eal_process_type() != RTE_PROC_PRIMARY)
1542 return 0;
1543
1544 ret = eth_igb_stop(dev);
1545
1546 e1000_phy_hw_reset(hw);
1547 igb_release_manageability(hw);
1548 igb_hw_control_release(hw);
1549
1550 /* Clear bit for Go Link disconnect if PHY reset is not blocked */
1551 if (hw->mac.type >= e1000_82580 &&
1552 (e1000_check_reset_block(hw) != E1000_BLK_PHY_RESET)) {
1553 uint32_t phpm_reg;
1554
1555 phpm_reg = E1000_READ_REG(hw, E1000_82580_PHY_POWER_MGMT);
1556 phpm_reg &= ~E1000_82580_PM_GO_LINKD;
1557 E1000_WRITE_REG(hw, E1000_82580_PHY_POWER_MGMT, phpm_reg);
1558 }
1559
1560 igb_dev_free_queues(dev);
1561
1562 /* Cleanup vector list */
1563 rte_intr_vec_list_free(intr_handle);
1564
1565 memset(&link, 0, sizeof(link));
1566 rte_eth_linkstatus_set(dev, &link);
1567
1568 /* Reset any pending lock */
1569 igb_reset_swfw_lock(hw);
1570
1571 /* uninitialize PF if max_vfs not zero */
1572 igb_pf_host_uninit(dev);
1573
1574 rte_intr_callback_unregister(intr_handle,
1575 eth_igb_interrupt_handler, dev);
1576
1577 /* clear the SYN filter info */
1578 filter_info->syn_info = 0;
1579
1580 /* clear the ethertype filters info */
1581 filter_info->ethertype_mask = 0;
1582 memset(filter_info->ethertype_filters, 0,
1583 E1000_MAX_ETQF_FILTERS * sizeof(struct igb_ethertype_filter));
1584
1585 /* clear the rss filter info */
1586 memset(&filter_info->rss_info, 0,
1587 sizeof(struct igb_rte_flow_rss_conf));

Callers 1

eth_igb_dev_uninitFunction · 0.85

Calls 15

rte_eal_process_typeFunction · 0.85
eth_igb_stopFunction · 0.85
e1000_phy_hw_resetFunction · 0.85
igb_hw_control_releaseFunction · 0.85
e1000_check_reset_blockFunction · 0.85
igb_dev_free_queuesFunction · 0.85
rte_intr_vec_list_freeFunction · 0.85
memsetFunction · 0.85
rte_eth_linkstatus_setFunction · 0.85
igb_reset_swfw_lockFunction · 0.85
igb_pf_host_uninitFunction · 0.85

Tested by

no test coverage detected