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 51C35A0A05; Tue, 19 Jan 2021 16:44:50 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3A791140ECE; Tue, 19 Jan 2021 16:44:50 +0100 (CET) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mails.dpdk.org (Postfix) with ESMTP id 3898E140ECC for ; Tue, 19 Jan 2021 16:44:48 +0100 (CET) IronPort-SDR: ib4c72Fqt1JQWiNCr74j7wpEIdHwXttoQzfHEZtq8+ELRxUlHbyezOlJ+wvG4upKgOdnB9oQe5 0Hd0RFkK6f6g== X-IronPort-AV: E=McAfee;i="6000,8403,9869"; a="158126506" X-IronPort-AV: E=Sophos;i="5.79,359,1602572400"; d="scan'208";a="158126506" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Jan 2021 07:44:47 -0800 IronPort-SDR: tXHgtcYoB9ugsNiftCRxhvEO/lQl58mCmjhVkgrQcCnV0Ed+DrPhjv1KMHdxbT+lisybvbH7x7 Fneh0IEayA4w== X-IronPort-AV: E=Sophos;i="5.79,359,1602572400"; d="scan'208";a="426508679" Received: from fyigit-mobl1.ger.corp.intel.com (HELO [10.213.241.104]) ([10.213.241.104]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Jan 2021 07:44:45 -0800 To: Steve Yang , dev@dpdk.org Cc: wenzhuo.lu@intel.com, beilei.xing@intel.com, bernard.iremonger@intel.com, xiaoyun.li@intel.com, qiming.yang@intel.com References: <20201222081335.17419-1-stevex.yang@intel.com> <20201223085152.20866-1-stevex.yang@intel.com> From: Ferruh Yigit Message-ID: <50cc6c50-58fa-943f-7eef-e458ca9f4251@intel.com> Date: Tue, 19 Jan 2021 15:44:41 +0000 MIME-Version: 1.0 In-Reply-To: <20201223085152.20866-1-stevex.yang@intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Subject: Re: [dpdk-dev] [PATCH v2] app/testpmd: fix dynamic config error 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" On 12/23/2020 8:51 AM, Steve Yang wrote: > The offloads of 'tx/rx_conf' didn't keep up with the corresponding > offloads of 'dev_conf', it would cause the configuration invalid. > > For example: > Configuring 'max-pkt-len' would change 'rx_offloads' in dev_conf while > rx_conf.offloads of each queue still kept the old value. > It would cause the failure of offloads check in 'rte_eth_rx_queue_setup'. > Can you please give some details how can I reproduce the issue? > This patch applied tx/rx offloads configuration for each queue > once it changed. > > Fixes: 5e91aeef218c ("app/testpmd: fix offload flags after port config") > > Signed-off-by: Steve Yang > --- > v2: > * moved the update logic to 'rxtx_port_config'; > * added the 'tx_conf' part; > * optimized the 'default' assignment; > --- > app/test-pmd/testpmd.c | 16 ++++++++++------ > 1 file changed, 10 insertions(+), 6 deletions(-) > > diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c > index 33a060dffd..6ee28e3797 100644 > --- a/app/test-pmd/testpmd.c > +++ b/app/test-pmd/testpmd.c > @@ -3288,9 +3288,11 @@ rxtx_port_config(struct rte_port *port) > > for (qid = 0; qid < nb_rxq; qid++) { > offloads = port->rx_conf[qid].offloads; > - port->rx_conf[qid] = port->dev_info.default_rxconf; > - if (offloads != 0) > - port->rx_conf[qid].offloads = offloads; > + if (offloads != port->dev_conf.rxmode.offloads) > + port->rx_conf[qid].offloads = > + port->dev_conf.rxmode.offloads; Isn't 'rxmode.offloads' for the port, but the 'rx_conf[qid].offloads' for the queue, can this cause problem if the queue level offloads used? > + if (!offloads) > + port->rx_conf[qid] = port->dev_info.default_rxconf; Can you please explain this, why the default config is used, only if the 'offload' is zero? The original code is always using the default config, but overwriting the 'offloads' if needed. > > /* Check if any Rx parameters have been passed */ > if (rx_pthresh != RTE_PMD_PARAM_UNSET) > @@ -3313,9 +3315,11 @@ rxtx_port_config(struct rte_port *port) > > for (qid = 0; qid < nb_txq; qid++) { > offloads = port->tx_conf[qid].offloads; > - port->tx_conf[qid] = port->dev_info.default_txconf; > - if (offloads != 0) > - port->tx_conf[qid].offloads = offloads; > + if (offloads != port->dev_conf.txmode.offloads) > + port->tx_conf[qid].offloads = > + port->dev_conf.txmode.offloads; > + if (!offloads) > + port->tx_conf[qid] = port->dev_info.default_txconf; > > /* Check if any Tx parameters have been passed */ > if (tx_pthresh != RTE_PMD_PARAM_UNSET) >