diff mbox series

[2/2] app/testpmd: fix link speed for a specified port

Message ID 1618813303-32945-3-git-send-email-humin29@huawei.com (mailing list archive)
State Superseded
Delegated to: Ferruh Yigit
Headers show
Series fixes for link speed | expand

Checks

Context Check Description
ci/iol-abi-testing success Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/github-robot success github build: passed
ci/travis-robot success travis build: passed
ci/intel-Testing success Testing PASS
ci/Intel-compilation success Compilation OK
ci/checkpatch success coding style OK

Commit Message

Min Hu (Connor) April 19, 2021, 6:21 a.m. UTC
From: Huisong Li <lihuisong@huawei.com>

When we use the following cmd to modify the link speed of specified
port: "port config <port_id> speed xxx duplex xxx", we have to stop
all ports. It's not necessary.

Fixes: 82113036e4e5 ("ethdev: redesign link speed config")
Cc: stable@dpdk.org

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
---
 app/test-pmd/cmdline.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Comments

Ferruh Yigit April 19, 2021, 10:52 p.m. UTC | #1
On 4/19/2021 7:21 AM, Min Hu (Connor) wrote:
> From: Huisong Li <lihuisong@huawei.com>
> 
> When we use the following cmd to modify the link speed of specified
> port: "port config <port_id> speed xxx duplex xxx", we have to stop
> all ports. It's not necessary.
> 
> Fixes: 82113036e4e5 ("ethdev: redesign link speed config")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Huisong Li <lihuisong@huawei.com>
> Signed-off-by: Min Hu (Connor) <humin29@huawei.com>

Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
diff mbox series

Patch

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index 09e30cf..31884c5 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -1637,13 +1637,13 @@  cmd_config_speed_specific_parsed(void *parsed_result,
 	uint32_t link_speed;
 	int ret;
 
-	if (!all_ports_stopped()) {
-		printf("Please stop all ports first\n");
+	if (port_id_is_invalid(res->id, ENABLED_WARN))
 		return;
-	}
 
-	if (port_id_is_invalid(res->id, ENABLED_WARN))
+	if (!port_is_stopped(res->id)) {
+		printf("Please stop port %d first\n", res->id);
 		return;
+	}
 
 	if (parse_and_check_speed_duplex(res->value1, res->value2,
 			&link_speed) < 0)