DPDK patches and discussions
 help / color / mirror / Atom feed
From: Yong Liu <yong.liu@intel.com>
To: dev@dpdk.org
Subject: [dpdk-dev] [PATCH] app/testpmd: Fix not set need_reconfig flag when port id is RTE_PORT_ALL
Date: Fri, 13 Mar 2015 10:38:23 +0800	[thread overview]
Message-ID: <1426214303-12207-1-git-send-email-yong.liu@intel.com> (raw)

When port id is RTE_PORT_ALL, port_id_is_invalid will also return zero.
So this function will only set ports[255] need_reconfig flag, other ports will
be skipped.

Signed-off-by: Marvin liu <yong.liu@intel.com>

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index 5b16a69..077d7a4 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -8874,14 +8874,7 @@ prompt(void)
 static void
 cmd_reconfig_device_queue(portid_t id, uint8_t dev, uint8_t queue)
 {
-	if (!port_id_is_invalid(id, DISABLED_WARN)) {
-		/* check if need_reconfig has been set to 1 */
-		if (ports[id].need_reconfig == 0)
-			ports[id].need_reconfig = dev;
-		/* check if need_reconfig_queues has been set to 1 */
-		if (ports[id].need_reconfig_queues == 0)
-			ports[id].need_reconfig_queues = queue;
-	} else {
+	if (id == (portid_t)RTE_PORT_ALL) {
 		portid_t pid;
 
 		FOREACH_PORT(pid, ports) {
@@ -8892,6 +8885,13 @@ cmd_reconfig_device_queue(portid_t id, uint8_t dev, uint8_t queue)
 			if (ports[pid].need_reconfig_queues == 0)
 				ports[pid].need_reconfig_queues = queue;
 		}
+	} else if (!port_id_is_invalid(id, DISABLED_WARN)) {
+		/* check if need_reconfig has been set to 1 */
+		if (ports[id].need_reconfig == 0)
+			ports[id].need_reconfig = dev;
+		/* check if need_reconfig_queues has been set to 1 */
+		if (ports[id].need_reconfig_queues == 0)
+			ports[id].need_reconfig_queues = queue;
 	}
 }
 
-- 
1.9.3

             reply	other threads:[~2015-03-13  2:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-13  2:38 Yong Liu [this message]
2015-03-17  1:18 ` Ouyang, Changchun
2015-03-20 23:26   ` 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=1426214303-12207-1-git-send-email-yong.liu@intel.com \
    --to=yong.liu@intel.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).