| 2466 | }; |
| 2467 | |
| 2468 | static void |
| 2469 | cmd_config_rxtx_queue_parsed(void *parsed_result, |
| 2470 | __rte_unused struct cmdline *cl, |
| 2471 | __rte_unused void *data) |
| 2472 | { |
| 2473 | struct cmd_config_rxtx_queue *res = parsed_result; |
| 2474 | struct rte_port *port; |
| 2475 | uint8_t isrx; |
| 2476 | uint8_t isstart; |
| 2477 | uint8_t *state; |
| 2478 | int ret = 0; |
| 2479 | |
| 2480 | if (test_done == 0) { |
| 2481 | fprintf(stderr, "Please stop forwarding first\n"); |
| 2482 | return; |
| 2483 | } |
| 2484 | |
| 2485 | if (port_id_is_invalid(res->portid, ENABLED_WARN)) |
| 2486 | return; |
| 2487 | |
| 2488 | if (port_is_started(res->portid) != 1) { |
| 2489 | fprintf(stderr, "Please start port %u first\n", res->portid); |
| 2490 | return; |
| 2491 | } |
| 2492 | |
| 2493 | if (!strcmp(res->rxtxq, "rxq")) |
| 2494 | isrx = 1; |
| 2495 | else if (!strcmp(res->rxtxq, "txq")) |
| 2496 | isrx = 0; |
| 2497 | else { |
| 2498 | fprintf(stderr, "Unknown parameter\n"); |
| 2499 | return; |
| 2500 | } |
| 2501 | |
| 2502 | if (isrx && rx_queue_id_is_invalid(res->qid)) |
| 2503 | return; |
| 2504 | else if (!isrx && tx_queue_id_is_invalid(res->qid)) |
| 2505 | return; |
| 2506 | |
| 2507 | if (!strcmp(res->opname, "start")) |
| 2508 | isstart = 1; |
| 2509 | else if (!strcmp(res->opname, "stop")) |
| 2510 | isstart = 0; |
| 2511 | else { |
| 2512 | fprintf(stderr, "Unknown parameter\n"); |
| 2513 | return; |
| 2514 | } |
| 2515 | |
| 2516 | if (isstart && isrx) |
| 2517 | ret = rte_eth_dev_rx_queue_start(res->portid, res->qid); |
| 2518 | else if (!isstart && isrx) |
| 2519 | ret = rte_eth_dev_rx_queue_stop(res->portid, res->qid); |
| 2520 | else if (isstart && !isrx) |
| 2521 | ret = rte_eth_dev_tx_queue_start(res->portid, res->qid); |
| 2522 | else |
| 2523 | ret = rte_eth_dev_tx_queue_stop(res->portid, res->qid); |
| 2524 | |
| 2525 | if (ret == -ENOTSUP) { |
nothing calls this directly
no test coverage detected