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

Function cmd_ethdev_show

dpdk/examples/pipeline/cli.c:444–474  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

442"ethdev show [ <ethdev_name> ]\n";
443
444static void
445cmd_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
476static const char cmd_ring_help[] =
477"ring <ring_name> size <size> numa <numa_node>\n";

Callers 1

cli_processFunction · 0.85

Calls 4

snprintfFunction · 0.85
ethdev_showFunction · 0.70

Tested by

no test coverage detected