Re: [PATCH net-next v5 7/8] net: bcmgenet: allow the MTU to be changed
From: Jakub Kicinski
Date: Fri Oct 16 2026 - 21:24:37 EST
On Tue, 13 Oct 2026 16:20:36 +0200 Nicolai Buchwitz wrote:
> + ret = bcmgenet_init_dma(priv, true);
> + if (ret) {
> + /* Retry the size that was allocated a moment ago */
> + WRITE_ONCE(dev->mtu, old_mtu);
> + priv->rx_buf_len = bcmgenet_rx_buf_len(old_mtu);
> + bcmgenet_set_mtu_regs(priv, old_mtu);
> + if (bcmgenet_init_dma(priv, true)) {
This will fail under memory pressure leaving the device inoperable.
> + priv->datapath_up = true;
Hallmark of a bad design