RE: [PATCH net-next v9 09/11] onsemi: s2500: Added selftest support to onsemi's S2500 driver
From: Selvamani Rajagopal
Date: Mon Oct 19 2026 - 20:58:50 EST
> -----Original Message-----
> From: netdev-bot+sashiko@xxxxxxxxxx <netdev-bot+sashiko@xxxxxxxxxx>
> Sent: Saturday, October 10, 2026 12:40 PM
> To: Selvamani Rajagopal <Selvamani.Rajagopal@xxxxxxxxxx>
> Subject: Re: [PATCH net-next v9 09/11] onsemi: s2500: Added selftest support to onsemi's S2500 driver
>
>
> Critical: 0 · High: 0 · Medium: 1 · Low: 0
>
> - [Medium] When CONFIG_NET_SELFTESTS=n, s2500_get_sset_count() returns 0
> for ETH_SS_TEST, because the include/net/selftests.h stub…
>
>
> Can this configuration actually be built? NET_SELFTESTS depends on
> PHYLIB && INET. S2500_MACPHY only uses imply for it and has no INET
> dependency:
>
> config S2500_MACPHY
> tristate "S2500 support"
> depends on SPI
> depends on PTP_1588_CLOCK_OPTIONAL
> imply NET_SELFTESTS
>
> With CONFIG_INET=n, the driver can be built while NET_SELFTESTS=n.
>
> A few existing drivers (fec, ag71xx, asix, lan78xx, smsc95xx) follow
> the same pattern.
>
> Would any of these fixes work here?
Though this sound like convincing argument, I looked at other code that used "imply NET_SELFTESTS"
It has neither INET dependency not initializing net_selftest callback conditionally. Even If we want to fix,
It should be fixed in other places, which would expand the scope of this. I would rather not to incorporate
the suggested change.
>
> - return -EOPNOTSUPP for ETH_SS_TEST when net_selftest_get_count()
> is 0
> - set .self_test only under IS_ENABLED(CONFIG_NET_SELFTESTS)
> - add a dependency on NET_SELFTESTS, and therefore on INET
>
> [ ... ]
>