From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id E36CCA0A0E; Wed, 28 Apr 2021 10:36:59 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A98AA4014E; Wed, 28 Apr 2021 10:36:59 +0200 (CEST) Received: from szxga06-in.huawei.com (szxga06-in.huawei.com [45.249.212.32]) by mails.dpdk.org (Postfix) with ESMTP id 3480E40147 for ; Wed, 28 Apr 2021 10:36:57 +0200 (CEST) Received: from DGGEMS413-HUB.china.huawei.com (unknown [172.30.72.60]) by szxga06-in.huawei.com (SkyGuard) with ESMTP id 4FVX4Y5wZYzlYM5 for ; Wed, 28 Apr 2021 16:34:53 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) by DGGEMS413-HUB.china.huawei.com (10.3.19.213) with Microsoft SMTP Server id 14.3.498.0; Wed, 28 Apr 2021 16:36:50 +0800 From: "Min Hu (Connor)" To: CC: , Date: Wed, 28 Apr 2021 16:36:59 +0800 Message-ID: <1619599019-46246-3-git-send-email-humin29@huawei.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1619599019-46246-1-git-send-email-humin29@huawei.com> References: <1618813303-32945-1-git-send-email-humin29@huawei.com> <1619599019-46246-1-git-send-email-humin29@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.69.192.56] X-CFilter-Loop: Reflected Subject: [dpdk-dev] [PATCH v2 2/2] app/testpmd: fix link speed for a specified port X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Huisong Li When we use the following cmd to modify the link speed of specified port: "port config 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 Signed-off-by: Min Hu (Connor) --- app/test-pmd/cmdline.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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) -- 2.7.4