| 2431 | " | table <table_name> match <field0> ...\n"; |
| 2432 | |
| 2433 | static void |
| 2434 | cmd_pipeline_meter_stats(char **tokens, |
| 2435 | uint32_t n_tokens, |
| 2436 | char *out, |
| 2437 | size_t out_size, |
| 2438 | void *obj __rte_unused) |
| 2439 | { |
| 2440 | struct rte_swx_ctl_meter_stats stats; |
| 2441 | struct rte_swx_pipeline *p; |
| 2442 | struct rte_swx_ctl_pipeline *ctl; |
| 2443 | const char *pipeline_name, *name; |
| 2444 | |
| 2445 | if (n_tokens < 6) { |
| 2446 | snprintf(out, out_size, MSG_ARG_MISMATCH, tokens[0]); |
| 2447 | return; |
| 2448 | } |
| 2449 | |
| 2450 | pipeline_name = tokens[1]; |
| 2451 | p = rte_swx_pipeline_find(pipeline_name); |
| 2452 | ctl = rte_swx_ctl_pipeline_find(pipeline_name); |
| 2453 | if (!p || !ctl) { |
| 2454 | snprintf(out, out_size, MSG_ARG_INVALID, "pipeline_name"); |
| 2455 | return; |
| 2456 | } |
| 2457 | |
| 2458 | if (strcmp(tokens[2], "meter")) { |
| 2459 | snprintf(out, out_size, MSG_ARG_NOT_FOUND, "meter"); |
| 2460 | return; |
| 2461 | } |
| 2462 | |
| 2463 | name = tokens[3]; |
| 2464 | |
| 2465 | if (strcmp(tokens[4], "stats")) { |
| 2466 | snprintf(out, out_size, MSG_ARG_NOT_FOUND, "stats"); |
| 2467 | return; |
| 2468 | } |
| 2469 | |
| 2470 | /* index. */ |
| 2471 | if (!strcmp(tokens[5], "index")) { |
| 2472 | uint32_t idx0 = 0, idx1 = 0; |
| 2473 | |
| 2474 | if (n_tokens != 10) { |
| 2475 | snprintf(out, out_size, MSG_ARG_MISMATCH, tokens[0]); |
| 2476 | return; |
| 2477 | } |
| 2478 | |
| 2479 | if (strcmp(tokens[6], "from")) { |
| 2480 | snprintf(out, out_size, MSG_ARG_NOT_FOUND, "from"); |
| 2481 | return; |
| 2482 | } |
| 2483 | |
| 2484 | if (parser_read_uint32(&idx0, tokens[7])) { |
| 2485 | snprintf(out, out_size, MSG_ARG_INVALID, "index0"); |
| 2486 | return; |
| 2487 | } |
| 2488 | |
| 2489 | if (strcmp(tokens[8], "to")) { |
| 2490 | snprintf(out, out_size, MSG_ARG_NOT_FOUND, "to"); |
no test coverage detected