[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <fbc0ae3f-ced6-39c0-2e9c-f5d56cb26d43@intel.com>
Date: Wed, 20 Dec 2023 14:12:17 -0800
From: Tony Nguyen <anthony.l.nguyen@...el.com>
To: "Nelson, Shannon" <shannon.nelson@....com>, "Pucha, HimasekharX Reddy"
<himasekharx.reddy.pucha@...el.com>, Kunwu Chan <chentao@...inos.cn>,
"Brandeburg, Jesse" <jesse.brandeburg@...el.com>, "davem@...emloft.net"
<davem@...emloft.net>, "edumazet@...gle.com" <edumazet@...gle.com>,
"kuba@...nel.org" <kuba@...nel.org>, "pabeni@...hat.com" <pabeni@...hat.com>,
"jeffrey.t.kirsher@...el.com" <jeffrey.t.kirsher@...el.com>
CC: Kunwu Chan <kunwu.chan@...mail.com>, "netdev@...r.kernel.org"
<netdev@...r.kernel.org>, "linux-kernel@...r.kernel.org"
<linux-kernel@...r.kernel.org>, "Lobakin, Aleksander"
<aleksander.lobakin@...el.com>, "intel-wired-lan@...ts.osuosl.org"
<intel-wired-lan@...ts.osuosl.org>, Simon Horman <horms@...nel.org>
Subject: Re: [Intel-wired-lan] [PATCH v5 iwl-next] i40e: Use correct buffer
size in i40e_dbg_command_read
On 12/19/2023 5:32 PM, Nelson, Shannon wrote:
> On 12/17/2023 9:54 PM, Pucha, HimasekharX Reddy wrote:
>>
>>> -----Original Message-----
>>> From: Intel-wired-lan <intel-wired-lan-bounces@...osl.org> On Behalf
>>> Of Kunwu Chan
>>> Subject: [Intel-wired-lan] [PATCH v5 iwl-next] i40e: Use correct
>>> buffer size in i40e_dbg_command_read
>>>
>>> The size of "i40e_dbg_command_buf" is 256, the size of "name"
>>> depends on "IFNAMSIZ", plus a null character and format size,
>>> the total size is more than 256.
>>>
>>> Improve readability and maintainability by replacing a hardcoded string
>>> allocation and formatting by the use of the kasprintf() helper.
>>>
>>> Fixes: 02e9c290814c ("i40e: debugfs interface")
>>> Suggested-by: Simon Horman <horms@...nel.org>
>>> Suggested-by: Alexander Lobakin <aleksander.lobakin@...el.com>
>>> Suggested-by: Tony Nguyen <anthony.l.nguyen@...el.com>
>>> Cc: Kunwu Chan <kunwu.chan@...mail.com>
>>> Signed-off-by: Kunwu Chan <chentao@...inos.cn>
>>> ---
...
> Much of this debugfs command code was an early driver hack that probably
> never should have gone upstream in the form that it did. The
> i40e_dbg_command_buf itself was originally meant as a scratchpad to put
> the 'last command processed', which was not really very useful, and as a
> static global that might be written by any number of instances of i40e
> devices, was problematic from the beginning. Now, unless I'm mistaken,
> it looks like nothing is writing to the buffer at all anymore, so the
> buffer and the i40e_dbg_command_read() callback probably should just all
> go away rather than trying to pretty up some useless code.
Thanks for the history Shannon. I'm not seeing the buffer used either
so, I agree, we should remove it altogether.
Thanks,
Tony
> sln
Powered by blists - more mailing lists