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

Function cmd_tmgr_subport_profile

dpdk/examples/ip_pipeline/cli.c:395–436  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

393" <tc_period>\n";
394
395static void
396cmd_tmgr_subport_profile(char **tokens,
397 uint32_t n_tokens,
398 char *out,
399 size_t out_size)
400{
401 struct rte_sched_subport_profile_params subport_profile;
402 int status, i;
403
404 if (n_tokens != 19) {
405 snprintf(out, out_size, MSG_ARG_MISMATCH, tokens[0]);
406 return;
407 }
408
409 if (parser_read_uint64(&subport_profile.tb_rate, tokens[3]) != 0) {
410 snprintf(out, out_size, MSG_ARG_INVALID, "tb_rate");
411 return;
412 }
413
414 if (parser_read_uint64(&subport_profile.tb_size, tokens[4]) != 0) {
415 snprintf(out, out_size, MSG_ARG_INVALID, "tb_size");
416 return;
417 }
418
419 for (i = 0; i < RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE; i++)
420 if (parser_read_uint64(&subport_profile.tc_rate[i],
421 tokens[5 + i]) != 0) {
422 snprintf(out, out_size, MSG_ARG_INVALID, "tc_rate");
423 return;
424 }
425
426 if (parser_read_uint64(&subport_profile.tc_period, tokens[18]) != 0) {
427 snprintf(out, out_size, MSG_ARG_INVALID, "tc_period");
428 return;
429 }
430
431 status = tmgr_subport_profile_add(&subport_profile);
432 if (status != 0) {
433 snprintf(out, out_size, MSG_CMD_FAIL, tokens[0]);
434 return;
435 }
436}
437
438static const char cmd_tmgr_pipe_profile_help[] =
439"tmgr pipe profile\n"

Callers 1

cli_processFunction · 0.85

Calls 3

snprintfFunction · 0.85
tmgr_subport_profile_addFunction · 0.85
parser_read_uint64Function · 0.70

Tested by

no test coverage detected