| 38 | }) |
| 39 | |
| 40 | static int |
| 41 | eth_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 | |
| 61 | static int |
| 62 | eth_representor_cmp(const char *key __rte_unused, |
nothing calls this directly
no test coverage detected