Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp324577pxv; Thu, 22 Jul 2021 00:35:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwKf7knP9h75AYKTwob0b6usxUKptEyZLkzHT+v7i1VJO3/l9Oq+9mnSHVumVxyBJ2ltePZ X-Received: by 2002:a6b:1497:: with SMTP id 145mr29829039iou.128.1626939358006; Thu, 22 Jul 2021 00:35:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626939357; cv=none; d=google.com; s=arc-20160816; b=UvDgjSaTQwnpjODvlvwUA9VrjeC544Ha+8fZm2eWZYxlIIgrVUhLJn5DfjEJyJpddH GhW/Xx+h55ivcAaXMX3xvA0dEWDmijXlUcWmpRdtJZjgiaiWzX00ZTBQ587zxDCwHOK0 Gjj6q9jJnmi2iArKB8LrqcFdWPdznF9GkzWzxA3+/LKhSGdwsweMek6kExJkBSW3L6d1 OIjfk7H3dQdCQ96aEZz27tDrExGvQ5SA+VPzqePfas2ZG/OJknA1MTBnZWK7wXonOHU9 jmW7XEfzs+gQEscdUhu4jV3RkJBXaJk6yeflyLx0xoBXm925fpuBf/kAmRdw1KogJu3M xaMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=ob4HZm78nIDVs2r74Q6yw9Zwl86YT/WCuISL4m8or2A=; b=OiND0ecm+iBjeziIRZ74dxk3RhDB7S7AP9BQZglbaaf0XMiEzHbsnVMFH3QkgDIAt/ +Dj0maj7lvF9WB1WQUhCabii1TsPj64eCWorg6OSzWGIpnQUNg5mv0gfHTP7jAjTL0ua bw32YNKAVxuZfiAVKo6zQncLw+sTGcO0zf9prxIZ89eiqLpsO9MrR9UPJeiejO7KZ7nq RjCU6oT1hL7JG1ma1/RGdhhtV1u5ArYtcYMxzwC2VzynUVVhV2YiRMLGCn09aaMmV4L4 8q0jn9C6pWktae1fEI1wmE7OoXZ+xGYpz/8kFU3BAlmE/vPf6/1nkFh/6I21frKhfuHJ U72w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m1si33204407ilu.13.2021.07.22.00.35.46; Thu, 22 Jul 2021 00:35:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230520AbhGVGyA (ORCPT + 99 others); Thu, 22 Jul 2021 02:54:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35072 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230137AbhGVGyA (ORCPT ); Thu, 22 Jul 2021 02:54:00 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8AC2BC061575 for ; Thu, 22 Jul 2021 00:34:35 -0700 (PDT) Received: from dude.hi.pengutronix.de ([2001:67c:670:100:1d::7]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m6TDx-0004Qa-OG; Thu, 22 Jul 2021 09:34:29 +0200 Received: from ore by dude.hi.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1m6TDw-0006ut-QU; Thu, 22 Jul 2021 09:34:28 +0200 From: Oleksij Rempel To: Shawn Guo , Sascha Hauer , Andrew Lunn , Florian Fainelli , Heiner Kallweit , Fugang Duan Cc: Oleksij Rempel , kernel@pengutronix.de, netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-imx@nxp.com, Fabio Estevam , David Jander , Russell King , Philippe Schenker Subject: [PATCH net-next v1 1/1] net: selftests: add MTU test Date: Thu, 22 Jul 2021 09:34:27 +0200 Message-Id: <20210722073427.26537-1-o.rempel@pengutronix.de> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::7 X-SA-Exim-Mail-From: ore@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- net/core/selftests.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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 = { }; @@ -344,6 +353,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, -- 2.30.2