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>
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) {
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 = {