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 D812E45D51; Wed, 20 Nov 2024 10:09:10 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6FA0842ED7; Wed, 20 Nov 2024 10:09:10 +0100 (CET) Received: from mail.loongson.cn (mail.loongson.cn [114.242.206.163]) by mails.dpdk.org (Postfix) with ESMTP id 0499840E36 for ; Wed, 20 Nov 2024 10:09:08 +0100 (CET) Received: from loongson.cn (unknown [10.20.42.74]) by gateway (Coremail) with SMTP id _____8AxquEwpz1nIIVDAA--.3996S3; Wed, 20 Nov 2024 17:09:05 +0800 (CST) Received: from [10.20.42.74] (unknown [10.20.42.74]) by front1 (Coremail) with SMTP id qMiowMBx58Atpz1nb_ZeAA--.29535S3; Wed, 20 Nov 2024 17:09:03 +0800 (CST) Subject: Re: [RFC] app/testpmd: use RSS conf from software when configuring DCB To: Stephen Hemminger Cc: aman.deep.singh@intel.com, yuying.zhang@intel.com, dev@dpdk.org, Ferruh Yigit References: <20230412095239.1709477-1-zhoumin@loongson.cn> <20241009153050.1fac90e5@hermes.local> From: zhoumin Message-ID: <48fbd9cc-0817-ce6f-f36d-0097db056acd@loongson.cn> Date: Wed, 20 Nov 2024 17:08:57 +0800 User-Agent: Mozilla/5.0 (X11; Linux loongarch64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: <20241009153050.1fac90e5@hermes.local> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-CM-TRANSID: qMiowMBx58Atpz1nb_ZeAA--.29535S3 X-CM-SenderInfo: 52kr3ztlq6z05rqj20fqof0/1tbiAQEHAWc9FL0MRQAAs8 X-Coremail-Antispam: 1Uk129KBj93XoWxXFyfCF47urWfXry8WFy8Zwc_yoWrtr4DpF WDG3Z0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FxhVjvjDU0xZFpf9x07jjwZcUUUUU= 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 Hi Stephen, Sorry for the delay. On Thur, Oct 10 at 2024 6:30AM, Stephen Hemminger wrote: > On Wed, 12 Apr 2023 17:52:39 +0800 > Min Zhou wrote: > >> 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. >> >> Although this patch can solve the problem I encountered, is there any risk >> of using rss conf from software instead of reading from the hardware >> register when configuring DCB? >> >> Signed-off-by: Min Zhou >> --- >> app/test-pmd/testpmd.c | 11 +---------- >> 1 file changed, 1 insertion(+), 10 deletions(-) >> >> diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c >> index 5cb6f92523..3c382267b8 100644 >> --- a/app/test-pmd/testpmd.c >> +++ b/app/test-pmd/testpmd.c >> @@ -4247,14 +4247,12 @@ const uint16_t vlan_tags[] = { >> }; >> >> static int >> -get_eth_dcb_conf(portid_t pid, struct rte_eth_conf *eth_conf, >> +get_eth_dcb_conf(portid_t pid __rte_unused, 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; >> > Sorry for the late review, but almost uses DCB and fewer still with DPDK; > so not surprised that there would be issues like this. > > If you change an internal function like get_eth_dcb_conf to remove parameters > then do not mark those parameters as unused, instead remove them from the function > and the caller. Plus the function now always returns 0 so it can be reset as void. > first place. Yes, I agree with your point. Thanks for providing the suggested codes. I have tested this change and it can solve the problem. I will send the V2 version. Best Regards, Min Zhou > > Suggest the following (untested): > > diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c > index b1401136e4..5eaac752c6 100644 > --- a/app/test-pmd/testpmd.c > +++ b/app/test-pmd/testpmd.c > @@ -4291,15 +4291,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 > @@ -4341,12 +4337,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; > > @@ -4358,7 +4348,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; > } > > @@ -4367,8 +4356,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 > @@ -4391,10 +4378,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) {