From bf80eaa34a1b9f503a779b13deed2fda642a1e87 Mon Sep 17 00:00:00 2001 From: Igor Pecovnik Date: Wed, 21 Jul 2021 20:59:39 +0000 Subject: [PATCH] Disable MTU validation This patch reverts: https://github.com/torvalds/linux/commit/eaf4fac478077d4ed57cbca2c044c4b58a96bd98 It works around following issues: - no way to change MTU (tx_fifo_size is reported as 0 for Rockchip's dwmac) Signed-off-by: Piotr Szczepanik Signed-off-by: Igor Pecovnik --- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index 91cd5073d..b409a7598 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -5435,14 +5435,8 @@ static void stmmac_set_rx_mode(struct net_device *dev) static int stmmac_change_mtu(struct net_device *dev, int new_mtu) { struct stmmac_priv *priv = netdev_priv(dev); - int txfifosz = priv->plat->tx_fifo_size; const int mtu = new_mtu; - if (txfifosz == 0) - txfifosz = priv->dma_cap.tx_fifo_size; - - txfifosz /= priv->plat->tx_queues_to_use; - if (netif_running(dev)) { netdev_err(priv->dev, "must be stopped to change its MTU\n"); return -EBUSY; @@ -5453,12 +5447,6 @@ static int stmmac_change_mtu(struct net_device *dev, int new_mtu) return -EINVAL; } - new_mtu = STMMAC_ALIGN(new_mtu); - - /* If condition true, FIFO is too small or MTU too large */ - if ((txfifosz < new_mtu) || (new_mtu > BUF_SIZE_16KiB)) - return -EINVAL; - dev->mtu = mtu; netdev_update_features(dev); -- Created with Armbian build tools https://github.com/armbian/build