Name has been set but need to lookup port after eal_init */
| 230 | |
| 231 | /* Name has been set but need to lookup port after eal_init */ |
| 232 | static void find_interfaces(void) |
| 233 | { |
| 234 | struct interface *intf; |
| 235 | |
| 236 | TAILQ_FOREACH(intf, &interfaces, next) { |
| 237 | /* if name is valid then just record port */ |
| 238 | if (rte_eth_dev_get_port_by_name(intf->name, &intf->port) == 0) |
| 239 | continue; |
| 240 | |
| 241 | /* maybe got passed port number string as name */ |
| 242 | intf->port = get_uint(intf->name, "port_number", UINT16_MAX); |
| 243 | if (rte_eth_dev_get_name_by_port(intf->port, intf->name) < 0) |
| 244 | rte_exit(EXIT_FAILURE, "Invalid port number %u\n", |
| 245 | intf->port); |
| 246 | } |
| 247 | } |
| 248 | |
| 249 | /* |
| 250 | * Choose interface to capture if no -i option given. |
no test coverage detected