| 446 | " <wrr_weight0..3>\n"; |
| 447 | |
| 448 | static void |
| 449 | cmd_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 | |
| 501 | static const char cmd_tmgr_help[] = |
| 502 | "tmgr <tmgr_name>\n" |
no test coverage detected