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

Function eth_find_device

dpdk/lib/ethdev/ethdev_private.c:28–50  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

26}
27
28struct rte_eth_dev *
29eth_find_device(const struct rte_eth_dev *start, rte_eth_cmp_t cmp,
30 const void *data)
31{
32 struct rte_eth_dev *edev;
33 ptrdiff_t idx;
34
35 /* Avoid Undefined Behaviour */
36 if (start != NULL &&
37 (start < &rte_eth_devices[0] ||
38 start > &rte_eth_devices[RTE_MAX_ETHPORTS]))
39 return NULL;
40 if (start != NULL)
41 idx = eth_dev_to_id(start) + 1;
42 else
43 idx = 0;
44 for (; idx < RTE_MAX_ETHPORTS; idx++) {
45 edev = &rte_eth_devices[idx];
46 if (cmp(edev, data) == 0)
47 return edev;
48 }
49 return NULL;
50}
51
52/* Put new value into list. */
53static int

Callers 1

eth_dev_iterateFunction · 0.85

Calls 1

eth_dev_to_idFunction · 0.85

Tested by

no test coverage detected