[<prev] [next>] [day] [month] [year] [list]
Message-ID: <51CA2046.9090809@xdin.com>
Date: Wed, 26 Jun 2013 00:57:10 +0200
From: Arvid Brodin <arvid.brodin@...n.com>
To: Stephen Hemminger <stephen@...workplumber.org>
CC: "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
Joe Perches <joe@...ches.com>,
Javier Boticario <jboticario@...il.com>,
"balferreira@...glemail.com" <balferreira@...glemail.com>
Subject: Re: [PATCH] net/hsr: Add support for the High-availability Seamless
Redundancy protocol (HSRv0)
On 2013-06-25 02:11, Stephen Hemminger wrote:
> On Mon, 24 Jun 2013 09:44:01 -0700
> Arvid Brodin <arvid.brodin@...n.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@...n.com
XDIN AB | Knarrarnäsgatan 7 | SE-164 40 Kista | Sweden | xdin.com
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists