From: Yong Liu Date: Fri, 13 Mar 2015 02:38:23 +0000 (+0800) Subject: app/testpmd: fix reconfig flag for all ports X-Git-Tag: spdx-start~9399 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=6ae9bee6c6c17a2c685557181d50adf575b1d880;p=dpdk.git app/testpmd: fix reconfig flag for all ports 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. Fixes: edab33b1c01d ("app/testpmd: support port hotplug") Signed-off-by: Marvin Liu Acked-by: Changchun Ouyang --- diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index 604c3ec1c9..d3a28030f0 100644 --- a/app/test-pmd/cmdline.c +++ b/app/test-pmd/cmdline.c @@ -8885,14 +8885,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) { @@ -8903,6 +8896,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; } }