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 A65E5A0579; Tue, 20 Apr 2021 11:01:48 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 748EA41688; Tue, 20 Apr 2021 11:01:12 +0200 (CEST) Received: from szxga06-in.huawei.com (szxga06-in.huawei.com [45.249.212.32]) by mails.dpdk.org (Postfix) with ESMTP id D9C1041654 for ; Tue, 20 Apr 2021 11:01:03 +0200 (CEST) Received: from DGGEMS402-HUB.china.huawei.com (unknown [172.30.72.58]) by szxga06-in.huawei.com (SkyGuard) with ESMTP id 4FPd096p0FzjZtP; Tue, 20 Apr 2021 16:59:05 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) by DGGEMS402-HUB.china.huawei.com (10.3.19.202) with Microsoft SMTP Server id 14.3.498.0; Tue, 20 Apr 2021 17:00:54 +0800 From: Huisong Li To: CC: , , , Date: Tue, 20 Apr 2021 17:01:04 +0800 Message-ID: <1618909266-17584-6-git-send-email-lihuisong@huawei.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1618909266-17584-1-git-send-email-lihuisong@huawei.com> References: <1614939741-63927-1-git-send-email-oulijun@huawei.com> <1618909266-17584-1-git-send-email-lihuisong@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 V3 5/7] app/testpmd: move position of verifying DCB test 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" Currently, the check for doing DCB test is assigned to start_packet_forwarding(), which will be called when run "start" cmd. But fwd_config_setup() is used in many scenarios, such as, "port config all rxq". This patch moves the check from start_packet_forwarding() to fwd_config_setup(). Fixes: 7741e4cf16c0 ("app/testpmd: VMDq and DCB updates") Signed-off-by: Huisong Li Signed-off-by: Lijun Ou --- app/test-pmd/config.c | 23 +++++++++++++++++++++-- app/test-pmd/testpmd.c | 19 ------------------- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index 18b197b..66974f8 100644 --- a/app/test-pmd/config.c +++ b/app/test-pmd/config.c @@ -3152,6 +3152,10 @@ icmp_echo_config_setup(void) void fwd_config_setup(void) { + struct rte_port *port; + portid_t pt_id; + unsigned int i; + cur_fwd_config.fwd_eng = cur_fwd_eng; if (strcmp(cur_fwd_eng->fwd_mode_name, "icmpecho") == 0) { icmp_echo_config_setup(); @@ -3159,9 +3163,24 @@ fwd_config_setup(void) } if ((nb_rxq > 1) && (nb_txq > 1)){ - if (dcb_config) + if (dcb_config) { + for (i = 0; i < nb_fwd_ports; i++) { + pt_id = fwd_ports_ids[i]; + port = &ports[pt_id]; + if (!port->dcb_flag) { + printf("In DCB mode, all forwarding ports must " + "be configured in this mode.\n"); + return; + } + } + if (nb_fwd_lcores == 1) { + printf("In DCB mode,the nb forwarding cores " + "should be larger than 1.\n"); + return; + } + dcb_fwd_config_setup(); - else + } else rss_fwd_config_setup(); } else diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index a076b1d..abcbdaa 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -2138,9 +2138,7 @@ start_packet_forwarding(int with_tx_first) { port_fwd_begin_t port_fwd_begin; port_fwd_end_t port_fwd_end; - struct rte_port *port; unsigned int i; - portid_t pt_id; if (strcmp(cur_fwd_eng->fwd_mode_name, "rxonly") == 0 && !nb_rxq) rte_exit(EXIT_FAILURE, "rxq are 0, cannot use rxonly fwd mode\n"); @@ -2163,23 +2161,6 @@ start_packet_forwarding(int with_tx_first) printf("Packet forwarding already started\n"); return; } - - if (dcb_config) { - for (i = 0; i < nb_fwd_ports; i++) { - pt_id = fwd_ports_ids[i]; - port = &ports[pt_id]; - if (!port->dcb_flag) { - printf("In DCB mode, all forwarding ports must " - "be configured in this mode.\n"); - return; - } - } - if (nb_fwd_lcores == 1) { - printf("In DCB mode,the nb forwarding cores " - "should be larger than 1.\n"); - return; - } - } test_done = 0; fwd_config_setup(); -- 2.7.4