From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?UTF-8?q?Nicola=CC=81s=20Pernas=20Maradei?= Subject: [PATCH] testpmd: print message if starting/stopping queue is not supported Date: Sat, 4 Oct 2014 20:19:51 +0100 Message-ID: <1412450391-32377-1-git-send-email-nico@emutex.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable To: dev-VfR2kkLFssw@public.gmane.org Return-path: List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces-VfR2kkLFssw@public.gmane.org Sender: "dev" Print an error message to the user when trying to start/stop a rx/tx queu= e and this function is not supported by the PMD driver. The patch does not chec= k if the return value is -EINVAL because testpmd is already validating the por= t and queue id. Signed-off-by: Nicola=CC=81s Pernas Maradei --- app/test-pmd/cmdline.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index 225f669..0b972f9 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 =3D parsed_result; uint8_t isrx; uint8_t isstart; + int ret =3D 0; =20 if (test_done =3D=3D 0) { printf("Please stop forwarding first\n"); @@ -1489,13 +1490,16 @@ cmd_config_rxtx_queue_parsed(void *parsed_result, } =20 if (isstart && isrx) - rte_eth_dev_rx_queue_start(res->portid, res->qid); + ret =3D 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 =3D 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 =3D rte_eth_dev_tx_queue_start(res->portid, res->qid); else - rte_eth_dev_tx_queue_stop(res->portid, res->qid); + ret =3D rte_eth_dev_tx_queue_stop(res->portid, res->qid); + + if (ret =3D=3D -ENOTSUP) + printf("Function not supported in PMD driver\n"); } =20 cmdline_parse_token_string_t cmd_config_rxtx_queue_port =3D --=20 1.9.1