From patchwork Tue Apr 20 07:32:00 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "lihuisong (C)" X-Patchwork-Id: 91818 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 825B4A0547; Tue, 20 Apr 2021 09:32:18 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7F8F0415DB; Tue, 20 Apr 2021 09:32:14 +0200 (CEST) Received: from szxga05-in.huawei.com (szxga05-in.huawei.com [45.249.212.191]) by mails.dpdk.org (Postfix) with ESMTP id 2821A4140E for ; Tue, 20 Apr 2021 09:32:12 +0200 (CEST) Received: from DGGEMS413-HUB.china.huawei.com (unknown [172.30.72.59]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4FPb160nDgzrfj5; Tue, 20 Apr 2021 15:29:46 +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; Tue, 20 Apr 2021 15:31:58 +0800 From: Huisong Li To: CC: , , , Date: Tue, 20 Apr 2021 15:32:00 +0800 Message-ID: <1618903926-29099-2-git-send-email-lihuisong@huawei.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1618903926-29099-1-git-send-email-lihuisong@huawei.com> References: <1614939741-63927-1-git-send-email-oulijun@huawei.com> <1618903926-29099-1-git-send-email-lihuisong@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.69.192.56] X-CFilter-Loop: Reflected Subject: [dpdk-dev] [PATCH V2 1/7] app/testpmd: fix forward lcores number when 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, 'nb_fwd_lcores' value are both adjusted based on 'nb_fwd_streams' in rss/simple/icmp_echo_fwd_config_setup. But the operation is missing in dcb_fwd_config_setup, which may lead to a bad behavior in which multiple polling threads operate on the same queue. In this case, the device sends and receives packets, causing unexpected results. The procedure is as follows: 1/ run testpmd with "--rxq=8 --txq=8" 2/ port stop all 3/ set nbcore 8 4/ port config 0 dcb vt off 4 pfc on 5/ port config all rxq 16 6/ port config all txq 16 7/ port start all 8/ set fwd mac 9/ start For the DCB forwarding test, each core is assigned to each traffic class and each core is assigned a multi-stream. Therefore, 'nb_fwd_lcores' value needs to be adjusted based on 'total_tc_num' in all forwarding ports. Fixes: 900550de04a7 ("app/testpmd: add dcb support") Fixes: ce8d561418d4 ("app/testpmd: add port configuration settings") Cc: stable@dpdk.org Signed-off-by: Huisong Li Signed-off-by: Lijun Ou --- app/test-pmd/config.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index ccb9bd3..03ee40c 100644 --- a/app/test-pmd/config.c +++ b/app/test-pmd/config.c @@ -2961,6 +2961,21 @@ rss_fwd_config_setup(void) } } +static uint16_t +get_fwd_port_total_tc_num(void) +{ + struct rte_eth_dcb_info dcb_info; + uint16_t total_tc_num = 0; + unsigned int i; + + for (i = 0; i < nb_fwd_ports; i++) { + (void)rte_eth_dev_get_dcb_info(fwd_ports_ids[i], &dcb_info); + total_tc_num += dcb_info.nb_tcs; + } + + return total_tc_num; +} + /** * For the DCB forwarding test, each core is assigned on each traffic class. * @@ -2980,12 +2995,16 @@ dcb_fwd_config_setup(void) lcoreid_t lc_id; uint16_t nb_rx_queue, nb_tx_queue; uint16_t i, j, k, sm_id = 0; + uint16_t total_tc_num; uint8_t tc = 0; cur_fwd_config.nb_fwd_lcores = (lcoreid_t) nb_fwd_lcores; cur_fwd_config.nb_fwd_ports = nb_fwd_ports; cur_fwd_config.nb_fwd_streams = (streamid_t) (nb_rxq * cur_fwd_config.nb_fwd_ports); + total_tc_num = get_fwd_port_total_tc_num(); + if (cur_fwd_config.nb_fwd_lcores > total_tc_num) + cur_fwd_config.nb_fwd_lcores = total_tc_num; /* reinitialize forwarding streams */ init_fwd_streams(); From patchwork Tue Apr 20 07:32:01 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "lihuisong (C)" X-Patchwork-Id: 91821 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 58B54A0547; Tue, 20 Apr 2021 09:32:35 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 83E6D415F0; Tue, 20 Apr 2021 09:32:18 +0200 (CEST) Received: from szxga05-in.huawei.com (szxga05-in.huawei.com [45.249.212.191]) by mails.dpdk.org (Postfix) with ESMTP id 8794E4140E for ; Tue, 20 Apr 2021 09:32:12 +0200 (CEST) Received: from DGGEMS413-HUB.china.huawei.com (unknown [172.30.72.59]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4FPb161HQ3zrfkT; Tue, 20 Apr 2021 15:29:46 +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; Tue, 20 Apr 2021 15:31:58 +0800 From: Huisong Li To: CC: , , , Date: Tue, 20 Apr 2021 15:32:01 +0800 Message-ID: <1618903926-29099-3-git-send-email-lihuisong@huawei.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1618903926-29099-1-git-send-email-lihuisong@huawei.com> References: <1614939741-63927-1-git-send-email-oulijun@huawei.com> <1618903926-29099-1-git-send-email-lihuisong@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.69.192.56] X-CFilter-Loop: Reflected Subject: [dpdk-dev] [PATCH V2 2/7] app/testpmd: fix DCB forwarding configuration 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" After DCB mode is configured, the operations of port stop and port start change the value of the global variable "dcb_test", As a result, the forwarding configuration from DCB to RSS mode, namely, “dcb_fwd_config_setup()” to "rss_fwd_config_setup()". Currently, the 'dcb_flag' field in struct 'rte_port' indicates whether the port is configured with DCB. And it is sufficient to have 'dcb_config' as a global variable to control the DCB test status. So this patch deletes the "dcb_test". In addition, the 'dcb_config' is first set to 1 first in init_port_dcb_config(), but the function may fail. So it should be moved to the end. Fixes: 900550de04a7 ("app/testpmd: add dcb support") Fixes: ce8d561418d4 ("app/testpmd: add port configuration settings") Fixes: 7741e4cf16c0 ("app/testpmd: VMDq and DCB updates") Cc: stable@dpdk.org Signed-off-by: Huisong Li Signed-off-by: Lijun Ou --- app/test-pmd/testpmd.c | 18 ++++-------------- app/test-pmd/testpmd.h | 1 - 2 files changed, 4 insertions(+), 15 deletions(-) diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index d4be23f..a076b1d 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -246,9 +246,6 @@ uint16_t mb_mempool_cache = DEF_MBUF_CACHE; /**< Size of mbuf mempool cache. */ /* current configuration is in DCB or not,0 means it is not in DCB mode */ uint8_t dcb_config = 0; -/* Whether the dcb is in testing status */ -uint8_t dcb_test = 0; - /* * Configurable number of RX/TX queues. */ @@ -2167,8 +2164,7 @@ start_packet_forwarding(int with_tx_first) return; } - - if(dcb_test) { + if (dcb_config) { for (i = 0; i < nb_fwd_ports; i++) { pt_id = fwd_ports_ids[i]; port = &ports[pt_id]; @@ -2476,8 +2472,6 @@ start_port(portid_t pid) if (port_id_is_invalid(pid, ENABLED_WARN)) return 0; - if(dcb_config) - dcb_test = 1; RTE_ETH_FOREACH_DEV(pi) { if (pid != pi && pid != (portid_t)RTE_PORT_ALL) continue; @@ -2717,11 +2711,6 @@ stop_port(portid_t pid) portid_t peer_pl[RTE_MAX_ETHPORTS]; int peer_pi; - if (dcb_test) { - dcb_test = 0; - dcb_config = 0; - } - if (port_id_is_invalid(pid, ENABLED_WARN)) return; @@ -3625,8 +3614,6 @@ init_port_dcb_config(portid_t pid, rte_port = &ports[pid]; memset(&port_conf, 0, sizeof(struct rte_eth_conf)); - /* Enter DCB configuration status */ - dcb_config = 1; port_conf.rxmode = rte_port->dev_conf.rxmode; port_conf.txmode = rte_port->dev_conf.txmode; @@ -3694,6 +3681,9 @@ init_port_dcb_config(portid_t pid, rte_port->dcb_flag = 1; + /* Enter DCB configuration status */ + dcb_config = 1; + return 0; } diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h index 9530ec5..432c66d 100644 --- a/app/test-pmd/testpmd.h +++ b/app/test-pmd/testpmd.h @@ -425,7 +425,6 @@ extern uint64_t noisy_lkup_num_reads; extern uint64_t noisy_lkup_num_reads_writes; extern uint8_t dcb_config; -extern uint8_t dcb_test; extern uint32_t mbuf_data_size_n; extern uint16_t mbuf_data_size[MAX_SEGS_BUFFER_SPLIT]; From patchwork Tue Apr 20 07:32:02 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "lihuisong (C)" X-Patchwork-Id: 91817 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 6F344A0547; Tue, 20 Apr 2021 09:32:13 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 51B28415D7; Tue, 20 Apr 2021 09:32:13 +0200 (CEST) Received: from szxga05-in.huawei.com (szxga05-in.huawei.com [45.249.212.191]) by mails.dpdk.org (Postfix) with ESMTP id 2B9BD415BE for ; Tue, 20 Apr 2021 09:32:12 +0200 (CEST) Received: from DGGEMS413-HUB.china.huawei.com (unknown [172.30.72.59]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4FPb161z17zrfkf; Tue, 20 Apr 2021 15:29:46 +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; Tue, 20 Apr 2021 15:31:59 +0800 From: Huisong Li To: CC: , , , Date: Tue, 20 Apr 2021 15:32:02 +0800 Message-ID: <1618903926-29099-4-git-send-email-lihuisong@huawei.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1618903926-29099-1-git-send-email-lihuisong@huawei.com> References: <1614939741-63927-1-git-send-email-oulijun@huawei.com> <1618903926-29099-1-git-send-email-lihuisong@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.69.192.56] X-CFilter-Loop: Reflected Subject: [dpdk-dev] [PATCH V2 3/7] app/testpmd: fix a segment fault when 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" After DCB mode is configured, if we decrease the number of RX and TX queues, fwd_config_setup() will be called to setup the DCB forwarding configuration. And forwarding streams are updated based on new queue numbers in fwd_config_setup(), but the mapping between the TC and queues obtained by rte_eth_dev_get_dcb_info() is still old queue numbers (old queue numbers are greater than new queue numbers). In this case, the segment fault happens. So rte_eth_dev_configure() should be called again to update the mapping between the TC and queues before rte_eth_dev_get_dcb_info(). Like: set nbcore 4 port stop all port config 0 dcb vt off 4 pfc on port start all port stop all port config all rxq 8 port config all txq 8 Fixes: 900550de04a7 ("app/testpmd: add dcb support") Cc: stable@dpdk.org Signed-off-by: Huisong Li Signed-off-by: Lijun Ou --- app/test-pmd/config.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index 03ee40c..18b197b 100644 --- a/app/test-pmd/config.c +++ b/app/test-pmd/config.c @@ -2996,7 +2996,33 @@ dcb_fwd_config_setup(void) uint16_t nb_rx_queue, nb_tx_queue; uint16_t i, j, k, sm_id = 0; uint16_t total_tc_num; + struct rte_port *port; uint8_t tc = 0; + portid_t pid; + int ret; + + /* + * The fwd_config_setup() is called when the port is RTE_PORT_STARTED + * RTE_PORT_STOPPED. When a port is RTE_PORT_STARTED, dev_configure + * cannot be called. + * + * re-configure the device after changing queue numbers of stopped + * ports, so that the updated mapping between tc and queue can be + * obtained. + */ + for (pid = 0; pid < nb_fwd_ports; pid++) { + if (port_is_started(pid) == 1) + continue; + + port = &ports[pid]; + ret = rte_eth_dev_configure(pid, nb_rxq, nb_txq, + &port->dev_conf); + if (ret < 0) { + printf("Failed to re-configure port %d, ret = %d.\n", + pid, ret); + return; + } + } cur_fwd_config.nb_fwd_lcores = (lcoreid_t) nb_fwd_lcores; cur_fwd_config.nb_fwd_ports = nb_fwd_ports; From patchwork Tue Apr 20 07:32:03 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "lihuisong (C)" X-Patchwork-Id: 91823 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id E2B94A0547; Tue, 20 Apr 2021 09:32:46 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DC08B415FC; Tue, 20 Apr 2021 09:32:20 +0200 (CEST) Received: from szxga05-in.huawei.com (szxga05-in.huawei.com [45.249.212.191]) by mails.dpdk.org (Postfix) with ESMTP id 35F0F415BE for ; Tue, 20 Apr 2021 09:32:13 +0200 (CEST) Received: from DGGEMS413-HUB.china.huawei.com (unknown [172.30.72.59]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4FPb161SCyzrfkX; Tue, 20 Apr 2021 15:29:46 +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; Tue, 20 Apr 2021 15:31:59 +0800 From: Huisong Li To: CC: , , , Date: Tue, 20 Apr 2021 15:32:03 +0800 Message-ID: <1618903926-29099-5-git-send-email-lihuisong@huawei.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1618903926-29099-1-git-send-email-lihuisong@huawei.com> References: <1614939741-63927-1-git-send-email-oulijun@huawei.com> <1618903926-29099-1-git-send-email-lihuisong@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.69.192.56] X-CFilter-Loop: Reflected Subject: [dpdk-dev] [PATCH V2 4/7] app/testpmd: add check for support of reporting DCB info 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, '.get_dcb_info' must be supported for the port doing DCB test, or all information in 'rte_eth_dcb_info' are zero. It should be prevented when user run cmd "port config 0 dcb vt off 4 pfc off". This patch adds the check for support of reporting dcb info. Signed-off-by: Huisong Li Signed-off-by: Lijun Ou --- app/test-pmd/cmdline.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index d282c7c..6f4f642 100644 --- a/app/test-pmd/cmdline.c +++ b/app/test-pmd/cmdline.c @@ -3170,6 +3170,7 @@ cmd_config_dcb_parsed(void *parsed_result, __rte_unused void *data) { struct cmd_config_dcb *res = parsed_result; + struct rte_eth_dcb_info dcb_info; portid_t port_id = res->port_id; struct rte_port *port; uint8_t pfc_en; @@ -3192,6 +3193,14 @@ cmd_config_dcb_parsed(void *parsed_result, printf("nb_cores shouldn't be less than number of TCs.\n"); return; } + + /* Check whether the port supports the report of DCB info. */ + ret = rte_eth_dev_get_dcb_info(port_id, &dcb_info); + if (ret == -ENOTSUP) { + printf("Network port must support rte_eth_dev_get_dcb_info API, or cann't does dcb test.\n"); + return; + } + if (!strncmp(res->pfc_en, "on", 2)) pfc_en = 1; else From patchwork Tue Apr 20 07:32:04 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "lihuisong (C)" X-Patchwork-Id: 91822 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 21EC3A0547; Tue, 20 Apr 2021 09:32:41 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A4FA0415F6; Tue, 20 Apr 2021 09:32:19 +0200 (CEST) Received: from szxga05-in.huawei.com (szxga05-in.huawei.com [45.249.212.191]) by mails.dpdk.org (Postfix) with ESMTP id 311CE4140E for ; Tue, 20 Apr 2021 09:32:13 +0200 (CEST) Received: from DGGEMS413-HUB.china.huawei.com (unknown [172.30.72.59]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4FPb161cnpzrfkZ; Tue, 20 Apr 2021 15:29:46 +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; Tue, 20 Apr 2021 15:31:59 +0800 From: Huisong Li To: CC: , , , Date: Tue, 20 Apr 2021 15:32:04 +0800 Message-ID: <1618903926-29099-6-git-send-email-lihuisong@huawei.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1618903926-29099-1-git-send-email-lihuisong@huawei.com> References: <1614939741-63927-1-git-send-email-oulijun@huawei.com> <1618903926-29099-1-git-send-email-lihuisong@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.69.192.56] X-CFilter-Loop: Reflected Subject: [dpdk-dev] [PATCH V2 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(); From patchwork Tue Apr 20 07:32:05 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "lihuisong (C)" X-Patchwork-Id: 91824 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 441EBA0547; Tue, 20 Apr 2021 09:32:52 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2E47441601; Tue, 20 Apr 2021 09:32:22 +0200 (CEST) Received: from szxga05-in.huawei.com (szxga05-in.huawei.com [45.249.212.191]) by mails.dpdk.org (Postfix) with ESMTP id 4898F415D1 for ; Tue, 20 Apr 2021 09:32:13 +0200 (CEST) Received: from DGGEMS413-HUB.china.huawei.com (unknown [172.30.72.59]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4FPb1616kZzrfkL; Tue, 20 Apr 2021 15:29:46 +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; Tue, 20 Apr 2021 15:32:00 +0800 From: Huisong Li To: CC: , , , Date: Tue, 20 Apr 2021 15:32:05 +0800 Message-ID: <1618903926-29099-7-git-send-email-lihuisong@huawei.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1618903926-29099-1-git-send-email-lihuisong@huawei.com> References: <1614939741-63927-1-git-send-email-oulijun@huawei.com> <1618903926-29099-1-git-send-email-lihuisong@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.69.192.56] X-CFilter-Loop: Reflected Subject: [dpdk-dev] [PATCH V2 6/7] app/testpmd: add forwarding config in start 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" Most operations in testpmd that need to update the forwarding streams in testpmd call fwd_config_setup(). In some scenarios, eg, dev_configure is called again, the forwarding streams may not be updated. As a result, the actual forwarding streams cannot be queried by "show config fwd" cmd. The procedure is as follows: set nbcore 4 port stop all port config 0 dcb vt off 4 pfc on port start all show config fwd Signed-off-by: Huisong Li Signed-off-by: Lijun Ou --- app/test-pmd/testpmd.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index abcbdaa..f8052b6 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -2678,6 +2678,12 @@ start_port(portid_t pid) } } } + /* + * In some scenarios, eg, dev_configure is called again, the forwarding + * streams may not be updated. As a result, the actual forwarding + * streams cannot be queried by "show config fwd" command. + */ + fwd_config_setup(); printf("Done\n"); return 0; From patchwork Tue Apr 20 07:32:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "lihuisong (C)" X-Patchwork-Id: 91820 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id BA6A8A0547; Tue, 20 Apr 2021 09:32:29 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 58E7D415E9; Tue, 20 Apr 2021 09:32:17 +0200 (CEST) Received: from szxga05-in.huawei.com (szxga05-in.huawei.com [45.249.212.191]) by mails.dpdk.org (Postfix) with ESMTP id 472F8415D4 for ; Tue, 20 Apr 2021 09:32:12 +0200 (CEST) Received: from DGGEMS413-HUB.china.huawei.com (unknown [172.30.72.59]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4FPb160ydFzrfkJ; Tue, 20 Apr 2021 15:29:46 +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; Tue, 20 Apr 2021 15:32:00 +0800 From: Huisong Li To: CC: , , , Date: Tue, 20 Apr 2021 15:32:06 +0800 Message-ID: <1618903926-29099-8-git-send-email-lihuisong@huawei.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1618903926-29099-1-git-send-email-lihuisong@huawei.com> References: <1614939741-63927-1-git-send-email-oulijun@huawei.com> <1618903926-29099-1-git-send-email-lihuisong@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.69.192.56] X-CFilter-Loop: Reflected Subject: [dpdk-dev] [PATCH V2 7/7] app/testpmd: remove redundant fwd streams initialization 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" The fwd_config_setup() is called after init_fwd_streams(). The fwd_config_setup() will reinitialize forwarding streams. This patch removes init_fwd_streams() from init_config(). Signed-off-by: Huisong Li Signed-off-by: Lijun Ou --- app/test-pmd/testpmd.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index f8052b6..79b5d97 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -1576,10 +1576,6 @@ init_config(void) fwd_lcores[lc_id]->gso_ctx.flag = 0; } - /* Configuration of packet forwarding streams. */ - if (init_fwd_streams() < 0) - rte_exit(EXIT_FAILURE, "FAIL from init_fwd_streams()\n"); - fwd_config_setup(); /* create a gro context for each lcore */