| 350 | } |
| 351 | |
| 352 | static int |
| 353 | parse_eventdev_port_xstats_params(const char *list) |
| 354 | { |
| 355 | uint16_t port_id; |
| 356 | uint16_t evdev_id; |
| 357 | |
| 358 | if (sscanf(list, "*:%hu", &evdev_id) == 1) { |
| 359 | if (evdev_id >= rte_event_dev_count()) { |
| 360 | printf("Invalid eventdev id: %hu\n", evdev_id); |
| 361 | return -EINVAL; |
| 362 | } |
| 363 | eventdev_var[evdev_id].shw_all_ports = 1; |
| 364 | } else if (sscanf(list, "%hu:%hu", &port_id, &evdev_id) == 2) { |
| 365 | if (evdev_id >= rte_event_dev_count()) { |
| 366 | printf("Invalid eventdev id: %hu\n", evdev_id); |
| 367 | return -EINVAL; |
| 368 | } |
| 369 | |
| 370 | if (port_id >= MAX_PORTS_QUEUES) { |
| 371 | printf("Invalid port_id: %hu\n", port_id); |
| 372 | return -EINVAL; |
| 373 | } |
| 374 | |
| 375 | eventdev_var[evdev_id].ports[eventdev_var[evdev_id].num_ports] = port_id; |
| 376 | eventdev_var[evdev_id].num_ports++; |
| 377 | } else { |
| 378 | return -EINVAL; |
| 379 | } |
| 380 | |
| 381 | return 0; |
| 382 | } |
| 383 | |
| 384 | static int |
| 385 | proc_info_preparse_args(int argc, char **argv) |
no test coverage detected