| 502 | } |
| 503 | |
| 504 | static int |
| 505 | pdump_validate_port(uint16_t port, char *name) |
| 506 | { |
| 507 | int ret = 0; |
| 508 | |
| 509 | if (port >= RTE_MAX_ETHPORTS) { |
| 510 | PDUMP_LOG(ERR, "Invalid port id %u\n", port); |
| 511 | rte_errno = EINVAL; |
| 512 | return -1; |
| 513 | } |
| 514 | |
| 515 | ret = rte_eth_dev_get_name_by_port(port, name); |
| 516 | if (ret < 0) { |
| 517 | PDUMP_LOG(ERR, "port %u to name mapping failed\n", |
| 518 | port); |
| 519 | rte_errno = EINVAL; |
| 520 | return -1; |
| 521 | } |
| 522 | |
| 523 | return 0; |
| 524 | } |
| 525 | |
| 526 | static int |
| 527 | pdump_prepare_client_request(const char *device, uint16_t queue, |
no test coverage detected