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 6C80BA0503; Fri, 6 May 2022 13:36:19 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 12EEC40395; Fri, 6 May 2022 13:36:19 +0200 (CEST) Received: from stargate.chelsio.com (stargate.chelsio.com [12.32.117.8]) by mails.dpdk.org (Postfix) with ESMTP id 6621C4014F for ; Fri, 6 May 2022 13:36:17 +0200 (CEST) Received: from localhost (sreekanth.asicdesigners.com [10.193.177.149] (may be forged)) by stargate.chelsio.com (8.14.7/8.14.7) with ESMTP id 246BaBa0019017; Fri, 6 May 2022 04:36:12 -0700 Date: Fri, 6 May 2022 17:06:11 +0530 From: Rahul Lakkireddy To: Ferruh Yigit Cc: Thomas Monjalon , Andrew Rybchenko , David Marchand , Jerin Jacob Kollanukkaran , Qi Z Zhang , Hemant Agrawal , "Min Hu (Connor)" , Viacheslav Ovsiienko , olivier.matz@6wind.com, dev@dpdk.org Subject: Re: [PATCH 5/5] net/cxgbe: read firmware configuration file from filesystem Message-ID: References: <20092a6b-c1f5-4d12-3391-687d648fa0e7@xilinx.com> <37be1c92-f15f-eac7-40c6-5614fe160d23@xilinx.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <37be1c92-f15f-eac7-40c6-5614fe160d23@xilinx.com> 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 Thursday, May 05/05/22, 2022 at 17:36:06 +0100, Ferruh Yigit wrote: > On 5/5/2022 5:29 PM, Ferruh Yigit wrote: > > On 4/18/2022 11:24 PM, Rahul Lakkireddy wrote: > > > Add support to read firmware configuration file from > > > /lib/firmware/cxgb4/ path in the filesystem. > > > > > > > Hi Rahul, > > > > Can you please document the FW config file in the driver documentation? > > Please add: > > - Path of the config file > > - Content of the config file. As far as I can see from the code the > > config file directly sent to the FW, does this mean config file is > > binary? > > - What happens when config file is not found > > > > Also are these values overlap with the devargs that PMD has? If so what > > happens in that case, which one is used, devargs one or config file one? > > > > Previously there was 'cxgbtool' tool to send the config file, is this > > method replacing it? Why not keep using 'cxgbtool'? > > The Chelsio FW config file contains a list of register=value pairs to change configuration of the NIC before firmware is initialized. It closely resembles the INI file format. It is mainly used to aid in debugging FW initialization failures and to optimally partition NIC hardware resources for specific requirements. Partitioning generally involves moving resources on unused Physical Functions (PFs) to the main PF, like redistributing queues, hardware TCAMs, etc., before firmware begins initialization. Once the configuration looks good, then the final FW config file is flashed onto the NIC using the cxgbtool. The FW config file can then be removed from the /lib/firmware/cxgb4/ directory and the FW will begin initializing with the flashed FW config file on the NIC from next time onwards. With this patch, the FW config file is selected in following order. 1) Check and select FW config file present in /lib/firmware/cxgb4/ directory. 2) Otherwise, check and select FW config file flashed onto the NIC. 3) Otherwise, select the default FW config file embedded within the FW binary on the NIC. Since this is pretty low-level hardware configuration, the users are not expected to change this file without expert guidance. So, exporting such a low-level configuration via devargs API does not feel like the right fit for this specific requirement. Once FW is up and running with the FW config file, some of the driver and FW runtime features can be enabled/disabled via devargs API during driver probe. To summarize, the FW config file is intended to debug FW initialization failures and/or aid in resources partitioning before FW starts initialization. Once the FW is running, the whole or smaller slices of these partitioned resources can be further redistributed across the multiple physical ports controlled by the same underlying PF. > > cc'ed more folks. > > This patch introduces a userspace config file for runtime FW config. > > What do you think about this approach? > Should we formalize this method more, like introducing an ethdev level > config option to hold the config file, which can be used for driver and/or > FW. And perhaps with a defined syntax (yaml?). > Can this be an alternative to PMD devargs? > > Cheers, > ferruh Thanks, Rahul