| 2035 | "cir <cir> pir <pir> cbs <cbs> pbs <pbs>\n"; |
| 2036 | |
| 2037 | static void |
| 2038 | cmd_pipeline_meter_profile_add(char **tokens, |
| 2039 | uint32_t n_tokens, |
| 2040 | char *out, |
| 2041 | size_t out_size, |
| 2042 | void *obj __rte_unused) |
| 2043 | { |
| 2044 | struct rte_meter_trtcm_params params; |
| 2045 | struct rte_swx_pipeline *p; |
| 2046 | const char *profile_name; |
| 2047 | int status; |
| 2048 | |
| 2049 | if (n_tokens != 14) { |
| 2050 | snprintf(out, out_size, MSG_ARG_MISMATCH, tokens[0]); |
| 2051 | return; |
| 2052 | } |
| 2053 | |
| 2054 | p = rte_swx_pipeline_find(tokens[1]); |
| 2055 | if (!p) { |
| 2056 | snprintf(out, out_size, MSG_ARG_INVALID, "pipeline_name"); |
| 2057 | return; |
| 2058 | } |
| 2059 | |
| 2060 | if (strcmp(tokens[2], "meter")) { |
| 2061 | snprintf(out, out_size, MSG_ARG_NOT_FOUND, "meter"); |
| 2062 | return; |
| 2063 | } |
| 2064 | |
| 2065 | if (strcmp(tokens[3], "profile")) { |
| 2066 | snprintf(out, out_size, MSG_ARG_NOT_FOUND, "profile"); |
| 2067 | return; |
| 2068 | } |
| 2069 | |
| 2070 | profile_name = tokens[4]; |
| 2071 | |
| 2072 | if (strcmp(tokens[5], "add")) { |
| 2073 | snprintf(out, out_size, MSG_ARG_NOT_FOUND, "add"); |
| 2074 | return; |
| 2075 | } |
| 2076 | |
| 2077 | if (strcmp(tokens[6], "cir")) { |
| 2078 | snprintf(out, out_size, MSG_ARG_NOT_FOUND, "cir"); |
| 2079 | return; |
| 2080 | } |
| 2081 | |
| 2082 | if (parser_read_uint64(¶ms.cir, tokens[7])) { |
| 2083 | snprintf(out, out_size, MSG_ARG_INVALID, "cir"); |
| 2084 | return; |
| 2085 | } |
| 2086 | |
| 2087 | if (strcmp(tokens[8], "pir")) { |
| 2088 | snprintf(out, out_size, MSG_ARG_NOT_FOUND, "pir"); |
| 2089 | return; |
| 2090 | } |
| 2091 | |
| 2092 | if (parser_read_uint64(¶ms.pir, tokens[9])) { |
| 2093 | snprintf(out, out_size, MSG_ARG_INVALID, "pir"); |
| 2094 | return; |
no test coverage detected