| 5614 | } |
| 5615 | |
| 5616 | static void |
| 5617 | cmd_pipeline_table_dscp(char **tokens, |
| 5618 | uint32_t n_tokens, |
| 5619 | char *out, |
| 5620 | size_t out_size) |
| 5621 | { |
| 5622 | struct rte_table_action_dscp_table dscp_table; |
| 5623 | char *pipeline_name, *file_name; |
| 5624 | uint32_t table_id, line_number; |
| 5625 | int status; |
| 5626 | |
| 5627 | if (n_tokens != 6) { |
| 5628 | snprintf(out, out_size, MSG_ARG_MISMATCH, tokens[0]); |
| 5629 | return; |
| 5630 | } |
| 5631 | |
| 5632 | pipeline_name = tokens[1]; |
| 5633 | |
| 5634 | if (strcmp(tokens[2], "table") != 0) { |
| 5635 | snprintf(out, out_size, MSG_ARG_NOT_FOUND, "port"); |
| 5636 | return; |
| 5637 | } |
| 5638 | |
| 5639 | if (parser_read_uint32(&table_id, tokens[3]) != 0) { |
| 5640 | snprintf(out, out_size, MSG_ARG_INVALID, "table_id"); |
| 5641 | return; |
| 5642 | } |
| 5643 | |
| 5644 | if (strcmp(tokens[4], "dscp") != 0) { |
| 5645 | snprintf(out, out_size, MSG_ARG_NOT_FOUND, "dscp"); |
| 5646 | return; |
| 5647 | } |
| 5648 | |
| 5649 | file_name = tokens[5]; |
| 5650 | |
| 5651 | status = load_dscp_table(&dscp_table, file_name, &line_number); |
| 5652 | if (status) { |
| 5653 | snprintf(out, out_size, MSG_FILE_ERR, file_name, line_number); |
| 5654 | return; |
| 5655 | } |
| 5656 | |
| 5657 | status = pipeline_table_dscp_table_update(pipeline_name, |
| 5658 | table_id, |
| 5659 | UINT64_MAX, |
| 5660 | &dscp_table); |
| 5661 | if (status) { |
| 5662 | snprintf(out, out_size, MSG_CMD_FAIL, tokens[0]); |
| 5663 | return; |
| 5664 | } |
| 5665 | } |
| 5666 | |
| 5667 | |
| 5668 | static const char cmd_pipeline_table_rule_ttl_read_help[] = |
no test coverage detected