Skip to content

Commit 3e1e58d

Browse files
oleremdavem330
authored andcommitted
net: add generic selftest support
Port some parts of the stmmac selftest and reuse it as basic generic selftest library. This patch was tested with following combinations: - iMX6DL FEC -> AT8035 - iMX6DL FEC -> SJA1105Q switch -> KSZ8081 - iMX6DL FEC -> SJA1105Q switch -> KSZ9031 - AR9331 ag71xx -> AR9331 PHY - AR9331 ag71xx -> AR9331 switch -> AR9331 PHY Signed-off-by: Oleksij Rempel <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 014068d commit 3e1e58d

File tree

4 files changed

+417
-0
lines changed

4 files changed

+417
-0
lines changed

include/net/selftests.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/* SPDX-License-Identifier: GPL-2.0 */
2+
#ifndef _NET_SELFTESTS
3+
#define _NET_SELFTESTS
4+
5+
#include <linux/ethtool.h>
6+
7+
void net_selftest(struct net_device *ndev, struct ethtool_test *etest,
8+
u64 *buf);
9+
int net_selftest_get_count(void);
10+
void net_selftest_get_strings(u8 *data);
11+
12+
#endif /* _NET_SELFTESTS */

net/Kconfig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -429,6 +429,10 @@ config GRO_CELLS
429429
config SOCK_VALIDATE_XMIT
430430
bool
431431

432+
config NET_SELFTESTS
433+
def_tristate PHYLIB
434+
depends on PHYLIB
435+
432436
config NET_SOCK_MSG
433437
bool
434438
default n

net/core/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ obj-$(CONFIG_NET_DEVLINK) += devlink.o
3333
obj-$(CONFIG_GRO_CELLS) += gro_cells.o
3434
obj-$(CONFIG_FAILOVER) += failover.o
3535
ifeq ($(CONFIG_INET),y)
36+
obj-$(CONFIG_NET_SELFTESTS) += selftests.o
3637
obj-$(CONFIG_NET_SOCK_MSG) += skmsg.o
3738
obj-$(CONFIG_BPF_SYSCALL) += sock_map.o
3839
endif

0 commit comments

Comments
 (0)