MCPcopy Create free account
hub / github.com/F-Stack/f-stack / parse_eventdev_port_xstats_params

Function parse_eventdev_port_xstats_params

dpdk/app/proc-info/main.c:352–382  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

350}
351
352static int
353parse_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
384static int
385proc_info_preparse_args(int argc, char **argv)

Callers 1

proc_info_parse_argsFunction · 0.85

Calls 3

sscanfFunction · 0.85
rte_event_dev_countFunction · 0.85
printfFunction · 0.50

Tested by

no test coverage detected