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 440D645AFB; Thu, 10 Oct 2024 00:30:56 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 05FF3402A3; Thu, 10 Oct 2024 00:30:56 +0200 (CEST) Received: from mail-pl1-f176.google.com (mail-pl1-f176.google.com [209.85.214.176]) by mails.dpdk.org (Postfix) with ESMTP id 042F9402D7 for ; Thu, 10 Oct 2024 00:30:53 +0200 (CEST) Received: by mail-pl1-f176.google.com with SMTP id d9443c01a7336-208cf673b8dso2421395ad.3 for ; Wed, 09 Oct 2024 15:30:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1728513053; x=1729117853; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=WfCkNPT7Mdv2XnQsiBUDYzLEkMK2bpIiyyPVFkTahgw=; b=idU77SmrX8oDHo1XkOAXHu5hAXBzpBh046OV4gTU6AJaq6BNwvbL1GiQ8dSeCqjxr9 yImOEaPA7SxhJdb6hQMb9BobA0oqWXMxUf/8rQ3mfE5a3OYR9xH45DcjQnRnBSKTxttj xEtB7scqg2+HK1yp1PM+Hp5V1ezlxj/4ZwU3y3Vu0y/NbnYnb0Opc6AcAHEV/CQL6spx HiDJPgfs6kM0aDi9xsfF5cB3Y75k4hTUz7c2lXGq4mCdlDSS6U7IJrCsqEyYJ8D592qZ 8wJjshJa2OE45pjukC5BxTR7MOOvaOf3ro5gNE7ZPLS4ovcwygvAC+r10j0fJOc+RarB 460A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728513053; x=1729117853; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=WfCkNPT7Mdv2XnQsiBUDYzLEkMK2bpIiyyPVFkTahgw=; b=M8kKJTEEqV9tpjyzuvbww5Gi2PdZhsYa6LMyypkUr65DPrlW3lW1CttbibIE7LslwB K6EFpwrT/dEAJ48xGP1PTFSO/9+Sdr4KFKqiEeV+Ppp8YfCNz0SqUxVksLpd34YyG3qs f9COCIX4ml9xcGPQU3S6a7+i/5uUFxp1GKPjo5O3f0Wwr3Dp1AJ6cPTxBTBHCBAGxZSK ac47zyx/fk2RNqL2d/B4Awxgpdm40RuREbvW9d0ZaXnOs7atf467U/+Q0N+kKrVCfO/0 /F3GEDAj0aBbOtfh3QTJc1OTVXJAoYAyrzh30/8mvPco6tbpuI7PmN1hSY0b9AftZHYa uw4Q== X-Forwarded-Encrypted: i=1; AJvYcCU9O5jrGLT1DbH5NPoYz3FV0oyqnaPrEVsHihizpSoZjKtCeQhXD7aWKwcBoFSBJplreuY=@dpdk.org X-Gm-Message-State: AOJu0YzLRszbMwO7Xj2/HQGL138h9Jgk0CO5VijBxebst3Tj3B+lPr5y FnbcgjtxT16XB6VeL0NzvqFLeUl4Jc0rCCtZa/JnN1EigXDO+9GytNITwSBJ8jg= X-Google-Smtp-Source: AGHT+IHI/+ZRg+16lMI9g0qzP/dJAsTKUl/1LROLLYiQkFFPu3G2cKlo291GMCOilJYnFeZE/BBkKQ== X-Received: by 2002:a17:903:2301:b0:20b:8341:d547 with SMTP id d9443c01a7336-20c63736915mr70868685ad.26.1728513052815; Wed, 09 Oct 2024 15:30:52 -0700 (PDT) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-7e9f680c732sm8843395a12.12.2024.10.09.15.30.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Oct 2024 15:30:52 -0700 (PDT) Date: Wed, 9 Oct 2024 15:30:50 -0700 From: Stephen Hemminger To: Min Zhou Cc: aman.deep.singh@intel.com, yuying.zhang@intel.com, dev@dpdk.org, maobibo@loongson.cn Subject: Re: [RFC] app/testpmd: use RSS conf from software when configuring DCB Message-ID: <20241009153050.1fac90e5@hermes.local> In-Reply-To: <20230412095239.1709477-1-zhoumin@loongson.cn> References: <20230412095239.1709477-1-zhoumin@loongson.cn> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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 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. 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) {