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

Function eth_mac_cmp

dpdk/lib/ethdev/rte_class_eth.c:40–59  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

38 })
39
40static int
41eth_mac_cmp(const char *key __rte_unused,
42 const char *value, void *opaque)
43{
44 struct rte_ether_addr mac;
45 const struct rte_eth_dev_data *data = opaque;
46 struct rte_eth_dev_info dev_info;
47 uint32_t index;
48
49 /* Parse devargs MAC address. */
50 if (rte_ether_unformat_addr(value, &mac) < 0)
51 return -1; /* invalid devargs value */
52
53 /* Return 0 if devargs MAC is matching one of the device MACs. */
54 rte_eth_dev_info_get(data->port_id, &dev_info);
55 for (index = 0; index < dev_info.max_mac_addrs; index++)
56 if (rte_is_same_ether_addr(&mac, &data->mac_addrs[index]))
57 return 0;
58 return -1; /* no match */
59}
60
61static int
62eth_representor_cmp(const char *key __rte_unused,

Callers

nothing calls this directly

Calls 3

rte_ether_unformat_addrFunction · 0.85
rte_eth_dev_info_getFunction · 0.85
rte_is_same_ether_addrFunction · 0.85

Tested by

no test coverage detected