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

Function eth_dev_find_free_port

dpdk/lib/ethdev/ethdev_driver.c:46–61  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

44}
45
46static uint16_t
47eth_dev_find_free_port(void)
48 __rte_exclusive_locks_required(rte_mcfg_ethdev_get_lock())
49{
50 uint16_t i;
51
52 for (i = 0; i < RTE_MAX_ETHPORTS; i++) {
53 /* Using shared name field to find a free port. */
54 if (eth_dev_shared_data->data[i].name[0] == '\0') {
55 RTE_ASSERT(rte_eth_devices[i].state ==
56 RTE_ETH_DEV_UNUSED);
57 return i;
58 }
59 }
60 return RTE_MAX_ETHPORTS;
61}
62
63static struct rte_eth_dev *
64eth_dev_get(uint16_t port_id)

Callers 1

rte_eth_dev_allocateFunction · 0.85

Calls 1

rte_mcfg_ethdev_get_lockFunction · 0.85

Tested by

no test coverage detected