netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: baruch@tkos.co.il
Cc: mw@semihalf.com, netdev@vger.kernel.org,
	thomas.petazzoni@free-electrons.com,
	gregory.clement@free-electrons.com
Subject: Re: [PATCH 1/2] net: mvpp2: don't bring up on MAC address set
Date: Thu, 10 Nov 2016 11:57:18 -0500 (EST)	[thread overview]
Message-ID: <20161110.115718.1744727306693534849.davem@davemloft.net> (raw)
In-Reply-To: <ff17831771f3575f351c134703d3f153485b01c0.1478696194.git.baruch@tkos.co.il>

From: Baruch Siach <baruch@tkos.co.il>
Date: Wed,  9 Nov 2016 14:56:33 +0200

> Current .ndo_set_mac_address implementation brings up the interface when revert
> to original address after failure succeeds. Fix this.
> 
> Signed-off-by: Baruch Siach <baruch@tkos.co.il>
> ---
> Untested; I don't have the hardware.

The code which updates the parser should keep the existing
state if any part of the update fails.

This means it must attempt all memory allocations and whatever other
resource acquisition is necessary, and only after all of those
operations succeed and no more error cases are possible should it
update the tables and release the old entry.

In other worse, this whole mechanism must move to a proper "prepare
--> commit" model of making changes.

  parent reply	other threads:[~2016-11-10 16:57 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-09 12:56 [PATCH 1/2] net: mvpp2: don't bring up on MAC address set Baruch Siach
2016-11-09 12:56 ` [PATCH 2/2] net: mvpp2: simplify MAC address set code Baruch Siach
2016-11-09 13:22 ` [PATCH 1/2] net: mvpp2: don't bring up on MAC address set Thomas Petazzoni
2016-11-09 18:49   ` Baruch Siach
2016-11-10 16:57 ` David Miller [this message]
2016-11-10 18:08   ` Baruch Siach

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=20161110.115718.1744727306693534849.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=baruch@tkos.co.il \
    --cc=gregory.clement@free-electrons.com \
    --cc=mw@semihalf.com \
    --cc=netdev@vger.kernel.org \
    --cc=thomas.petazzoni@free-electrons.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).