All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ansuel Smith <ansuelsmth@gmail.com>
To: Jakub Kicinski <kuba@kernel.org>
Cc: Giuseppe Cavallaro <peppe.cavallaro@st.com>,
	Alexandre Torgue <alexandre.torgue@foss.st.com>,
	Jose Abreu <joabreu@synopsys.com>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Paolo Abeni <pabeni@redhat.com>,
	Maxime Coquelin <mcoquelin.stm32@gmail.com>,
	netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [net-next PATCH] net: ethernet: stmicro: stmmac: permit MTU change with interface up
Date: Thu, 16 Jun 2022 14:04:03 +0200	[thread overview]
Message-ID: <62ab1c35.1c69fb81.9ea8e.2cb0@mx.google.com> (raw)
In-Reply-To: <20220615195507.52ee19df@kernel.org>

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

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

WARNING: multiple messages have this Message-ID (diff)
From: Ansuel Smith <ansuelsmth@gmail.com>
To: Jakub Kicinski <kuba@kernel.org>
Cc: Giuseppe Cavallaro <peppe.cavallaro@st.com>,
	Alexandre Torgue <alexandre.torgue@foss.st.com>,
	Jose Abreu <joabreu@synopsys.com>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Paolo Abeni <pabeni@redhat.com>,
	Maxime Coquelin <mcoquelin.stm32@gmail.com>,
	netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [net-next PATCH] net: ethernet: stmicro: stmmac: permit MTU change with interface up
Date: Thu, 16 Jun 2022 14:04:03 +0200	[thread overview]
Message-ID: <62ab1c35.1c69fb81.9ea8e.2cb0@mx.google.com> (raw)
In-Reply-To: <20220615195507.52ee19df@kernel.org>

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

  reply	other threads:[~2022-06-16 12:05 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-14 22:41 [net-next PATCH] net: ethernet: stmicro: stmmac: permit MTU change with interface up Christian 'Ansuel' Marangi
2022-06-14 22:41 ` Christian 'Ansuel' Marangi
2022-06-16  2:55 ` Jakub Kicinski
2022-06-16  2:55   ` Jakub Kicinski
2022-06-16 12:04   ` Ansuel Smith [this message]
2022-06-16 12:04     ` Ansuel Smith

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=62ab1c35.1c69fb81.9ea8e.2cb0@mx.google.com \
    --to=ansuelsmth@gmail.com \
    --cc=alexandre.torgue@foss.st.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=joabreu@synopsys.com \
    --cc=kuba@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-stm32@st-md-mailman.stormreply.com \
    --cc=mcoquelin.stm32@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=peppe.cavallaro@st.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.