[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b4f4eace-117f-4d55-bcf7-6718d70cbf88@intel.com>
Date: Tue, 29 Oct 2024 16:54:48 -0700
From: Jacob Keller <jacob.e.keller@...el.com>
To: Rosen Penev <rosenp@...il.com>, Jakub Kicinski <kuba@...nel.org>
CC: <netdev@...r.kernel.org>, Justin Chen <justin.chen@...adcom.com>, "Florian
Fainelli" <florian.fainelli@...adcom.com>, Andrew Lunn
<andrew+netdev@...n.ch>, "David S. Miller" <davem@...emloft.net>, "Eric
Dumazet" <edumazet@...gle.com>, Paolo Abeni <pabeni@...hat.com>, "Broadcom
internal kernel review list" <bcm-kernel-feedback-list@...adcom.com>,
Rafał Miłecki <rafal@...ecki.pl>, Sudarsana Kalluru
<skalluru@...vell.com>, Manish Chopra <manishc@...vell.com>, Doug Berger
<opendmb@...il.com>, Sabrina Dubroca <sd@...asysnail.net>,
Uwe Kleine-König <u.kleine-koenig@...libre.com>, open list
<linux-kernel@...r.kernel.org>
Subject: Re: [PATCH net-next] net: broadcom: use ethtool string helpers
On 10/29/2024 4:43 PM, Rosen Penev wrote:
> On Tue, Oct 29, 2024 at 4:03 PM Jakub Kicinski <kuba@...nel.org> wrote:
>>
>> On Tue, 22 Oct 2024 18:27:34 -0700 Rosen Penev wrote:
>>> @@ -3220,13 +3212,13 @@ static void bnx2x_get_strings(struct net_device *dev, u32 stringset, u8 *buf)
>>> start = 0;
>>> else
>>> start = 4;
>>> - memcpy(buf, bnx2x_tests_str_arr + start,
>>> - ETH_GSTRING_LEN * BNX2X_NUM_TESTS(bp));
>>> + for (i = start; i < BNX2X_NUM_TESTS(bp); i++)
>>> + ethtool_puts(&buf, bnx2x_tests_str_arr[i]);
>>
>> I don't think this is equivalent.
> What's wrong here?
I was trying to figure that out too...
I guess the memcpy does everything all at once and this does it via
iteration...?
memcpy would actually result in copying the padding between strings in
the bnx2x_tests_str_arr, while the ethtool_puts turns into strscpy which
doesn't pad the tail of the buffer with zeros?
>>
>> Also, please split bnx2x to a separate patch, the other drivers in this
>> patch IIUC are small embedded ones, the bnx2x is an "enterprise
>> product".
>> --
>> pw-bot: cr
Powered by blists - more mailing lists