| 442 | "ethdev show [ <ethdev_name> ]\n"; |
| 443 | |
| 444 | static void |
| 445 | cmd_ethdev_show(char **tokens, |
| 446 | uint32_t n_tokens, |
| 447 | char *out, |
| 448 | size_t out_size, |
| 449 | void *obj __rte_unused) |
| 450 | { |
| 451 | uint16_t port_id; |
| 452 | |
| 453 | if (n_tokens != 2 && n_tokens != 3) { |
| 454 | snprintf(out, out_size, MSG_ARG_MISMATCH, tokens[0]); |
| 455 | return; |
| 456 | } |
| 457 | |
| 458 | /* Single device. */ |
| 459 | if (n_tokens == 3) { |
| 460 | int status; |
| 461 | |
| 462 | status = rte_eth_dev_get_port_by_name(tokens[2], &port_id); |
| 463 | if (status) |
| 464 | snprintf(out, out_size, "Error: Invalid Ethernet device name.\n"); |
| 465 | |
| 466 | ethdev_show(port_id, &out, &out_size); |
| 467 | return; |
| 468 | } |
| 469 | |
| 470 | /* All devices. */ |
| 471 | for (port_id = 0; port_id < RTE_MAX_ETHPORTS; port_id++) |
| 472 | if (rte_eth_dev_is_valid_port(port_id)) |
| 473 | ethdev_show(port_id, &out, &out_size); |
| 474 | } |
| 475 | |
| 476 | static const char cmd_ring_help[] = |
| 477 | "ring <ring_name> size <size> numa <numa_node>\n"; |
no test coverage detected