public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Arvid Brodin <arvid.brodin@xdin•com>
To: David Miller <davem@davemloft•net>
Cc: <netdev@vger•kernel.org>, <shemminger@vyatta•com>,
	<joe@perches•com>, <jboticario@gmail•com>,
	<balferreira@googlemail•com>
Subject: Re: [PATCH v2] net/hsr: Add support for the High-availability Seamless Redundancy protocol (HSRv0)
Date: Mon, 8 Jul 2013 17:54:55 +0200	[thread overview]
Message-ID: <51DAE0CF.4080905@xdin.com> (raw)
In-Reply-To: <51D2156A.3070403@xdin.com>

On 2013-07-02 01:48, Arvid Brodin wrote:
> On 2013-06-29 06:16, David Miller wrote:
>> From: Arvid Brodin <arvid.brodin@xdin•com>
>> Date: Wed, 26 Jun 2013 17:16:11 +0200
>>
>>> +static int hsr_dev_open(struct net_device *dev)
>>> +{
>>> +    struct hsr_priv *hsr_priv;
>>> +
>>> +    hsr_priv = netdev_priv(dev);
>>> +
>>> +    if (hsr_priv->slave[0])
>>> +        dev_open(hsr_priv->slave[0]);
>>> +    if (hsr_priv->slave[1])
>>> +        dev_open(hsr_priv->slave[1]);
>>> +
>>> +    return 0;
>>> +}
>>
>> dev_open() can and does fail, you must thus check for error returns, undo any
>> necessary state, and propagate that error to callers of hsr_dev_open.
>>
>
> I'm not sure it's an error (from the HSR interface's point of view) if the slave(s)
> won't come up here. The calls to dev_open() can be seen more like a convenience
> than a necessity (I actually left them out to begin with). If none of the slaves
> could go up the HSR interface would end up as admin UP but with operstate
> IF_OPER_LOWERLAYERDOWN until any of the slaves went up.
>
> I see that the VLAN code, in its vlan_dev_open(), checks the underlying interface's
> IFF_UP flag and returns -ENETDOWN if it's not set. That might be an option here -
> but then one would have to set three interfaces up to get a working HSR interface,
> which is a bit tedious... Also, the HSR interface could end up in the state above
> anyway if both slaves went down after the HSR interface went up successfully.
>
> What about checking the return values and printing a warning if a slave dev_open()
> fails, but still return success for the HSR interface no matter what?
>


Is there anything else I can do to get this patch accepted? Anything that's missing
or done incorrectly that I need to fix?


-- 
Arvid Brodin | Consultant (Linux)
T: +46-8-56254286 | M: +46-70-9714286 | arvid.brodin@xdin•com
XDIN AB | Knarrarnäsgatan 7 | SE-164 40 Kista | Sweden | xdin.com

  reply	other threads:[~2013-07-08 16:05 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-26 15:16 [PATCH v2] net/hsr: Add support for the High-availability Seamless Redundancy protocol (HSRv0) Arvid Brodin
2013-06-29  4:16 ` David Miller
2013-07-01 23:48   ` Arvid Brodin
2013-07-08 15:54     ` Arvid Brodin [this message]
2013-08-20 17:36     ` Arvid Brodin

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=51DAE0CF.4080905@xdin.com \
    --to=arvid.brodin@xdin$(echo .)com \
    --cc=balferreira@googlemail$(echo .)com \
    --cc=davem@davemloft$(echo .)net \
    --cc=jboticario@gmail$(echo .)com \
    --cc=joe@perches$(echo .)com \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=shemminger@vyatta$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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