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

Message ID 1619599019-46246-3-git-send-email-humin29@huawei.com (mailing list archive)
State Accepted, archived
Delegated to: Andrew Rybchenko
Headers
Series fixes for link speed |

Checks

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

Commit Message

humin (Q) April 28, 2021, 8:36 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

Li, Xiaoyun April 29, 2021, 8:42 a.m. UTC | #1
> -----Original Message-----
> From: Min Hu (Connor) <humin29@huawei.com>
> Sent: Wednesday, April 28, 2021 16:37
> To: dev@dpdk.org
> Cc: Yigit, Ferruh <ferruh.yigit@intel.com>; Li, Xiaoyun <xiaoyun.li@intel.com>
> Subject: [PATCH v2 2/2] app/testpmd: fix link speed for a specified port
> 
> 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(-)

Acked-by: Xiaoyun Li <xiaoyun.li@intel.com>
  
Andrew Rybchenko July 2, 2021, 10:02 a.m. UTC | #2
On 4/29/21 11:42 AM, Li, Xiaoyun wrote:
>> -----Original Message-----
>> From: Min Hu (Connor) <humin29@huawei.com>
>> Sent: Wednesday, April 28, 2021 16:37
>> To: dev@dpdk.org
>> Cc: Yigit, Ferruh <ferruh.yigit@intel.com>; Li, Xiaoyun <xiaoyun.li@intel.com>
>> Subject: [PATCH v2 2/2] app/testpmd: fix link speed for a specified port
>>
>> 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(-)
> 
> Acked-by: Xiaoyun Li <xiaoyun.li@intel.com>
> 

From v1:
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>

Applied the patch only, thanks.
  

Patch

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index ddbc629..6d80d98 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -1649,13 +1649,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)