From: Arvid Brodin <arvid.brodin@xdin.com>
To: Stephen Hemminger <stephen@networkplumber.org>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
Joe Perches <joe@perches.com>,
Javier Boticario <jboticario@gmail.com>,
"balferreira@googlemail.com" <balferreira@googlemail.com>
Subject: Re: [PATCH] net/hsr: Add support for the High-availability Seamless Redundancy protocol (HSRv0)
Date: Wed, 26 Jun 2013 00:57:10 +0200 [thread overview]
Message-ID: <51CA2046.9090809@xdin.com> (raw)
In-Reply-To: <20130624171151.7b2b342a@nehalam.linuxnetplumber.net>
On 2013-06-25 02:11, Stephen Hemminger wrote:
> On Mon, 24 Jun 2013 09:44:01 -0700
> Arvid Brodin <arvid.brodin@xdin.com> wrote:
>
>> +
>> +static void __hsr_set_operstate(struct net_device *dev, int transition)
>> +{
>> + if (dev->operstate != transition) {
>> + write_lock_bh(&dev_base_lock);
>> + dev->operstate = transition;
>> + write_unlock_bh(&dev_base_lock);
>> + netdev_state_change(dev);
>> + }
>> +}
>
> Don't use dev_base_lock, you need to use rtnl_mutex() instead when
> making state changes.
This code is exactly what set_operstate() does net/core/rtnetlink.c. Are you sure I should
change it to use rtnl_lock()/rtnl_unlock()?
> Also, don't set operstate directly, it doesn't run link watch events
> which services can see. Instead use this to propogate up changes.
>
> void netif_stacked_transfer_operstate(const struct net_device *rootdev,
> struct net_device *dev)
That function does not work for devices with more than one underlying physical interface.
A HSR device works (is OPER_UP) as long as at least one of its two physical interfaces is
up. Using that function to set carrier state on a HSR device would defeat the whole
purpose with HSR (redundancy). I haven't been able to find an existing interface that sets
operstate for devices that use multiple physical interfaces.
As for link watch events, doesn't the call to netdev_state_change() take care of that?
--
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
next prev parent reply other threads:[~2013-06-25 22:57 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1902752B0C92F943AB7EA9EE13E2DEEC126CC8C873@HQ1-EXCH02.corp.brocade.com>
[not found] ` <20130624170727.4d7893a1@nehalam.linuxnetplumber.net>
2013-06-25 22:30 ` [PATCH] net/hsr: Add support for the High-availability Seamless Redundancy protocol (HSRv0) Arvid Brodin
2013-06-25 22:46 ` Stephen Hemminger
2013-06-25 23:36 ` Arvid Brodin
[not found] ` <20130624171151.7b2b342a@nehalam.linuxnetplumber.net>
2013-06-25 22:57 ` Arvid Brodin [this message]
2013-06-24 16:43 Arvid Brodin
2013-06-24 18:16 ` Joe Perches
2013-06-25 21:16 ` Arvid Brodin
2013-06-25 21:31 ` Joe Perches
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=51CA2046.9090809@xdin.com \
--to=arvid.brodin@xdin.com \
--cc=balferreira@googlemail.com \
--cc=jboticario@gmail.com \
--cc=joe@perches.com \
--cc=netdev@vger.kernel.org \
--cc=stephen@networkplumber.org \
/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).