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

Function octeontx_remove

dpdk/drivers/net/octeontx/octeontx_ethdev.c:1698–1735  ·  view source on GitHub ↗

Un initialize octeontx device */

Source from the content-addressed store, hash-verified

1696
1697/* Un initialize octeontx device */
1698static int
1699octeontx_remove(struct rte_vdev_device *dev)
1700{
1701 char octtx_name[OCTEONTX_MAX_NAME_LEN];
1702 struct rte_eth_dev *eth_dev = NULL;
1703 struct octeontx_nic *nic = NULL;
1704 int i;
1705
1706 if (dev == NULL)
1707 return -EINVAL;
1708
1709 for (i = 0; i < OCTEONTX_VDEV_DEFAULT_MAX_NR_PORT; i++) {
1710 sprintf(octtx_name, "eth_octeontx_%d", i);
1711
1712 eth_dev = rte_eth_dev_allocated(octtx_name);
1713 if (eth_dev == NULL)
1714 continue; /* port already released */
1715
1716 if (rte_eal_process_type() != RTE_PROC_PRIMARY) {
1717 rte_eth_dev_release_port(eth_dev);
1718 continue;
1719 }
1720
1721 nic = octeontx_pmd_priv(eth_dev);
1722 rte_event_dev_stop(nic->evdev);
1723 PMD_INIT_LOG(INFO, "Closing octeontx device %s", octtx_name);
1724 octeontx_dev_close(eth_dev);
1725 rte_eth_dev_release_port(eth_dev);
1726 }
1727
1728 if (rte_eal_process_type() != RTE_PROC_PRIMARY)
1729 return 0;
1730
1731 /* Free FC resource */
1732 octeontx_pko_fc_free();
1733
1734 return 0;
1735}
1736
1737/* Initialize octeontx device */
1738static int

Callers 1

octeontx_probeFunction · 0.85

Calls 8

sprintfFunction · 0.85
rte_eth_dev_allocatedFunction · 0.85
rte_eal_process_typeFunction · 0.85
rte_eth_dev_release_portFunction · 0.85
octeontx_pmd_privFunction · 0.85
rte_event_dev_stopFunction · 0.85
octeontx_dev_closeFunction · 0.85
octeontx_pko_fc_freeFunction · 0.85

Tested by

no test coverage detected