From: Thomas Monjalon <thomas@monjalon.net>
To: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Cc: Ferruh Yigit <ferruh.yigit@xilinx.com>,
Andrew Rybchenko <arybchenko@solarflare.com>,
David Marchand <david.marchand@redhat.com>,
Jerin Jacob Kollanukkaran <jerinj@marvell.com>,
Qi Z Zhang <qi.z.zhang@intel.com>,
Hemant Agrawal <hemant.agrawal@nxp.com>,
"Min Hu (Connor)" <humin29@huawei.com>,
Viacheslav Ovsiienko <viacheslavo@nvidia.com>,
olivier.matz@6wind.com, dev@dpdk.org
Subject: Re: [PATCH 5/5] net/cxgbe: read firmware configuration file from filesystem
Date: Tue, 10 May 2022 18:20:41 +0200 [thread overview]
Message-ID: <3415032.V25eIC5XRa@thomas> (raw)
In-Reply-To: <Ynp/HxzSCaJ/nv9P@chelsio.com>
10/05/2022 17:05, Rahul Lakkireddy:
> On Tuesday, May 05/10/22, 2022 at 16:30:59 +0200, Thomas Monjalon wrote:
> > 10/05/2022 16:11, Rahul Lakkireddy:
> > > On Tuesday, May 05/10/22, 2022 at 11:02:05 +0200, Thomas Monjalon wrote:
> > > > 06/05/2022 13:36, Rahul Lakkireddy:
> > > > > 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.
> > > >
> > > > Sorry it is not clear to me.
> > > > The FW file is used by cxgbtool to flash it, right?
> > > > The PMD may use the same FW file for debug diagnostics?
> > >
> > >
> > > There are 2 FW related files in /lib/firmware/cxgb4 directory that
> > > can be written into the NIC flash (at different locations in the flash)
> > > using cxgbtool:
> > >
> > > 1) FW config file (t6-config.txt): This file contains register=value
> > > pairs to configure some HW registers before initializing FW
> > > (t6fw.bin). These register=value pairs are very low level and
> > > specific to HW. The FW config file can be used to enable/disable
> > > some paths in HW to debug FW initialization issues. Since it
> > > can disable some paths in HW, it can also be used to partition
> > > and redistribute resources from other unused PFs to main PF,
> > > before FW initialization.
> > >
> > > 2) FW binary (t6fw.bin): This contains the actual FW. This binary also
> > > has an embedded "default" FW config file that will be used if no
> > > FW config file (t6-config.txt) is present in NIC "flash" or in the
> > > "/lib/firmware/cxgb4/" directory.
> > >
> > > > How is it used by the kernel?
> > > >
> > >
> > > In kernel cxgb4 driver also, we follow the same sequence when
> > > initializing FW. If any FW config file (t6-config.txt) is present
> > > in "/lib/firmware/cxgb4" directory, then it is picked up first.
> > > Otherwise, a FW config file that has been "flashed" onto the NIC
> > > using cxgbtool, is picked up next. Otherwise, FW will init with
> > > the "default" FW config file embedded inside the FW binary (t6fw.bin).
> > >
> > > Currently, the DPDK cxgbe PMD only picks up the FW config file from
> > > NIC "flash" or the "default" one inside the FW binary. This patch adds
> > > a way to pick FW config file from "lib/firmware/cxgb4" directory when
> > > a FW config file is placed there.
> >
> > OK, so both Linux and DPDK drivers read the FW config file
> > to provide better diagnostics. Am I right?
> >
>
> Yes, both use the FW config file to enable/disable specific paths in
> HW to get better diagnostics for FW init failures.
OK thanks for the explanation.
The idea looks OK.
next prev parent reply other threads:[~2022-05-10 16:20 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-18 22:24 [PATCH 0/5] net/cxgbe: updates and bug fixes Rahul Lakkireddy
2022-04-18 22:24 ` [PATCH 1/5] net/cxgbe: fill correct port info in mbufs for Rx Rahul Lakkireddy
2022-04-18 22:24 ` [PATCH 2/5] net/cxgbe: fix Tx queue stuck with mbuf chain coalescing Rahul Lakkireddy
2022-04-18 22:24 ` [PATCH 3/5] net/cxgbe: simplify Rx payload buffer size posting Rahul Lakkireddy
2022-04-18 22:24 ` [PATCH 4/5] net/cxgbe: track packets dropped by TP due to congestion Rahul Lakkireddy
2022-05-05 16:28 ` Ferruh Yigit
2022-05-06 11:09 ` Rahul Lakkireddy
2022-05-06 12:32 ` Ferruh Yigit
2022-05-06 13:18 ` [PATCH v2] " Rahul Lakkireddy
2022-05-17 16:52 ` Ferruh Yigit
2022-04-18 22:24 ` [PATCH 5/5] net/cxgbe: read firmware configuration file from filesystem Rahul Lakkireddy
2022-05-05 16:29 ` Ferruh Yigit
2022-05-05 16:36 ` Ferruh Yigit
2022-05-06 11:36 ` Rahul Lakkireddy
2022-05-10 9:02 ` Thomas Monjalon
2022-05-10 14:11 ` Rahul Lakkireddy
2022-05-10 14:30 ` Thomas Monjalon
2022-05-10 15:05 ` Rahul Lakkireddy
2022-05-10 16:20 ` Thomas Monjalon [this message]
2022-05-16 10:27 ` [PATCH v2] " Rahul Lakkireddy
2022-05-16 11:06 ` Ferruh Yigit
2022-05-16 11:56 ` Rahul Lakkireddy
2022-05-16 14:05 ` Ferruh Yigit
2022-05-16 19:34 ` [PATCH v3] " Rahul Lakkireddy
2022-05-17 16:52 ` Ferruh Yigit
2022-05-05 16:29 ` [PATCH 0/5] net/cxgbe: updates and bug fixes Ferruh Yigit
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3415032.V25eIC5XRa@thomas \
--to=thomas@monjalon.net \
--cc=arybchenko@solarflare.com \
--cc=david.marchand@redhat.com \
--cc=dev@dpdk.org \
--cc=ferruh.yigit@xilinx.com \
--cc=hemant.agrawal@nxp.com \
--cc=humin29@huawei.com \
--cc=jerinj@marvell.com \
--cc=olivier.matz@6wind.com \
--cc=qi.z.zhang@intel.com \
--cc=rahul.lakkireddy@chelsio.com \
--cc=viacheslavo@nvidia.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).