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

Function cmd_tmgr_pipe_profile

dpdk/examples/ip_pipeline/cli.c:448–499  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

446" <wrr_weight0..3>\n";
447
448static void
449cmd_tmgr_pipe_profile(char **tokens,
450 uint32_t n_tokens,
451 char *out,
452 size_t out_size)
453{
454 struct rte_sched_pipe_params p;
455 int status, i;
456
457 if (n_tokens != 24) {
458 snprintf(out, out_size, MSG_ARG_MISMATCH, tokens[0]);
459 return;
460 }
461
462 if (parser_read_uint64(&p.tb_rate, tokens[3]) != 0) {
463 snprintf(out, out_size, MSG_ARG_INVALID, "tb_rate");
464 return;
465 }
466
467 if (parser_read_uint64(&p.tb_size, tokens[4]) != 0) {
468 snprintf(out, out_size, MSG_ARG_INVALID, "tb_size");
469 return;
470 }
471
472 for (i = 0; i < RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE; i++)
473 if (parser_read_uint64(&p.tc_rate[i], tokens[5 + i]) != 0) {
474 snprintf(out, out_size, MSG_ARG_INVALID, "tc_rate");
475 return;
476 }
477
478 if (parser_read_uint64(&p.tc_period, tokens[18]) != 0) {
479 snprintf(out, out_size, MSG_ARG_INVALID, "tc_period");
480 return;
481 }
482
483 if (parser_read_uint8(&p.tc_ov_weight, tokens[19]) != 0) {
484 snprintf(out, out_size, MSG_ARG_INVALID, "tc_ov_weight");
485 return;
486 }
487
488 for (i = 0; i < RTE_SCHED_BE_QUEUES_PER_PIPE; i++)
489 if (parser_read_uint8(&p.wrr_weights[i], tokens[20 + i]) != 0) {
490 snprintf(out, out_size, MSG_ARG_INVALID, "wrr_weights");
491 return;
492 }
493
494 status = tmgr_pipe_profile_add(&p);
495 if (status != 0) {
496 snprintf(out, out_size, MSG_CMD_FAIL, tokens[0]);
497 return;
498 }
499}
500
501static const char cmd_tmgr_help[] =
502"tmgr <tmgr_name>\n"

Callers 1

cli_processFunction · 0.85

Calls 4

snprintfFunction · 0.85
tmgr_pipe_profile_addFunction · 0.85
parser_read_uint64Function · 0.70
parser_read_uint8Function · 0.70

Tested by

no test coverage detected