DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Nicolás Pernas Maradei" <nico@emutex.com>
To: dev@dpdk.org
Subject: [dpdk-dev] [PATCH] testpmd: print message if starting/stopping queue is not supported
Date: Sat,  4 Oct 2014 20:19:51 +0100	[thread overview]
Message-ID: <1412450391-32377-1-git-send-email-nico@emutex.com> (raw)

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 <nico@emutex.com>
---
 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 = 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 =
-- 
1.9.1

             reply	other threads:[~2014-10-04 19:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-04 19:19 Nicolás Pernas Maradei [this message]
2014-10-09 19:15 ` Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1412450391-32377-1-git-send-email-nico@emutex.com \
    --to=nico@emutex.com \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).