All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vlad Yasevich <vyasevich@gmail.com>
To: "Luis R. Rodriguez" <mcgrof@suse.com>
Cc: kvm@vger.kernel.org, Cong Wang <cwang@twopensource.com>,
	bridge@lists.linux-foundation.org,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Stephen Hemminger <stephen@networkplumber.org>,
	netdev <netdev@vger.kernel.org>,
	xen-devel@lists.xenproject.org
Subject: Re: [Bridge] [PATCH 2/3] bridge: trigger a bridge calculation upon port changes
Date: Wed, 30 Apr 2014 20:12:03 -0400	[thread overview]
Message-ID: <53619153.8020404@gmail.com> (raw)
In-Reply-To: <20140430225920.GJ11838@wotan.suse.de>

On 04/30/2014 06:59 PM, Luis R. Rodriguez wrote:
> On Wed, Apr 30, 2014 at 04:04:34PM -0400, Vlad Yasevich wrote:
>> On 04/22/2014 03:43 PM, Luis R. Rodriguez wrote:
>>> diff --git a/net/bridge/br_if.c b/net/bridge/br_if.c
>>> index 54d207d..dcd9378 100644
>>> --- a/net/bridge/br_if.c
>>> +++ b/net/bridge/br_if.c
>>> @@ -315,6 +315,8 @@ netdev_features_t br_features_recompute(struct net_bridge *br,
>>>  	features &= ~NETIF_F_ONE_FOR_ALL;
>>>  
>>>  	list_for_each_entry(p, &br->port_list, list) {
>>> +		if (p->flags & BR_ROOT_BLOCK)
>>> +			continue;
>>>  		features = netdev_increment_features(features,
>>>  						     p->dev->features, mask);
>>>  	}
>>>
>> Hi Luis
>>
>> The hunk above isn't right.  Just because you set ROOT_BLOCK on the port
>> doesn't mean that you should ignore it's device features.  If the device
>> you just added happens to disable or enable some device offload feature,
>> you should take that into account.
> 
> OK thanks, how about this part:
> 
> On 04/22/2014 03:43 PM, Luis R. Rodriguez wrote:
>> On Tue, Mar 18, 2014 at 02:22:43PM -0700, Luis R. Rodriguez wrote:
>> On Tue, Mar 18, 2014 at 01:46:49PM -0700, Cong Wang wrote:
>>> On Fri, Mar 14, 2014 at 6:39 PM, Luis R. Rodriguez <mcgrof@suse.com> wrote:
>>>> On Thu, Mar 13, 2014 at 11:26:25AM -0700, Cong Wang wrote:
>>>>> On Wed, Mar 12, 2014 at 8:15 PM, Luis R. Rodriguez
>>>>> <mcgrof@do-not-panic.com> wrote:
>>>>>>                         spin_unlock_bh(&p->br->lock);
>>>>>> +                       if (changed)
>>>>>> +                               call_netdevice_notifiers(NETDEV_CHANGEADDR,
>>>>>> +                                                        p->br->dev);
>>>>>> +                       netdev_update_features(p->br->dev);
>>>>>

This is actually just a part of it.  You also need to handle the sysfs
changing the flag.

Look at the first 2 patches in this series:
http://www.spinics.net/lists/netdev/msg280863.html

You might need that functionality.

-vlad


>>>>> I think this is supposed to be in netdev event handler of br->dev
>>>>> instead of here.
>>>>
>>>> Do you mean netdev_update_features() ? I mimic'd what was being done on
>>>> br_del_if() given that root blocking is doing something similar. If
>>>> we need to change something for the above then I suppose it means we need
>>>> to change br_del_if() too. Let me know if you see any reason for something
>>>> else.
>>>>
>>>
>>> Yeah, for me it looks like it's better to call netdev_update_features()
>>> in the event handler of br->dev, rather than where calling
>>> call_netdevice_notifiers(..., br->dev);.
>>
>> I still don't see why, in fact trying to verify this I am wondering now
>> if instead we should actually fix br_features_recompute() to take into
>> consideration BR_ROOT_BLOCK as below. Notice how netdev_update_features()
>> is called above even if the MAC address did not change, just as is done
>> on br_del_if(). There is an NETDEV_FEAT_CHANGE event so would it be more
>> appropriate we just call
>>
>> call_netdevice_notifiers(NETDEV_FEAT_CHANGE, p->br->dev)
>>
>> for both the above then and also br_del_if()?
> 
>   Luis
> 


WARNING: multiple messages have this Message-ID (diff)
From: Vlad Yasevich <vyasevich@gmail.com>
To: "Luis R. Rodriguez" <mcgrof@suse.com>
Cc: kvm@vger.kernel.org, Cong Wang <cwang@twopensource.com>,
	bridge@lists.linux-foundation.org,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Stephen Hemminger <stephen@networkplumber.org>,
	netdev <netdev@vger.kernel.org>,
	xen-devel@lists.xenproject.org
Subject: Re: [PATCH 2/3] bridge: trigger a bridge calculation upon port changes
Date: Wed, 30 Apr 2014 20:12:03 -0400	[thread overview]
Message-ID: <53619153.8020404@gmail.com> (raw)
In-Reply-To: <20140430225920.GJ11838@wotan.suse.de>

On 04/30/2014 06:59 PM, Luis R. Rodriguez wrote:
> On Wed, Apr 30, 2014 at 04:04:34PM -0400, Vlad Yasevich wrote:
>> On 04/22/2014 03:43 PM, Luis R. Rodriguez wrote:
>>> diff --git a/net/bridge/br_if.c b/net/bridge/br_if.c
>>> index 54d207d..dcd9378 100644
>>> --- a/net/bridge/br_if.c
>>> +++ b/net/bridge/br_if.c
>>> @@ -315,6 +315,8 @@ netdev_features_t br_features_recompute(struct net_bridge *br,
>>>  	features &= ~NETIF_F_ONE_FOR_ALL;
>>>  
>>>  	list_for_each_entry(p, &br->port_list, list) {
>>> +		if (p->flags & BR_ROOT_BLOCK)
>>> +			continue;
>>>  		features = netdev_increment_features(features,
>>>  						     p->dev->features, mask);
>>>  	}
>>>
>> Hi Luis
>>
>> The hunk above isn't right.  Just because you set ROOT_BLOCK on the port
>> doesn't mean that you should ignore it's device features.  If the device
>> you just added happens to disable or enable some device offload feature,
>> you should take that into account.
> 
> OK thanks, how about this part:
> 
> On 04/22/2014 03:43 PM, Luis R. Rodriguez wrote:
>> On Tue, Mar 18, 2014 at 02:22:43PM -0700, Luis R. Rodriguez wrote:
>> On Tue, Mar 18, 2014 at 01:46:49PM -0700, Cong Wang wrote:
>>> On Fri, Mar 14, 2014 at 6:39 PM, Luis R. Rodriguez <mcgrof@suse.com> wrote:
>>>> On Thu, Mar 13, 2014 at 11:26:25AM -0700, Cong Wang wrote:
>>>>> On Wed, Mar 12, 2014 at 8:15 PM, Luis R. Rodriguez
>>>>> <mcgrof@do-not-panic.com> wrote:
>>>>>>                         spin_unlock_bh(&p->br->lock);
>>>>>> +                       if (changed)
>>>>>> +                               call_netdevice_notifiers(NETDEV_CHANGEADDR,
>>>>>> +                                                        p->br->dev);
>>>>>> +                       netdev_update_features(p->br->dev);
>>>>>

This is actually just a part of it.  You also need to handle the sysfs
changing the flag.

Look at the first 2 patches in this series:
http://www.spinics.net/lists/netdev/msg280863.html

You might need that functionality.

-vlad


>>>>> I think this is supposed to be in netdev event handler of br->dev
>>>>> instead of here.
>>>>
>>>> Do you mean netdev_update_features() ? I mimic'd what was being done on
>>>> br_del_if() given that root blocking is doing something similar. If
>>>> we need to change something for the above then I suppose it means we need
>>>> to change br_del_if() too. Let me know if you see any reason for something
>>>> else.
>>>>
>>>
>>> Yeah, for me it looks like it's better to call netdev_update_features()
>>> in the event handler of br->dev, rather than where calling
>>> call_netdevice_notifiers(..., br->dev);.
>>
>> I still don't see why, in fact trying to verify this I am wondering now
>> if instead we should actually fix br_features_recompute() to take into
>> consideration BR_ROOT_BLOCK as below. Notice how netdev_update_features()
>> is called above even if the MAC address did not change, just as is done
>> on br_del_if(). There is an NETDEV_FEAT_CHANGE event so would it be more
>> appropriate we just call
>>
>> call_netdevice_notifiers(NETDEV_FEAT_CHANGE, p->br->dev)
>>
>> for both the above then and also br_del_if()?
> 
>   Luis
> 

WARNING: multiple messages have this Message-ID (diff)
From: Vlad Yasevich <vyasevich@gmail.com>
To: "Luis R. Rodriguez" <mcgrof@suse.com>
Cc: "Luis R. Rodriguez" <mcgrof@do-not-panic.com>,
	Cong Wang <cwang@twopensource.com>,
	netdev <netdev@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	kvm@vger.kernel.org, xen-devel@lists.xenproject.org,
	Stephen Hemminger <stephen@networkplumber.org>,
	bridge@lists.linux-foundation.org
Subject: Re: [PATCH 2/3] bridge: trigger a bridge calculation upon port changes
Date: Wed, 30 Apr 2014 20:12:03 -0400	[thread overview]
Message-ID: <53619153.8020404@gmail.com> (raw)
In-Reply-To: <20140430225920.GJ11838@wotan.suse.de>

On 04/30/2014 06:59 PM, Luis R. Rodriguez wrote:
> On Wed, Apr 30, 2014 at 04:04:34PM -0400, Vlad Yasevich wrote:
>> On 04/22/2014 03:43 PM, Luis R. Rodriguez wrote:
>>> diff --git a/net/bridge/br_if.c b/net/bridge/br_if.c
>>> index 54d207d..dcd9378 100644
>>> --- a/net/bridge/br_if.c
>>> +++ b/net/bridge/br_if.c
>>> @@ -315,6 +315,8 @@ netdev_features_t br_features_recompute(struct net_bridge *br,
>>>  	features &= ~NETIF_F_ONE_FOR_ALL;
>>>  
>>>  	list_for_each_entry(p, &br->port_list, list) {
>>> +		if (p->flags & BR_ROOT_BLOCK)
>>> +			continue;
>>>  		features = netdev_increment_features(features,
>>>  						     p->dev->features, mask);
>>>  	}
>>>
>> Hi Luis
>>
>> The hunk above isn't right.  Just because you set ROOT_BLOCK on the port
>> doesn't mean that you should ignore it's device features.  If the device
>> you just added happens to disable or enable some device offload feature,
>> you should take that into account.
> 
> OK thanks, how about this part:
> 
> On 04/22/2014 03:43 PM, Luis R. Rodriguez wrote:
>> On Tue, Mar 18, 2014 at 02:22:43PM -0700, Luis R. Rodriguez wrote:
>> On Tue, Mar 18, 2014 at 01:46:49PM -0700, Cong Wang wrote:
>>> On Fri, Mar 14, 2014 at 6:39 PM, Luis R. Rodriguez <mcgrof@suse.com> wrote:
>>>> On Thu, Mar 13, 2014 at 11:26:25AM -0700, Cong Wang wrote:
>>>>> On Wed, Mar 12, 2014 at 8:15 PM, Luis R. Rodriguez
>>>>> <mcgrof@do-not-panic.com> wrote:
>>>>>>                         spin_unlock_bh(&p->br->lock);
>>>>>> +                       if (changed)
>>>>>> +                               call_netdevice_notifiers(NETDEV_CHANGEADDR,
>>>>>> +                                                        p->br->dev);
>>>>>> +                       netdev_update_features(p->br->dev);
>>>>>

This is actually just a part of it.  You also need to handle the sysfs
changing the flag.

Look at the first 2 patches in this series:
http://www.spinics.net/lists/netdev/msg280863.html

You might need that functionality.

-vlad


>>>>> I think this is supposed to be in netdev event handler of br->dev
>>>>> instead of here.
>>>>
>>>> Do you mean netdev_update_features() ? I mimic'd what was being done on
>>>> br_del_if() given that root blocking is doing something similar. If
>>>> we need to change something for the above then I suppose it means we need
>>>> to change br_del_if() too. Let me know if you see any reason for something
>>>> else.
>>>>
>>>
>>> Yeah, for me it looks like it's better to call netdev_update_features()
>>> in the event handler of br->dev, rather than where calling
>>> call_netdevice_notifiers(..., br->dev);.
>>
>> I still don't see why, in fact trying to verify this I am wondering now
>> if instead we should actually fix br_features_recompute() to take into
>> consideration BR_ROOT_BLOCK as below. Notice how netdev_update_features()
>> is called above even if the MAC address did not change, just as is done
>> on br_del_if(). There is an NETDEV_FEAT_CHANGE event so would it be more
>> appropriate we just call
>>
>> call_netdevice_notifiers(NETDEV_FEAT_CHANGE, p->br->dev)
>>
>> for both the above then and also br_del_if()?
> 
>   Luis
> 


  parent reply	other threads:[~2014-05-01  0:12 UTC|newest]

Thread overview: 95+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-13  3:15 [PATCH 0/3] bridge: few enhancements and small fixes Luis R. Rodriguez
2014-03-13  3:15 ` [PATCH 1/3] bridge: preserve random init MAC address Luis R. Rodriguez
2014-03-13  3:15 ` [Bridge] " Luis R. Rodriguez
2014-03-13  3:15   ` Luis R. Rodriguez
2014-03-13  3:15   ` Luis R. Rodriguez
2014-03-19  0:42   ` Toshiaki Makita
2014-03-19  0:42   ` [Bridge] " Toshiaki Makita
2014-03-19  0:42     ` Toshiaki Makita
2014-03-19  0:42     ` Toshiaki Makita
2014-03-19  0:50     ` Luis R. Rodriguez
2014-03-19  0:50     ` [Bridge] " Luis R. Rodriguez
2014-03-19  0:50       ` Luis R. Rodriguez
2014-03-19  0:50       ` Luis R. Rodriguez
2014-03-19  1:04       ` [Bridge] " Toshiaki Makita
2014-03-19  1:04         ` Toshiaki Makita
2014-03-19  1:04         ` Toshiaki Makita
2014-03-19  1:10         ` Luis R. Rodriguez
2014-03-19  1:10         ` [Bridge] " Luis R. Rodriguez
2014-03-19  1:10           ` Luis R. Rodriguez
2014-03-19  1:10           ` Luis R. Rodriguez
2014-03-19 16:09           ` [Bridge] " Toshiaki Makita
2014-03-19 16:09           ` Toshiaki Makita
2014-03-19 16:09             ` Toshiaki Makita
2014-03-19  1:04       ` Toshiaki Makita
2014-03-19  3:10   ` [Bridge] " Stephen Hemminger
2014-03-19  3:10     ` Stephen Hemminger
2014-03-19  3:10     ` Stephen Hemminger
2014-03-19  3:37     ` [Bridge] " Luis R. Rodriguez
2014-03-19  3:37       ` Luis R. Rodriguez
2014-03-19  3:37       ` Luis R. Rodriguez
2014-03-19  3:37     ` Luis R. Rodriguez
2014-03-20  2:05     ` Luis R. Rodriguez
2014-03-20  2:05     ` Luis R. Rodriguez
2014-03-20  2:05       ` [Bridge] " Luis R. Rodriguez
2014-04-22 19:41       ` Luis R. Rodriguez
2014-04-22 19:41       ` [Bridge] " Luis R. Rodriguez
2014-04-22 19:41         ` Luis R. Rodriguez
2014-04-22 19:41         ` Luis R. Rodriguez
2014-04-30 18:40         ` [Bridge] " Luis R. Rodriguez
2014-04-30 18:40           ` Luis R. Rodriguez
2014-04-30 18:40           ` Luis R. Rodriguez
2014-04-30 18:40         ` Luis R. Rodriguez
2014-04-30 19:11         ` Vlad Yasevich
2014-04-30 19:11         ` [Bridge] " Vlad Yasevich
2014-04-30 19:11           ` Vlad Yasevich
2014-04-30 19:11           ` Vlad Yasevich
2014-03-19  3:10   ` Stephen Hemminger
2014-03-13  3:15 ` [Bridge] [PATCH 2/3] bridge: trigger a bridge calculation upon port changes Luis R. Rodriguez
2014-03-13  3:15   ` Luis R. Rodriguez
2014-03-13 18:26   ` Cong Wang
2014-03-13 18:26   ` [Bridge] " Cong Wang
2014-03-13 18:26     ` Cong Wang
2014-03-13 18:26     ` Cong Wang
2014-03-15  1:39     ` Luis R. Rodriguez
2014-03-15  1:39       ` [Bridge] " Luis R. Rodriguez
2014-03-18 20:46       ` Cong Wang
2014-03-18 20:46         ` Cong Wang
2014-03-18 20:46         ` Cong Wang
2014-03-18 21:22         ` Luis R. Rodriguez
2014-03-18 21:22         ` [Bridge] " Luis R. Rodriguez
2014-03-18 21:22           ` Luis R. Rodriguez
2014-03-18 21:22           ` Luis R. Rodriguez
2014-04-22 19:43           ` Luis R. Rodriguez
2014-04-22 19:43           ` Luis R. Rodriguez
2014-04-22 19:43             ` [Bridge] " Luis R. Rodriguez
2014-04-30 18:38             ` Luis R. Rodriguez
2014-04-30 18:38               ` Luis R. Rodriguez
2014-04-30 18:38               ` Luis R. Rodriguez
2014-04-30 18:38             ` Luis R. Rodriguez
2014-04-30 20:04             ` [Bridge] " Vlad Yasevich
2014-04-30 20:04               ` Vlad Yasevich
2014-04-30 20:04               ` Vlad Yasevich
2014-04-30 22:59               ` Luis R. Rodriguez
2014-04-30 22:59                 ` [Bridge] " Luis R. Rodriguez
2014-05-01  0:12                 ` Vlad Yasevich
2014-05-01  0:12                 ` Vlad Yasevich [this message]
2014-05-01  0:12                   ` Vlad Yasevich
2014-05-01  0:12                   ` Vlad Yasevich
2014-04-30 22:59               ` Luis R. Rodriguez
2014-04-30 20:04             ` Vlad Yasevich
2014-03-18 20:46       ` Cong Wang
2014-03-15  1:39     ` Luis R. Rodriguez
2014-03-13  3:15 ` Luis R. Rodriguez
2014-03-13  3:15 ` [Bridge] [PATCH 3/3] bridge: fix bridge root block on designated port Luis R. Rodriguez
2014-03-13  3:15   ` Luis R. Rodriguez
2014-03-13 22:16   ` [Bridge] " Stephen Hemminger
2014-03-13 22:16     ` Stephen Hemminger
2014-03-13 22:16     ` Stephen Hemminger
2014-03-15  2:08     ` Luis R. Rodriguez
2014-03-15  2:08     ` Luis R. Rodriguez
2014-03-15  2:08       ` [Bridge] " Luis R. Rodriguez
2014-03-13 22:16   ` Stephen Hemminger
2014-03-13  3:15 ` Luis R. Rodriguez
2014-03-18 20:31 ` [PATCH 0/3] bridge: few enhancements and small fixes Luis R. Rodriguez
2014-03-18 20:31 ` Luis R. Rodriguez

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=53619153.8020404@gmail.com \
    --to=vyasevich@gmail.com \
    --cc=bridge@lists.linux-foundation.org \
    --cc=cwang@twopensource.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mcgrof@suse.com \
    --cc=netdev@vger.kernel.org \
    --cc=stephen@networkplumber.org \
    --cc=xen-devel@lists.xenproject.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.