Message ID | 20250203191057.46351-7-gerhard@engleder-embedded.com (mailing list archive) |
---|---|
State | Changes Requested |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | Support loopback mode speed selection | expand |
Hi Gerhard, kernel test robot noticed the following build warnings: [auto build test WARNING on net-next/main] url: https://github.com/intel-lab-lkp/linux/commits/Gerhard-Engleder/net-phy-Allow-loopback-speed-selection-for-PHY-drivers/20250204-041619 base: net-next/main patch link: https://lore.kernel.org/r/20250203191057.46351-7-gerhard%40engleder-embedded.com patch subject: [PATCH net-next v4 6/7] net: selftests: Export net_test_phy_loopback_* config: s390-randconfig-001-20250204 (https://download.01.org/0day-ci/archive/20250205/202502050234.kRVRQjkS-lkp@intel.com/config) compiler: s390-linux-gcc (GCC) 14.2.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250205/202502050234.kRVRQjkS-lkp@intel.com/reproduce) If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot <lkp@intel.com> | Closes: https://lore.kernel.org/oe-kbuild-all/202502050234.kRVRQjkS-lkp@intel.com/ All warnings (new ones prefixed by >>): In file included from drivers/net/ethernet/freescale/fec_main.c:42: >> include/net/selftests.h:30:12: warning: 'net_test_phy_loopback_tcp' defined but not used [-Wunused-function] 30 | static int net_test_phy_loopback_tcp(struct net_device *ndev) | ^~~~~~~~~~~~~~~~~~~~~~~~~ >> include/net/selftests.h:25:12: warning: 'net_test_phy_loopback_udp_mtu' defined but not used [-Wunused-function] 25 | static int net_test_phy_loopback_udp_mtu(struct net_device *ndev) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ vim +/net_test_phy_loopback_tcp +30 include/net/selftests.h 24 > 25 static int net_test_phy_loopback_udp_mtu(struct net_device *ndev) 26 { 27 return 0; 28 } 29 > 30 static int net_test_phy_loopback_tcp(struct net_device *ndev) 31 { 32 return 0; 33 } 34
diff --git a/include/net/selftests.h b/include/net/selftests.h index e65e8d230d33..38459af4962b 100644 --- a/include/net/selftests.h +++ b/include/net/selftests.h @@ -6,6 +6,10 @@ #if IS_ENABLED(CONFIG_NET_SELFTESTS) +int net_test_phy_loopback_udp(struct net_device *ndev); +int net_test_phy_loopback_udp_mtu(struct net_device *ndev); +int net_test_phy_loopback_tcp(struct net_device *ndev); + void net_selftest(struct net_device *ndev, struct ethtool_test *etest, u64 *buf); int net_selftest_get_count(void); @@ -13,6 +17,21 @@ void net_selftest_get_strings(u8 *data); #else +static inline int net_test_phy_loopback_udp(struct net_device *ndev) +{ + return 0; +} + +static int net_test_phy_loopback_udp_mtu(struct net_device *ndev) +{ + return 0; +} + +static int net_test_phy_loopback_tcp(struct net_device *ndev) +{ + return 0; +} + static inline void net_selftest(struct net_device *ndev, struct ethtool_test *etest, u64 *buf) { diff --git a/net/core/selftests.c b/net/core/selftests.c index e99ae983fca9..d4e0e2eff991 100644 --- a/net/core/selftests.c +++ b/net/core/selftests.c @@ -310,15 +310,16 @@ static int net_test_phy_loopback_disable(struct net_device *ndev) return phy_loopback(ndev->phydev, false, 0); } -static int net_test_phy_loopback_udp(struct net_device *ndev) +int net_test_phy_loopback_udp(struct net_device *ndev) { struct net_packet_attrs attr = { }; attr.dst = ndev->dev_addr; return __net_test_loopback(ndev, &attr); } +EXPORT_SYMBOL_GPL(net_test_phy_loopback_udp); -static int net_test_phy_loopback_udp_mtu(struct net_device *ndev) +int net_test_phy_loopback_udp_mtu(struct net_device *ndev) { struct net_packet_attrs attr = { }; @@ -326,8 +327,9 @@ static int net_test_phy_loopback_udp_mtu(struct net_device *ndev) attr.max_size = ndev->mtu; return __net_test_loopback(ndev, &attr); } +EXPORT_SYMBOL_GPL(net_test_phy_loopback_udp_mtu); -static int net_test_phy_loopback_tcp(struct net_device *ndev) +int net_test_phy_loopback_tcp(struct net_device *ndev) { struct net_packet_attrs attr = { }; @@ -335,6 +337,7 @@ static int net_test_phy_loopback_tcp(struct net_device *ndev) attr.tcp = true; return __net_test_loopback(ndev, &attr); } +EXPORT_SYMBOL_GPL(net_test_phy_loopback_tcp); static const struct net_test { char name[ETH_GSTRING_LEN];
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. Export net_test_phy_loopback_* to enable reuse in existing selftests of other drivers. This also enables driver specific loopback modes, which don't rely on an existing link. Signed-off-by: Gerhard Engleder <gerhard@engleder-embedded.com> CC: Oleksij Rempel <o.rempel@pengutronix.de> --- include/net/selftests.h | 19 +++++++++++++++++++ net/core/selftests.c | 9 ++++++--- 2 files changed, 25 insertions(+), 3 deletions(-)