From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id B0D00A0471 for ; Mon, 17 Jun 2019 14:59:39 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 7976D1BD6B; Mon, 17 Jun 2019 14:59:39 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id D43531BD6B; Mon, 17 Jun 2019 14:59:37 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 Jun 2019 05:59:36 -0700 X-ExtLoop1: 1 Received: from fyigit-mobl.ger.corp.intel.com (HELO [10.237.221.26]) ([10.237.221.26]) by orsmga002.jf.intel.com with ESMTP; 17 Jun 2019 05:59:34 -0700 To: "Zhao1, Wei" , "dev@dpdk.org" Cc: "stable@dpdk.org" , "Peng, Yuan" , "Lu, Wenzhuo" , Kevin Traynor References: <1557386447-57225-1-git-send-email-wei.zhao1@intel.com> <9bb24a9e-4e4f-9d9b-14dc-a9ed7d00d4d5@intel.com> From: Ferruh Yigit Openpgp: preference=signencrypt Autocrypt: addr=ferruh.yigit@intel.com; prefer-encrypt=mutual; keydata= mQINBFXZCFABEADCujshBOAaqPZpwShdkzkyGpJ15lmxiSr3jVMqOtQS/sB3FYLT0/d3+bvy qbL9YnlbPyRvZfnP3pXiKwkRoR1RJwEo2BOf6hxdzTmLRtGtwWzI9MwrUPj6n/ldiD58VAGQ +iR1I/z9UBUN/ZMksElA2D7Jgg7vZ78iKwNnd+vLBD6I61kVrZ45Vjo3r+pPOByUBXOUlxp9 GWEKKIrJ4eogqkVNSixN16VYK7xR+5OUkBYUO+sE6etSxCr7BahMPKxH+XPlZZjKrxciaWQb +dElz3Ab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aLAI3E8TjIXAO0cPqUNLyp g0DXezmTw5BU+SKZ51+jSKOtFmzJCHOJZQaMeCHD+G3CrdUHQVQBb5AeuH3KFv9ltgDcWsc8 YO70o3+tGHwcEnyXLdrI0q05wV7ncnLdkgVo+VUN4092bNMPwYly1TZWcU3Jw5gczOUEfTY7 sgo6E/sGX3B+FzgIs5t4yi1XOweCAQ/mPnb6uFeNENEFyGKyMG1HtjwBqnftbiFO3qitEIUY xWGQH23oKscv7i9lT0gg2D+ktzZhVWwHJVY/2vWSB9aCSWChcH2BT+lWrkwSpoPhy+almM84 Qz2wF72/d4ce4L27pSrS+vOXtXHLGOOGcAn8yr9TV0kM4aR+NbGBRXGKhG6w4lY54uNd9IBa ARIPUhij5JSygxZCBaJKo+X64AHGkk5bXq+f0anwAMNuJXbYC/lz4DEdKmPgQGShOWNs1Y1a N3cI87Hun/RBVwQ0a3Tr1g6OWJ6xK8cYbMcoR8NZ7L9ALMeJeuUDQR39+fEeHg/6sQN0P0mv 0sL+//BAJphCzDk8ztbrFw+JaPtgzZpRSM6JhxnY+YMAsatJRXA0WSpYP5zzl7yu/GZJIgsv VQ== Message-ID: <41a4671e-3109-3303-c0e0-15e5cfcf2b83@intel.com> Date: Mon, 17 Jun 2019 13:59:33 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.7.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Subject: Re: [dpdk-stable] [PATCH] app/testpmd: fix offloads overwrite by default configuration X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" On 6/17/2019 2:51 AM, Zhao1, Wei wrote: > > >> -----Original Message----- >> From: Yigit, Ferruh >> Sent: Friday, June 14, 2019 11:42 PM >> To: Zhao1, Wei ; dev@dpdk.org >> Cc: stable@dpdk.org; Peng, Yuan ; Lu, Wenzhuo >> ; Kevin Traynor >> Subject: Re: [dpdk-stable] [PATCH] app/testpmd: fix offloads overwrite by >> default configuration >> >> On 6/12/2019 2:17 AM, Zhao1, Wei wrote: >>> >>> >>>> -----Original Message----- >>>> From: Yigit, Ferruh >>>> Sent: Tuesday, June 11, 2019 10:37 PM >>>> To: Zhao1, Wei ; dev@dpdk.org >>>> Cc: stable@dpdk.org; Peng, Yuan ; Lu, Wenzhuo >>>> ; Kevin Traynor >>>> Subject: Re: [dpdk-stable] [PATCH] app/testpmd: fix offloads >>>> overwrite by default configuration >>>> >>>> On 5/9/2019 8:20 AM, Wei Zhao wrote: >>>>> There is an error in function rxtx_port_config(), which may >>>>> overwrite offloads configuration get from function >>>>> launch_args_parse() when run testpmd app. So rxtx_port_config() should >> do "or" for port offloads. >>>>> >>>>> Fixes: d44f8a485f5d ("app/testpmd: enable per queue configure") >>>>> cc: stable@dpdk.org >>>>> >>>>> Signed-off-by: Wei Zhao >>>>> --- >>>>> app/test-pmd/testpmd.c | 5 +++++ >>>>> 1 file changed, 5 insertions(+) >>>>> >>>>> diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index >>>>> 6fbfd29..f0061d9 100644 >>>>> --- a/app/test-pmd/testpmd.c >>>>> +++ b/app/test-pmd/testpmd.c >>>>> @@ -2809,9 +2809,12 @@ static void >>>>> rxtx_port_config(struct rte_port *port) { >>>>> uint16_t qid; >>>>> + uint64_t offloads; >>>>> >>>>> for (qid = 0; qid < nb_rxq; qid++) { >>>>> + offloads = port->rx_conf[qid].offloads; >>>>> port->rx_conf[qid] = port->dev_info.default_rxconf; >>>>> + port->rx_conf[qid].offloads |= offloads; >>>> >>>> While talking with Kevin, he pointed out the error in this code. >>>> >>>> We are updating queue level offloads, with whatever in the 'offloads' >>>> and it can be non-queue level offloads in it, next time ethdev API >>>> called these values are caught by the API checks and causing an error. >>>> >>>> It looks like port level offload flags needs to be masted out before >>>> writing to queue level 'offloads' variable. >>> >>> >>> By the way, this error in not introduced in this patch, it seems has exist long >> before this patch. >>> This patch is just fix for overwrite problem. >> >> I disagree, writing 'offloads' to "rx_conf[].offloads" without checking if they >> queue offloads or not causing this problem. And that write introduced in this >> patch. >> > > But if delete the patch I submitted, this bug still exists there. OK, after checking again, the defect was there as you said, but your patch makes it visible. How to reproduce the problem: testpmd> port stop all testpmd> port config all crc-strip on testpmd> port start all Ethdev port_id=0 rx_queue_id=0, new added offloads 0x10000 must be within per-queue offload capabilities 0x0 in rte_eth_rx_queue_setup() The failure is coming from 'rte_eth_rx_queue_setup()' and a valid error, a "port level offload" can't be set to individual queues without setting in port level, that is what happening here. "port config all crc-strip on" removes the 'keep_crc' offload from port but not from queues, so when 'rte_eth_rx_queue_setup()' called it complains about it. Before your patch "queue offloads" were overwritten and this error was not observed. The solution can be updating "port config all xxxx on|off" command to updates queue offload values too, but even better we can remove it completely: There are already different testpmd commands for same thing: "port config rx_offload " "port config tx_offload " "port txq rx_offload " "port txq tx_offload " For example using "port config 0 rx_offload crc-strip on" will work without error since it sets the port and queue offload properly. Only missing thing in above commands are "all" parameter. I suggest removing "port config all on|off" and adding "all" support to above commands. > >> >>> >>> >>> >>>> >>>>> >>>>> /* Check if any Rx parameters have been passed */ >>>>> if (rx_pthresh != RTE_PMD_PARAM_UNSET) @@ -2833,7 >>>> +2836,9 @@ >>>>> 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; >>>>> + port->tx_conf[qid].offloads |= offloads; >>>>> >>>>> /* Check if any Tx parameters have been passed */ >>>>> if (tx_pthresh != RTE_PMD_PARAM_UNSET) >>>>> >>> >