[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210129195240.31871-4-TheSven73@gmail.com>
Date: Fri, 29 Jan 2021 14:52:37 -0500
From: Sven Van Asbroeck <thesven73@...il.com>
To: Bryan Whitehead <bryan.whitehead@...rochip.com>,
UNGLinuxDriver@...rochip.com, David S Miller <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>
Cc: Sven Van Asbroeck <thesven73@...il.com>,
Andrew Lunn <andrew@...n.ch>,
Alexey Denisov <rtgbnm@...il.com>,
Sergej Bauer <sbauer@...ckbox.su>,
Tim Harvey <tharvey@...eworks.com>,
Anders Rønningen <anders@...ningen.priv.no>,
netdev@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH net-next v1 3/6] lan743x: allow mtu change while network interface is up
From: Sven Van Asbroeck <thesven73@...il.com>
Now that we can use rx ring buffers smaller than the mtu,
we allow users to change the mtu on the fly.
Tested as follows:
Tests with debug logging enabled (add #define DEBUG).
1. Set the chip mtu to 1500, generate lots of network traffic.
Stop all network traffic.
Set the chip and remote mtus to 8000.
Ping remote -> chip: $ ping <chip ip> -s 7000
Verify that the first few received packets are multi-buffer.
Verify no pings are dropped.
Tests with DEBUG_KMEMLEAK on:
$ mount -t debugfs nodev /sys/kernel/debug/
$ echo scan > /sys/kernel/debug/kmemleak
2. Start with chip mtu at 1500, host mtu at 8000.
Run concurrently:
- iperf3 -s on chip
- ping -> chip
Cycle the chip mtu between 1500 and 8000 every 10 seconds.
Scan kmemleak periodically to watch for memory leaks.
Verify that the mtu changeover happens smoothly, i.e.
the iperf3 test does not report periods where speed
drops and recovers suddenly.
Note: iperf3 occasionally reports dropped packets on
changeover. This behaviour also occurs on the original
driver, it's not a regression. Possibly related to the
chip's mac rx being disabled when the mtu is changed.
Signed-off-by: Sven Van Asbroeck <thesven73@...il.com>
---
Tree: git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git # 46eb3c108fe1
To: Bryan Whitehead <bryan.whitehead@...rochip.com>
To: UNGLinuxDriver@...rochip.com
To: "David S. Miller" <davem@...emloft.net>
To: Jakub Kicinski <kuba@...nel.org>
Cc: Andrew Lunn <andrew@...n.ch>
Cc: Alexey Denisov <rtgbnm@...il.com>
Cc: Sergej Bauer <sbauer@...ckbox.su>
Cc: Tim Harvey <tharvey@...eworks.com>
Cc: Anders Rønningen <anders@...ningen.priv.no>
Cc: netdev@...r.kernel.org
Cc: linux-kernel@...r.kernel.org (open list)
drivers/net/ethernet/microchip/lan743x_main.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/drivers/net/ethernet/microchip/lan743x_main.c b/drivers/net/ethernet/microchip/lan743x_main.c
index b784e9feadac..618f0714a2cf 100644
--- a/drivers/net/ethernet/microchip/lan743x_main.c
+++ b/drivers/net/ethernet/microchip/lan743x_main.c
@@ -2597,9 +2597,6 @@ static int lan743x_netdev_change_mtu(struct net_device *netdev, int new_mtu)
struct lan743x_adapter *adapter = netdev_priv(netdev);
int ret = 0;
- if (netif_running(netdev))
- return -EBUSY;
-
ret = lan743x_mac_set_mtu(adapter, new_mtu);
if (!ret)
netdev->mtu = new_mtu;
--
2.17.1
Powered by blists - more mailing lists