From: Nicolás Pernas Maradei Date: Sat, 4 Oct 2014 19:19:51 +0000 (+0100) Subject: app/testpmd: print message if queue start/stop is not supported X-Git-Tag: spdx-start~10316 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=0069e277db09ca5309ded496756a998f88f75892;p=dpdk.git app/testpmd: print message if queue start/stop is not supported Print an error message to the user when trying to start/stop a rx/tx queue and this function is not supported by the PMD driver. The patch does not check if the return value is -EINVAL because testpmd is already validating the port and queue id. Signed-off-by: Nicolás Pernas Maradei Acked-by: Thomas Monjalon --- diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index 225f669fe3..0b972f9fe3 100644 --- a/app/test-pmd/cmdline.c +++ b/app/test-pmd/cmdline.c @@ -1451,6 +1451,7 @@ cmd_config_rxtx_queue_parsed(void *parsed_result, struct cmd_config_rxtx_queue *res = parsed_result; uint8_t isrx; uint8_t isstart; + int ret = 0; if (test_done == 0) { printf("Please stop forwarding first\n"); @@ -1489,13 +1490,16 @@ cmd_config_rxtx_queue_parsed(void *parsed_result, } if (isstart && isrx) - rte_eth_dev_rx_queue_start(res->portid, res->qid); + ret = rte_eth_dev_rx_queue_start(res->portid, res->qid); else if (!isstart && isrx) - rte_eth_dev_rx_queue_stop(res->portid, res->qid); + ret = rte_eth_dev_rx_queue_stop(res->portid, res->qid); else if (isstart && !isrx) - rte_eth_dev_tx_queue_start(res->portid, res->qid); + ret = rte_eth_dev_tx_queue_start(res->portid, res->qid); else - rte_eth_dev_tx_queue_stop(res->portid, res->qid); + ret = rte_eth_dev_tx_queue_stop(res->portid, res->qid); + + if (ret == -ENOTSUP) + printf("Function not supported in PMD driver\n"); } cmdline_parse_token_string_t cmd_config_rxtx_queue_port =