From patchwork Tue Apr 20 09:01: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: 91839 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 35078A0579; Tue, 20 Apr 2021 11:01:41 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4D6584166D; Tue, 20 Apr 2021 11:01:11 +0200 (CEST) Received: from szxga06-in.huawei.com (szxga06-in.huawei.com [45.249.212.32]) by mails.dpdk.org (Postfix) with ESMTP id B784C411A5 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 4FPd095j0FzjZt3; 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:53 +0800 From: Huisong Li To: CC: , , , Date: Tue, 20 Apr 2021 17:01:00 +0800 Message-ID: <1618909266-17584-2-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 X-Originating-IP: [10.69.192.56] X-CFilter-Loop: Reflected Subject: [dpdk-dev] [PATCH V3 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 09:01: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: 91841 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 4A7DFA0579; Tue, 20 Apr 2021 11:01:55 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C65594168F; Tue, 20 Apr 2021 11:01:13 +0200 (CEST) Received: from szxga06-in.huawei.com (szxga06-in.huawei.com [45.249.212.32]) by mails.dpdk.org (Postfix) with ESMTP id B78DF4127B 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 4FPd095WW0zjZt1; 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:53 +0800 From: Huisong Li To: CC: , , , Date: Tue, 20 Apr 2021 17:01:01 +0800 Message-ID: <1618909266-17584-3-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 X-Originating-IP: [10.69.192.56] X-CFilter-Loop: Reflected Subject: [dpdk-dev] [PATCH V3 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 09:01: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: 91836 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 62C4EA0579; Tue, 20 Apr 2021 11:01:16 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3FF8B4166E; Tue, 20 Apr 2021 11:01:06 +0200 (CEST) Received: from szxga06-in.huawei.com (szxga06-in.huawei.com [45.249.212.32]) by mails.dpdk.org (Postfix) with ESMTP id B44EB41529 for ; Tue, 20 Apr 2021 11:01:02 +0200 (CEST) Received: from DGGEMS402-HUB.china.huawei.com (unknown [172.30.72.58]) by szxga06-in.huawei.com (SkyGuard) with ESMTP id 4FPd09639xzjZtC; 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:02 +0800 Message-ID: <1618909266-17584-4-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 X-Originating-IP: [10.69.192.56] X-CFilter-Loop: Reflected Subject: [dpdk-dev] [PATCH V3 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 09:01: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: 91838 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 6F381A0579; Tue, 20 Apr 2021 11:01:31 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id AFD764167A; Tue, 20 Apr 2021 11:01:08 +0200 (CEST) Received: from szxga06-in.huawei.com (szxga06-in.huawei.com [45.249.212.32]) by mails.dpdk.org (Postfix) with ESMTP id C188741654 for ; Tue, 20 Apr 2021 11:01:02 +0200 (CEST) Received: from DGGEMS402-HUB.china.huawei.com (unknown [172.30.72.58]) by szxga06-in.huawei.com (SkyGuard) with ESMTP id 4FPd096DgpzjZtD; 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:03 +0800 Message-ID: <1618909266-17584-5-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 X-Originating-IP: [10.69.192.56] X-CFilter-Loop: Reflected Subject: [dpdk-dev] [PATCH V3 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 Acked-by: Xiaoyun Li --- V2->V3 - fix the abnormal print information --- 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..6329730 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("The port must support rte_eth_dev_get_dcb_info API, or can't do dcb test.\n"); + return; + } + if (!strncmp(res->pfc_en, "on", 2)) pfc_en = 1; else From patchwork Tue Apr 20 09:01: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: 91840 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 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 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 Acked-by: Xiaoyun Li --- 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 09:01: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: 91835 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 1B8F1A0579; Tue, 20 Apr 2021 11:01:09 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 02B7C41660; Tue, 20 Apr 2021 11:01:05 +0200 (CEST) Received: from szxga06-in.huawei.com (szxga06-in.huawei.com [45.249.212.32]) by mails.dpdk.org (Postfix) with ESMTP id B6FA641638 for ; Tue, 20 Apr 2021 11:01:02 +0200 (CEST) Received: from DGGEMS402-HUB.china.huawei.com (unknown [172.30.72.58]) by szxga06-in.huawei.com (SkyGuard) with ESMTP id 4FPd096c6LzjZtF; 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:55 +0800 From: Huisong Li To: CC: , , , Date: Tue, 20 Apr 2021 17:01:05 +0800 Message-ID: <1618909266-17584-7-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 X-Originating-IP: [10.69.192.56] X-CFilter-Loop: Reflected Subject: [dpdk-dev] [PATCH V3 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 09:01: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: 91837 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 F28EEA0579; Tue, 20 Apr 2021 11:01:23 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 833C041674; Tue, 20 Apr 2021 11:01:07 +0200 (CEST) Received: from szxga06-in.huawei.com (szxga06-in.huawei.com [45.249.212.32]) by mails.dpdk.org (Postfix) with ESMTP id BC77941650 for ; Tue, 20 Apr 2021 11:01:02 +0200 (CEST) Received: from DGGEMS402-HUB.china.huawei.com (unknown [172.30.72.58]) by szxga06-in.huawei.com (SkyGuard) with ESMTP id 4FPd096QDYzjZsV; 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:55 +0800 From: Huisong Li To: CC: , , , Date: Tue, 20 Apr 2021 17:01:06 +0800 Message-ID: <1618909266-17584-8-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 X-Originating-IP: [10.69.192.56] X-CFilter-Loop: Reflected Subject: [dpdk-dev] [PATCH V3 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 Acked-by: Xiaoyun Li --- 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 */