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 3836EA0A0A; Fri, 22 Jan 2021 18:05:06 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id ECD30141030; Fri, 22 Jan 2021 18:05:05 +0100 (CET) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mails.dpdk.org (Postfix) with ESMTP id A3DAC14102D for ; Fri, 22 Jan 2021 18:05:04 +0100 (CET) IronPort-SDR: mRL5wlzuc3tNBpEBGnqEgYoHtLOuYtLUV9S16u7jlzCQdSMPpU+ZXpgcmbS+9kwMDWDUrspiED kV/1yrAmZFXw== X-IronPort-AV: E=McAfee;i="6000,8403,9872"; a="264292474" X-IronPort-AV: E=Sophos;i="5.79,367,1602572400"; d="scan'208";a="264292474" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Jan 2021 09:05:03 -0800 IronPort-SDR: yCt4fFdGGK4wvRyOCL2v0hmSB5D1QL3Efea2k/UdfeXjM4SY6zpnKbIW4ciKiMEXynCA5XNAQQ bVmSzGWde0tw== X-IronPort-AV: E=Sophos;i="5.79,367,1602572400"; d="scan'208";a="385825328" Received: from fyigit-mobl1.ger.corp.intel.com (HELO [10.213.222.36]) ([10.213.222.36]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Jan 2021 09:05:00 -0800 To: Steve Yang , dev@dpdk.org Cc: wenzhuo.lu@intel.com, xiaoyun.li@intel.com, bernard.iremonger@intel.com, thomas@monjalon.net, andrew.rybchenko@oktetlabs.ru, qiming.yang@intel.com References: <20201223085152.20866-1-stevex.yang@intel.com> <20210122090110.50453-1-stevex.yang@intel.com> <20210122090110.50453-4-stevex.yang@intel.com> From: Ferruh Yigit Message-ID: <564fad2d-3861-f4e3-2129-c0c6b3638d74@intel.com> Date: Fri, 22 Jan 2021 17:04:57 +0000 MIME-Version: 1.0 In-Reply-To: <20210122090110.50453-4-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 v3 3/3] 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 1/22/2021 9:01 AM, Steve Yang wrote: > The offloads of 'tx/rx_conf' didn't keep up with the corresponding > offloads of 'dev_conf' if rx queue capability was 0, 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'. > > This patch applied tx/rx offloads configuration for each queue > once it changed and corresponding tx/rx queue capability was 0. > > Fixes: 5e91aeef218c ("app/testpmd: fix offload flags after port config") > > Signed-off-by: Steve Yang > --- > app/test-pmd/testpmd.c | 12 ++++++++++-- > 1 file changed, 10 insertions(+), 2 deletions(-) > > diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c > index a2c9aad960..8307c7f9e9 100644 > --- a/app/test-pmd/testpmd.c > +++ b/app/test-pmd/testpmd.c > @@ -3296,7 +3296,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) > + if (port->dev_info.rx_queue_offload_capa == 0 && > + offloads != port->dev_conf.rxmode.offloads) > + port->rx_conf[qid].offloads = > + port->dev_conf.rxmode.offloads; > + else if (offloads != 0) > port->rx_conf[qid].offloads = offloads; I am still concerned to use port offloads to set the queue specific offloads, this may lead unexpected result. Below is what Steve provided as reproduce steps [1], I think that is application (testpmd) miss-configuration to update 'max-pkt-len' but not update the JUMBO_FRAME offload flag and MTU accordingly. What do you think update the JUMBO_FRAME offload flag (both for port and queues) according and set MTU according on the testpmd command where 'max-pkt-len' is set? This is more like your first version. [1] ---------------------------------------------- # x86_64-native-linuxapp-gcc/app/dpdk-testpmd -c 0xf -n 4 -- -i --max-pkt-len=9000 --tx-offloads=0x8000 --rxq=4 --txq=4 --disable-rss testpmd> set verbose 3 testpmd> start testpmd> stop testpmd> port stop all testpmd> port config all max-pkt-len 1518 testpmd> port start all Configuring Port 0 (socket 1) Ethdev port_id=0 rx_queue_id=0, new added offloads 0x800 must be within per-queue offload capabilities 0x0 in rte_eth_rx_queue_setup() Fail to configure port 0 rx queues//<-- Fail error info; ------------------------------------------------ > > /* Check if any Rx parameters have been passed */ > @@ -3321,7 +3325,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) > + if (port->dev_info.tx_queue_offload_capa == 0 && > + offloads != port->dev_conf.txmode.offloads) > + port->tx_conf[qid].offloads = > + port->dev_conf.txmode.offloads; > + else if (offloads != 0) > port->tx_conf[qid].offloads = offloads; > > /* Check if any Tx parameters have been passed */ >