[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <563f3f1b-985f-4a9e-a32c-cb8e9b6af43a@bootlin.com>
Date: Tue, 21 Oct 2025 11:32:06 +0200
From: Maxime Chevallier <maxime.chevallier@...tlin.com>
To: Andrew Lunn <andrew@...n.ch>
Cc: Raju Rangoju <Raju.Rangoju@....com>, netdev@...r.kernel.org,
pabeni@...hat.com, kuba@...nel.org, edumazet@...gle.com,
davem@...emloft.net, andrew+netdev@...n.ch, Shyam-sundar.S-k@....com
Subject: Re: [PATCH net-next v3 2/4] amd-xgbe: add ethtool phy selftest
On 20/10/2025 21:07, Andrew Lunn wrote:
> On Mon, Oct 20, 2025 at 06:19:55PM +0200, Maxime Chevallier wrote:
>> Hi Raju,
>>
>> On 20/10/2025 17:22, Raju Rangoju wrote:
>>> Adds support for ethtool PHY loopback selftest. It uses
>>> genphy_loopback function, which use BMCR loopback bit to
>>> enable or disable loopback.
>>>
>>> Signed-off-by: Raju Rangoju <Raju.Rangoju@....com>
>>
>> This all looks a lot like the stmmac selftests, hopefully one day
>> we can extract that logic into a more generic selftest framework
>> for all drivers to use.
>
> https://elixir.bootlin.com/linux/v6.17.3/source/net/core/selftests.c#L441
>
> Sorry, not looked at the patch to see if this is relevant for this
> driver. But we do have a generic selftest framework...
>
> Andrew
Ah ! And this also looks like this driver code. It seems to me that the
main diffence that the amd-xgbe selftest brings is the ability to
fallback to MAC-side loopback should PHY loopback fails, so they don't
1:1 map to these, but we could consider extending the existing selftests.
Besides that it seems that the generic selftest are more efficient wrt
how they deal with PHY loopback, as they don't re-configure it for each
selftest.
I don't necessarly think this series should be reworked but this is
starting to be a lot of code duplication.
Raju, maybe you can re-use at least the generic packet generation
functions (i.e net_tst_get_skb() ) ?
Maxime
Powered by blists - more mailing lists