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

Function rte_eth_dev_close

dpdk/lib/ethdev/rte_ethdev.c:1860–1892  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1858}
1859
1860int
1861rte_eth_dev_close(uint16_t port_id)
1862{
1863 struct rte_eth_dev *dev;
1864 int firsterr, binerr;
1865 int *lasterr = &firsterr;
1866
1867 RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
1868 dev = &rte_eth_devices[port_id];
1869
1870 /*
1871 * Secondary process needs to close device to release process private
1872 * resources. But secondary process should not be obliged to wait
1873 * for device stop before closing ethdev.
1874 */
1875 if (rte_eal_process_type() == RTE_PROC_PRIMARY &&
1876 dev->data->dev_started) {
1877 RTE_ETHDEV_LOG(ERR, "Cannot close started device (port %u)\n",
1878 port_id);
1879 return -EINVAL;
1880 }
1881
1882 if (*dev->dev_ops->dev_close == NULL)
1883 return -ENOTSUP;
1884 *lasterr = (*dev->dev_ops->dev_close)(dev);
1885 if (*lasterr != 0)
1886 lasterr = &binerr;
1887
1888 rte_ethdev_trace_close(port_id);
1889 *lasterr = rte_eth_dev_release_port(dev);
1890
1891 return firsterr;
1892}
1893
1894int
1895rte_eth_dev_reset(uint16_t port_id)

Callers 15

rte_pmd_memif_removeFunction · 0.85
mlx4_pci_removeFunction · 0.85
virtio_user_pmd_removeFunction · 0.85
nfp_pci_uninitFunction · 0.85
rte_pmd_mrvl_removeFunction · 0.85
cpfl_pci_probe_firstFunction · 0.85
cpfl_pci_removeFunction · 0.85
mlx5_net_removeFunction · 0.85
eth_cxgbe_dev_uninitFunction · 0.85
eth_cxgbevf_dev_uninitFunction · 0.85
failsafe_eth_dev_closeFunction · 0.85
fs_dev_removeFunction · 0.85

Calls 2

rte_eal_process_typeFunction · 0.85
rte_eth_dev_release_portFunction · 0.85

Tested by 3

close_portFunction · 0.68