| 2229 | "Pkts dropped by other: %" PRIu64 "\n" |
| 2230 | |
| 2231 | static void |
| 2232 | cmd_pipeline_port_in_stats(char **tokens, |
| 2233 | uint32_t n_tokens, |
| 2234 | char *out, |
| 2235 | size_t out_size) |
| 2236 | { |
| 2237 | struct rte_pipeline_port_in_stats stats; |
| 2238 | char *pipeline_name; |
| 2239 | uint32_t port_id; |
| 2240 | int clear, status; |
| 2241 | |
| 2242 | if ((n_tokens != 7) && (n_tokens != 8)) { |
| 2243 | snprintf(out, out_size, MSG_ARG_MISMATCH, tokens[0]); |
| 2244 | return; |
| 2245 | } |
| 2246 | |
| 2247 | pipeline_name = tokens[1]; |
| 2248 | |
| 2249 | if (strcmp(tokens[2], "port") != 0) { |
| 2250 | snprintf(out, out_size, MSG_ARG_NOT_FOUND, "port"); |
| 2251 | return; |
| 2252 | } |
| 2253 | |
| 2254 | if (strcmp(tokens[3], "in") != 0) { |
| 2255 | snprintf(out, out_size, MSG_ARG_NOT_FOUND, "in"); |
| 2256 | return; |
| 2257 | } |
| 2258 | |
| 2259 | if (parser_read_uint32(&port_id, tokens[4]) != 0) { |
| 2260 | snprintf(out, out_size, MSG_ARG_INVALID, "port_id"); |
| 2261 | return; |
| 2262 | } |
| 2263 | |
| 2264 | if (strcmp(tokens[5], "stats") != 0) { |
| 2265 | snprintf(out, out_size, MSG_ARG_NOT_FOUND, "stats"); |
| 2266 | return; |
| 2267 | } |
| 2268 | |
| 2269 | if (strcmp(tokens[6], "read") != 0) { |
| 2270 | snprintf(out, out_size, MSG_ARG_NOT_FOUND, "read"); |
| 2271 | return; |
| 2272 | } |
| 2273 | |
| 2274 | clear = 0; |
| 2275 | if (n_tokens == 8) { |
| 2276 | if (strcmp(tokens[7], "clear") != 0) { |
| 2277 | snprintf(out, out_size, MSG_ARG_INVALID, "clear"); |
| 2278 | return; |
| 2279 | } |
| 2280 | |
| 2281 | clear = 1; |
| 2282 | } |
| 2283 | |
| 2284 | status = pipeline_port_in_stats_read(pipeline_name, |
| 2285 | port_id, |
| 2286 | &stats, |
| 2287 | clear); |
| 2288 | if (status) { |
no test coverage detected