linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: Jose.Abreu@synopsys.com
Cc: netdev@vger.kernel.org, Joao.Pinto@synopsys.com,
	peppe.cavallaro@st.com, alexandre.torgue@st.com,
	mcoquelin.stm32@gmail.com,
	linux-stm32@st-md-mailman.stormreply.com,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH net 4/9] net: stmmac: selftests: Must remove UC/MC addresses to prevent false positives
Date: Wed, 30 Oct 2019 14:52:34 -0700 (PDT)	[thread overview]
Message-ID: <20191030.145234.1629187794527849559.davem@davemloft.net> (raw)
In-Reply-To: <36d9af9080068c4e38cf50e80b6f2a5eafc9ed99.1572355609.git.Jose.Abreu@synopsys.com>

From: Jose Abreu <Jose.Abreu@synopsys.com>
Date: Tue, 29 Oct 2019 15:14:48 +0100

> @@ -499,9 +501,18 @@ static int stmmac_test_hfilt(struct stmmac_priv *priv)
>  	if (netdev_mc_count(priv->dev) >= priv->hw->multicast_filter_bins)
>  		return -EOPNOTSUPP;

This test above...

> +	dummy_dev = alloc_etherdev(0);
> +	if (!dummy_dev)
> +		return -ENOMEM;
> +
> +	/* Remove all MC addresses */
> +	netdev_for_each_mc_addr(ha, priv->dev)
> +		dev_mc_add(dummy_dev, ha->addr);
> +	dev_mc_flush(priv->dev);

No longer makes any sense now that you're removing all of the MC
addresses.

Also I know it seems that it should be guaranteed that re-adding all of
the previously configured MC addresses should succeed.  But I am always
wary when I see error codes ignored like this.

This test makes destructure changes to the device's configuration,
perhaps in a non-restorable fashion if errors occur re-adding the MC
list entries.

Running a test should never even remotely introduce a change in the
device state like that.

I really don't like this, to be honest.  I'd hate to be the user who
had this somehow trigger on them and then have to diagnose it. :-/


  reply	other threads:[~2019-10-30 21:52 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-29 14:14 [PATCH net 0/9] net: stmmac: Fixes for -net Jose Abreu
2019-10-29 14:14 ` [PATCH net 1/9] net: stmmac: Fix sparse warning Jose Abreu
2019-10-29 14:14 ` [PATCH net 2/9] net: stmmac: gmac4: bitrev32 returns u32 Jose Abreu
2019-10-29 14:14 ` [PATCH net 3/9] net: stmmac: xgmac: " Jose Abreu
2019-10-29 14:14 ` [PATCH net 4/9] net: stmmac: selftests: Must remove UC/MC addresses to prevent false positives Jose Abreu
2019-10-30 21:52   ` David Miller [this message]
2019-10-29 14:14 ` [PATCH net 5/9] net: stmmac: xgmac: Only get SPH header len if available Jose Abreu
2019-10-29 14:28   ` Jose Abreu
2019-10-29 14:14 ` [PATCH net 6/9] net: stmmac: xgmac: Fix TSA selection Jose Abreu
2019-10-29 14:14 ` [PATCH net 7/9] net: stmmac: xgmac: Fix AV Feature detection Jose Abreu
2019-10-29 14:14 ` [PATCH net 8/9] net: stmmac: xgmac: Disable Flow Control when 1 or more queues are in AV Jose Abreu
2019-10-29 14:14 ` [PATCH net 9/9] net: stmmac: xgmac: Disable MMC interrupts by default Jose Abreu

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=20191030.145234.1629187794527849559.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=Joao.Pinto@synopsys.com \
    --cc=Jose.Abreu@synopsys.com \
    --cc=alexandre.torgue@st.com \
    --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=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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).