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 88FC345D51; Wed, 20 Nov 2024 10:38:11 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6D45840E36; Wed, 20 Nov 2024 10:38:11 +0100 (CET) Received: from mail.loongson.cn (mail.loongson.cn [114.242.206.163]) by mails.dpdk.org (Postfix) with ESMTP id 75FC2402B5 for ; Wed, 20 Nov 2024 10:38:09 +0100 (CET) Received: from loongson.cn (unknown [10.2.10.34]) by gateway (Coremail) with SMTP id _____8Cx767+rT1nZIlDAA--.28322S3; Wed, 20 Nov 2024 17:38:07 +0800 (CST) Received: from localhost.localdomain (unknown [10.2.10.34]) by front1 (Coremail) with SMTP id qMiowMAxlsDsrT1niv9eAA--.30509S2; Wed, 20 Nov 2024 17:38:06 +0800 (CST) From: Min Zhou To: stephen@networkplumber.org, ferruh.yigit@amd.com, aman.deep.singh@intel.com, dev@dpdk.org, zhoumin@loongson.cn Subject: [v2 1/1] app/testpmd: use RSS conf from software when configuring DCB Date: Wed, 20 Nov 2024 17:37:46 +0800 Message-Id: <20241120093746.12387-1-zhoumin@loongson.cn> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230412095239.1709477-1-zhoumin@loongson.cn> References: <20230412095239.1709477-1-zhoumin@loongson.cn> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: qMiowMAxlsDsrT1niv9eAA--.30509S2 X-CM-SenderInfo: 52kr3ztlq6z05rqj20fqof0/1tbiAQEHAWc9FL0NBgADs9 X-Coremail-Antispam: 1Uk129KBj93XoWxAr1xXFyfCw1UKFykuryrKrX_yoW5ur1UpF srGas8AFW8JF9xWan7Aayrur1kArs7Ja4UArZ3G34Yk3Wvkr1rur17Kr10vrW8G34DJFyr ZayfKF9rZF1DC3XCm3ZEXasCq-sJn29KB7ZKAUJUUUUr529EdanIXcx71UUUUU7KY7ZEXa sCq-sGcSsGvfJ3Ic02F40EFcxC0VAKzVAqx4xG6I80ebIjqfuFe4nvWSU5nxnvy29KBjDU 0xBIdaVrnRJUUU9Yb4IE77IF4wAFF20E14v26r1j6r4UM7CY07I20VC2zVCF04k26cxKx2 IYs7xG6rWj6s0DM7CIcVAFz4kK6r106r15M28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48v e4kI8wA2z4x0Y4vE2Ix0cI8IcVAFwI0_Gr0_Xr1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI 0_Gr0_Cr1l84ACjcxK6I8E87Iv67AKxVW8Jr0_Cr1UM28EF7xvwVC2z280aVCY1x0267AK xVW8Jr0_Cr1UM2kKe7AKxVWUXVWUAwAS0I0E0xvYzxvE52x082IY62kv0487Mc804VCY07 AIYIkI8VC2zVCFFI0UMc02F40EFcxC0VAKzVAqx4xG6I80ewAv7VC0I7IYx2IY67AKxVWU XVWUAwAv7VC2z280aVAFwI0_Jr0_Gr1lOx8S6xCaFVCjc4AY6r1j6r4UM4x0Y48IcxkI7V AKI48JMxAIw28IcxkI7VAKI48JMxC20s026xCaFVCjc4AY6r1j6r4UMxCIbckI1I0E14v2 6r1Y6r17MI8I3I0E5I8CrVAFwI0_Jr0_Jr4lx2IqxVCjr7xvwVAFwI0_JrI_JrWlx4CE17 CEb7AF67AKxVWUAVWUtwCIc40Y0x0EwIxGrwCI42IY6xIIjxv20xvE14v26r1j6r1xMIIF 0xvE2Ix0cI8IcVCY1x0267AKxVWUJVW8JwCI42IY6xAIw20EY4v20xvaj40_Jr0_JF4lIx AIcVC2z280aVAFwI0_Jr0_Gr1lIxAIcVC2z280aVCY1x0267AKxVWUJVW8JbIYCTnIWIev Ja73UjIFyTuYvjxU2G-eUUUUU 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 In the testpmd command, we have to stop the port firstly before configuring the DCB. However, some PMDs may execute a hardware reset during the port stop, such as ixgbe. Some kind of reset operations of PMD could clear the configurations of RSS in the hardware register. This would cause the loss of RSS configurations that were set during the testpmd initialization. As a result, I find that I cannot enable RSS and DCB at the same time in the testpmd command when using Intel 82599 NIC. The patch uses rss conf from software instead of reading from the hardware register when configuring DCB. Signed-off-by: Min Zhou Signed-off-by: Stephen Hemminger --- v2: Make internal function get_eth_dcb_conf return void and remove the unused parameter port_id. --- app/test-pmd/testpmd.c | 26 ++++++-------------------- 1 file changed, 6 insertions(+), 20 deletions(-) diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index f487769578..ac654048df 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -4080,15 +4080,11 @@ const uint16_t vlan_tags[] = { 24, 25, 26, 27, 28, 29, 30, 31 }; -static int -get_eth_dcb_conf(portid_t pid, struct rte_eth_conf *eth_conf, - enum dcb_mode_enable dcb_mode, - enum rte_eth_nb_tcs num_tcs, - uint8_t pfc_en) +static void +get_eth_dcb_conf(struct rte_eth_conf *eth_conf, enum dcb_mode_enable dcb_mode, + enum rte_eth_nb_tcs num_tcs, uint8_t pfc_en) { uint8_t i; - int32_t rc; - struct rte_eth_rss_conf rss_conf; /* * Builds up the correct configuration for dcb+vt based on the vlan tags array @@ -4130,12 +4126,6 @@ get_eth_dcb_conf(portid_t pid, struct rte_eth_conf *eth_conf, struct rte_eth_dcb_tx_conf *tx_conf = ð_conf->tx_adv_conf.dcb_tx_conf; - memset(&rss_conf, 0, sizeof(struct rte_eth_rss_conf)); - - rc = rte_eth_dev_rss_hash_conf_get(pid, &rss_conf); - if (rc != 0) - return rc; - rx_conf->nb_tcs = num_tcs; tx_conf->nb_tcs = num_tcs; @@ -4147,7 +4137,6 @@ get_eth_dcb_conf(portid_t pid, struct rte_eth_conf *eth_conf, eth_conf->rxmode.mq_mode = (enum rte_eth_rx_mq_mode) (rx_mq_mode & RTE_ETH_MQ_RX_DCB_RSS); - eth_conf->rx_adv_conf.rss_conf = rss_conf; eth_conf->txmode.mq_mode = RTE_ETH_MQ_TX_DCB; } @@ -4156,8 +4145,6 @@ get_eth_dcb_conf(portid_t pid, struct rte_eth_conf *eth_conf, RTE_ETH_DCB_PG_SUPPORT | RTE_ETH_DCB_PFC_SUPPORT; else eth_conf->dcb_capability_en = RTE_ETH_DCB_PG_SUPPORT; - - return 0; } int @@ -4180,10 +4167,9 @@ init_port_dcb_config(portid_t pid, /* retain the original device configuration. */ memcpy(&port_conf, &rte_port->dev_conf, sizeof(struct rte_eth_conf)); - /*set configuration of DCB in vt mode and DCB in non-vt mode*/ - retval = get_eth_dcb_conf(pid, &port_conf, dcb_mode, num_tcs, pfc_en); - if (retval < 0) - return retval; + /* set configuration of DCB in vt mode and DCB in non-vt mode */ + get_eth_dcb_conf(&port_conf, dcb_mode, num_tcs, pfc_en); + port_conf.rxmode.offloads |= RTE_ETH_RX_OFFLOAD_VLAN_FILTER; /* remove RSS HASH offload for DCB in vt mode */ if (port_conf.rxmode.mq_mode == RTE_ETH_MQ_RX_VMDQ_DCB) { -- 2.20.1