Adjusted mtu validation disabling patch in rockchip64 (for kernel 5.10.10+)

This commit is contained in:
Piotr Szczepanik 2021-01-23 22:14:01 +01:00
parent 438563b665
commit 5bc190864e
No known key found for this signature in database
GPG key ID: 0305358EB314F205
2 changed files with 6 additions and 6 deletions

View file

@ -2,7 +2,6 @@ This patch reverts: https://github.com/torvalds/linux/commit/eaf4fac478077d4ed57
It works around following issues:
- no way to change MTU (tx_fifo_size is reported as 0 for Rockchip's dwmac)
- no way to set MTU of 1500 (it is aligned to 1536)
Signed-off-by: Piotr Szczepanik <piter75@gmail.com>
@ -10,11 +9,12 @@ diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/eth
index 122a06972..951d2281f 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -3961,24 +3961,12 @@ static void stmmac_set_rx_mode(struct net_device *dev)
@@ -3961,25 +3961,13 @@ 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;
@ -32,6 +32,6 @@ index 122a06972..951d2281f 100644
- if ((txfifosz < new_mtu) || (new_mtu > BUF_SIZE_16KiB))
- return -EINVAL;
-
dev->mtu = new_mtu;
dev->mtu = mtu;
netdev_update_features(dev);

View file

@ -2,7 +2,6 @@ This patch reverts: https://github.com/torvalds/linux/commit/eaf4fac478077d4ed57
It works around following issues:
- no way to change MTU (tx_fifo_size is reported as 0 for Rockchip's dwmac)
- no way to set MTU of 1500 (it is aligned to 1536)
Signed-off-by: Piotr Szczepanik <piter75@gmail.com>
@ -10,11 +9,12 @@ diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/eth
index 122a06972..951d2281f 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -3961,24 +3961,12 @@ static void stmmac_set_rx_mode(struct net_device *dev)
@@ -3961,25 +3961,13 @@ 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;
@ -32,6 +32,6 @@ index 122a06972..951d2281f 100644
- if ((txfifosz < new_mtu) || (new_mtu > BUF_SIZE_16KiB))
- return -EINVAL;
-
dev->mtu = new_mtu;
dev->mtu = mtu;
netdev_update_features(dev);