[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2a529cbe-75f6-0fdf-cdfb-8409965c1a16@intel.com>
Date: Wed, 11 Oct 2023 17:43:05 -0700
From: Paul M Stillwell Jr <paul.m.stillwell.jr@...el.com>
To: Jakub Kicinski <kuba@...nel.org>
CC: Tony Nguyen <anthony.l.nguyen@...el.com>, <davem@...emloft.net>,
<pabeni@...hat.com>, <edumazet@...gle.com>, <netdev@...r.kernel.org>,
<jacob.e.keller@...el.com>, <vaishnavi.tipireddy@...el.com>,
<horms@...nel.org>, <leon@...nel.org>, <corbet@....net>,
<linux-doc@...r.kernel.org>, <rdunlap@...radead.org>
Subject: Re: [PATCH net-next v4 5/5] ice: add documentation for FW logging
On 10/10/2023 6:18 PM, Jakub Kicinski wrote:
> On Tue, 10 Oct 2023 16:00:13 -0700 Paul M Stillwell Jr wrote:
>>>> +Retrieving FW log data
>>>> +~~~~~~~~~~~~~~~~~~~~~~
>>>> +The FW log data can be retrieved by reading from 'fwlog/data'. The user can
>>>> +write to 'fwlog/data' to clear the data. The data can only be cleared when FW
>>>> +logging is disabled.
>>>
>>> Oh, now it sounds like only one thing can be enabled at a time.
>>> Can you clarify?
>>>
>>
>> What I'm trying to describe here is a mechanism to read all the data
>> (whatever modules have been enabled) as it's coming in and to also be
>> able to clear the data in case the user wants to start fresh (by writing
>> 0 to the file). Does that make sense?
>
> Yes that part does.
>
>> I probably wasn't clear in the
>> previous section that the user can enable many modules at the same time.
>
> Probably best if you describe enabling of multiple modules in the
> example. I'm not sure how one disables a module with the current API.
>
Will do
>>> Why 4K? The number of buffers is irrelevant to the user, why not let
>>> the user configure the size in bytes (which his how much DRAM the
>>> driver will hold hostage)?
>>
>> I'm trying to keep the numbers small for the user :). I could say
>> 1048576 bytes (256 x 4096), but those kinds of numbers get unwieldy to a
>> user (IMO).
>
> echo $((256 * 4096)) >> $the_file
>
I'll change it to be a bytes of data to store instead of number of buffers
> But also...
>
>> The FW logs generate a LOT of data depending on what modules are enabled
>> so we typically need a lot of buffers to handle them.
>>
>> In the past we have tried to use the syslog mechanism, but we generate
>> SO much data that we overwhelm that and lose data. That's why the idea
>> of using static buffers is appealing to us. We could still overrun the
>> buffers, but at least we will have contiguous data. The problem then
>> becomes one of allocating enough space for what the user is trying to
>> catch instead of trying to start/stop logging and hoping you get all the
>> events in the log.
>>
>> I can drop the mention of 4K buffers in the documentation. Or we could
>> use terms like 1M, 2M, 512K, et al. That would require string parsing in
>> the driver though and I'm trying to avoid that if possible. What do you
>> think?
>
> .. I thought such helpers already existed.
If you are referring to helpers to handle 1M et al, I couldn't find
anything. I found the kstrto<x> stuff, but that doesn't handle this case
correctly I don't think.
Powered by blists - more mailing lists