[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b18971f2-0edf-4fa7-be1b-eec8392665f0@engleder-embedded.com>
Date: Wed, 12 Feb 2025 21:13:50 +0100
From: Gerhard Engleder <gerhard@...leder-embedded.com>
To: Andrew Lunn <andrew@...n.ch>
Cc: hkallweit1@...il.com, linux@...linux.org.uk, davem@...emloft.net,
edumazet@...gle.com, kuba@...nel.org, pabeni@...hat.com,
netdev@...r.kernel.org, Oleksij Rempel <o.rempel@...gutronix.de>
Subject: Re: [PATCH net-next v6 6/7] net: selftests: Export
net_test_phy_loopback_*
On 12.02.25 03:23, Andrew Lunn wrote:
> On Sun, Feb 09, 2025 at 08:08:26PM +0100, Gerhard Engleder wrote:
>> net_selftests() provides a generic set of selftests for netdevs with
>> PHY. Those selftests rely on an existing link to inherit the speed for
>> the loopback mode.
>>
>> net_selftests() is not designed to extend existing selftests of drivers,
>> but with net_test_phy_loopback_* it contains useful test infrastructure.
>
> It might not of originally been designed for that, but i think it can
> be used as an extension. I've done the same for statistics, which uses
> the same API.
>
> For get_sset_count() you call net_selftest_get_count() and then add on
> the number of driver specific tests. For ethtool_get_strings() first
> call net_selftest_get_strings() and then append the driver tests
> afterwards. For self_test, first call net_selftest() and then do the
> driver specific tests.
>
> I also think you can extend these tests to cover different speeds.
> There are plenty of ethtool_test_flags bit free, so you can use one of
> them to indicate the reserved value in ethtool_test contains a speed.
> Everybody then gains from your work.
Reusing the complete test set as extension is not feasible as the first
test requires an existing link and for loopback test no link is
necessary. But yes, I can do better and rework it to reusable tests.
I'm not sure if I will use ethtool_test_flags as IMO ideally all tests
run always to ensure easy use.
Thank you for the review!
Gerhard
Powered by blists - more mailing lists