From: Nicolai Buchwitz <nb@tipi-net.de>
To: Jakub Kicinski <kuba@kernel.org>
Cc: "Théo Lebrun" <theo.lebrun@bootlin.com>,
nicolas.ferre@microchip.com, claudiu.beznea@tuxon.dev,
andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@google.com,
pabeni@redhat.com, netdev@vger.kernel.org
Subject: Re: [PATCH net-next] net: macb: allow MTU changes while the interface is running
Date: Tue, 17 Mar 2026 23:58:21 +0100 [thread overview]
Message-ID: <1aae7cf5906c753c0ff5356b8e1f53e2@tipi-net.de> (raw)
In-Reply-To: <20260317152330.32998fdd@kernel.org>
On 17.3.2026 23:23, Jakub Kicinski wrote:
> On Tue, 17 Mar 2026 18:00:02 +0100 Théo Lebrun wrote:
>> Reviewed-by: Théo Lebrun <theo.lebrun@bootlin.com>
>
> I told you recently that open / close is not allowed.
> So why are you putting a rb tag on a patch which does exactly that?
>
> https://lore.kernel.org/all/20260306190948.44d23f8f@kernel.org/
Just checking if I got the idea before submitting another approach.
Something like:
static int macb_change_mtu(struct net_device *dev, int new_mtu)
{
// declarations
// ...
if (!netif_running(dev)) {
WRITE_ONCE(dev->mtu, new_mtu);
return 0;
}
// stop TX + NAPI
// ...
// stop MAC (macb_reset_hw), no phylink/PHY/PM touch
// ...
macb_free_consistent(bp);
WRITE_ONCE(dev->mtu, new_mtu);
macb_init_rx_buffer_size(bp, bufsz);
err = macb_alloc_consistent(bp);
if (err) {
// device is down, no DMA buffers - same as igb
return err;
}
// init rings, init HW, re-enable NAPI + TX
// ...
return 0;
}
On alloc failure the device would be left stopped, same as
igb_change_mtu() does it. Or would you prefer stmmac-style
pre-allocation?
That would mean refactoring macb_alloc_consistent() to return a separate
resource set.
Thanks
Nicolai
next prev parent reply other threads:[~2026-03-17 22:58 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-16 9:27 [PATCH net-next] net: macb: allow MTU changes while the interface is running Nicolai Buchwitz
2026-03-17 17:00 ` Théo Lebrun
2026-03-17 19:31 ` Nicolai Buchwitz
2026-03-17 22:23 ` Jakub Kicinski
2026-03-17 22:58 ` Nicolai Buchwitz [this message]
2026-03-17 23:23 ` Jakub Kicinski
2026-03-18 9:53 ` Théo Lebrun
2026-03-18 11:25 ` Nicolai Buchwitz
2026-03-18 14:33 ` Théo Lebrun
2026-03-18 22:13 ` Jakub Kicinski
2026-03-17 19:42 ` Breno Leitao
2026-03-17 19:47 ` Breno Leitao
2026-03-17 20:11 ` Nicolai Buchwitz
2026-03-17 20:04 ` 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=1aae7cf5906c753c0ff5356b8e1f53e2@tipi-net.de \
--to=nb@tipi-net.de \
--cc=andrew+netdev@lunn.ch \
--cc=claudiu.beznea@tuxon.dev \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=nicolas.ferre@microchip.com \
--cc=pabeni@redhat.com \
--cc=theo.lebrun@bootlin.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