ramips: ethernet: ralink: mtu change while interface is down
fe_change_mtu didn't update the registers if the interface was down. DSA increases the CPU port MTU to accommodate the CPU tag. As this happens while the CPU port was still down, the chip regs didn't get updated and larger frames were dropped. Signed-off-by: Luiz Angelo Daros de Luca <luizluca@gmail.com> Link: https://github.com/openwrt/openwrt/pull/23933 Signed-off-by: Robert Marko <robimarko@gmail.com>
This commit is contained in:
committed by
Robert Marko
parent
a24bdc2e9f
commit
84aafc08d7
@@ -1452,10 +1452,9 @@ static int fe_change_mtu(struct net_device *dev, int new_mtu)
|
||||
priv->rx_ring.frag_size = PAGE_SIZE;
|
||||
priv->rx_ring.rx_buf_size = fe_max_buf_size(priv->rx_ring.frag_size);
|
||||
|
||||
if (!netif_running(dev))
|
||||
return 0;
|
||||
if (netif_running(dev))
|
||||
fe_stop(dev);
|
||||
|
||||
fe_stop(dev);
|
||||
if (!IS_ENABLED(CONFIG_SOC_MT7621)) {
|
||||
fwd_cfg = fe_r32(DMA_FWD_REG);
|
||||
if (new_mtu <= ETH_DATA_LEN) {
|
||||
@@ -1469,7 +1468,10 @@ static int fe_change_mtu(struct net_device *dev, int new_mtu)
|
||||
fe_w32(fwd_cfg, DMA_FWD_REG);
|
||||
}
|
||||
|
||||
return fe_open(dev);
|
||||
if (netif_running(dev))
|
||||
return fe_open(dev);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const struct net_device_ops fe_netdev_ops = {
|
||||
|
||||
Reference in New Issue
Block a user