From: Nicolai Buchwitz <nb@tipi-net.de>
To: Jakub Kicinski <kuba@kernel.org>
Cc: Doug Berger <opendmb@gmail.com>,
Florian Fainelli <florian.fainelli@broadcom.com>,
Broadcom internal kernel review list
<bcm-kernel-feedback-list@broadcom.com>,
Andrew Lunn <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@kernel.org>,
Paolo Abeni <pabeni@redhat.com>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
Dave Stevenson <dave.stevenson@raspberrypi.com>,
Justin Chen <justin.chen@broadcom.com>,
Pierre-Marin Leclercq <pierremarinleclercq88@gmail.com>,
Florian Fainelli <f.fainelli@gmail.com>
Subject: Re: [PATCH net-next v5 7/8] net: bcmgenet: allow the MTU to be changed
Date: Sat, 17 Oct 2026 08:26:34 +0200 [thread overview]
Message-ID: <2304cd9afabc6f9e62d588b45b94015a@tipi-net.de> (raw)
In-Reply-To: <20261016182415.73f4f7e4@kernel.org>
On 17.10.2026 03:24, Jakub Kicinski wrote:
> 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.
Aye, I'll allocate the new rings before freeing the old ones, then a
failed MTU change just returns -ENOMEM and the rollback can go.
>
>> + priv->datapath_up = true;
>
> Hallmark of a bad design
Agreed, and redundant anyway once fini_dma() NULLs rx_cbs/tx_cbs. I have
a net series for that, on which I will rebuild this patch.
Thanks,
Nicolai
next prev parent reply other threads:[~2026-10-17 6:26 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-13 14:20 [PATCH net-next v5 0/8] net: bcmgenet: support larger MTUs Nicolai Buchwitz
2026-10-13 14:20 ` [PATCH net-next v5 1/8] net: bcmgenet: ring the doorbell when the last frame of a batch is dropped Nicolai Buchwitz
2026-10-13 14:20 ` [PATCH net-next v5 2/8] net: bcmgenet: let the caller decide whether to start the PHY Nicolai Buchwitz
2026-10-13 14:20 ` [PATCH net-next v5 3/8] net: bcmgenet: allow a continuation descriptor without the alignment pad Nicolai Buchwitz
2026-10-13 14:20 ` [PATCH net-next v5 4/8] net: bcmgenet: rename ENET_MAX_MTU_SIZE to ENET_MAX_FRAME_LEN Nicolai Buchwitz
2026-10-13 14:20 ` [PATCH net-next v5 5/8] net: bcmgenet: derive the receive buffer length from the MTU Nicolai Buchwitz
2026-10-13 14:20 ` [PATCH net-next v5 6/8] net: bcmgenet: pad transmit frames out of the packet ready window Nicolai Buchwitz
2026-10-14 14:22 ` netdev-bot+sashiko
2026-10-15 8:48 ` Nicolai Buchwitz
2026-10-17 1:25 ` Jakub Kicinski
2026-10-17 6:29 ` Nicolai Buchwitz
2026-10-13 14:20 ` [PATCH net-next v5 7/8] net: bcmgenet: allow the MTU to be changed Nicolai Buchwitz
2026-10-14 14:22 ` netdev-bot+sashiko
2026-10-15 8:55 ` Nicolai Buchwitz
2026-10-17 1:24 ` Jakub Kicinski
2026-10-17 6:26 ` Nicolai Buchwitz [this message]
2026-10-13 14:20 ` [PATCH net-next v5 8/8] net: bcmgenet: reassemble jumbo frames from status block fragments Nicolai Buchwitz
2026-10-14 14:22 ` netdev-bot+sashiko
2026-10-15 8:56 ` Nicolai Buchwitz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2304cd9afabc6f9e62d588b45b94015a@tipi-net.de \
--to=nb@tipi-net.de \
--cc=andrew+netdev@lunn.ch \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=dave.stevenson@raspberrypi.com \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=f.fainelli@gmail.com \
--cc=florian.fainelli@broadcom.com \
--cc=justin.chen@broadcom.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=opendmb@gmail.com \
--cc=pabeni@redhat.com \
--cc=pierremarinleclercq88@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox