diff options
author | Oleksij Rempel <o.rempel@pengutronix.de> | 2021-07-22 09:34:27 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-07-22 00:52:04 -0700 |
commit | 802a76affb09263ab6bca9a6ff4765b3a0c40137 (patch) | |
tree | 3734896aae283ac69af487853cca07b333c24948 /net | |
parent | 9c2670951ed03f8fc6c701d66f5c765929cf1f23 (diff) | |
download | lwn-802a76affb09263ab6bca9a6ff4765b3a0c40137.tar.gz lwn-802a76affb09263ab6bca9a6ff4765b3a0c40137.zip |
net: selftests: add MTU test
Test if we actually can send/receive packets with MTU size. This kind of
issue was detected on ASIX HW with bogus EEPROM.
Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/core/selftests.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/net/core/selftests.c b/net/core/selftests.c index ba7b0171974c..9077fa969892 100644 --- a/net/core/selftests.c +++ b/net/core/selftests.c @@ -318,6 +318,15 @@ static int net_test_phy_loopback_udp(struct net_device *ndev) return __net_test_loopback(ndev, &attr); } +static int net_test_phy_loopback_udp_mtu(struct net_device *ndev) +{ + struct net_packet_attrs attr = { }; + + attr.dst = ndev->dev_addr; + attr.max_size = ndev->mtu; + return __net_test_loopback(ndev, &attr); +} + static int net_test_phy_loopback_tcp(struct net_device *ndev) { struct net_packet_attrs attr = { }; @@ -345,6 +354,9 @@ static const struct net_test { .name = "PHY internal loopback, UDP ", .fn = net_test_phy_loopback_udp, }, { + .name = "PHY internal loopback, MTU ", + .fn = net_test_phy_loopback_udp_mtu, + }, { .name = "PHY internal loopback, TCP ", .fn = net_test_phy_loopback_tcp, }, { |