[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <62ab1c35.1c69fb81.9ea8e.2cb0@mx.google.com>
Date: Thu, 16 Jun 2022 14:04:03 +0200
From: Ansuel Smith <ansuelsmth@...il.com>
To: Jakub Kicinski <kuba@...nel.org>
Cc: Giuseppe Cavallaro <peppe.cavallaro@...com>,
Alexandre Torgue <alexandre.torgue@...s.st.com>,
Jose Abreu <joabreu@...opsys.com>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Paolo Abeni <pabeni@...hat.com>,
Maxime Coquelin <mcoquelin.stm32@...il.com>,
netdev@...r.kernel.org, linux-stm32@...md-mailman.stormreply.com,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [net-next PATCH] net: ethernet: stmicro: stmmac: permit MTU
change with interface up
On Wed, Jun 15, 2022 at 07:55:07PM -0700, Jakub Kicinski wrote:
> On Wed, 15 Jun 2022 00:41:41 +0200 Christian 'Ansuel' Marangi wrote:
> > + if (netif_running(dev)) {
> > + netdev_dbg(priv->dev, "restarting interface to change its MTU\n");
> > + stmmac_release(dev);
> > +
> > + stmmac_open(dev);
> > + stmmac_set_filter(priv, priv->hw, dev);
>
> What if stmmac_open() fails because the memory is low or is fragmented?
>
> You'd need to invest more effort into this change and try to allocate
> all the resources before shutting the device down.
Well what I'm doing here is following what is done with other similar
function in stmmac. For example the reinit_queues and reinit_ringparam
doesn't do such check.
But ok you are right, will see a good solution to change stmmac_open to
preallocate the buffers.
--
Ansuel
Powered by blists - more mailing lists