aboutsummaryrefslogtreecommitdiffstats
path: root/net/bridge/br_if.c
diff options
context:
space:
mode:
authorMichał Mirosław <mirq-linux@rere.qmqm.pl>2011-04-22 02:31:16 -0400
committerDavid S. Miller <davem@davemloft.net>2011-04-28 16:33:08 -0400
commitc4d27ef957cd9261c0bc8488edaf8390e412cd35 (patch)
treef8e263ca9a1842803a2265bffd5eaa3e5b3d9660 /net/bridge/br_if.c
parent1742f183fc218798dab6fcf0ded25b6608fc0a48 (diff)
bridge: convert br_features_recompute() to ndo_fix_features
Note: netdev_update_features() needs only rtnl_lock as br->port_list is only changed while holding it. Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/bridge/br_if.c')
-rw-r--r--net/bridge/br_if.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/net/bridge/br_if.c b/net/bridge/br_if.c
index 7f5379c593d9..1156460773dc 100644
--- a/net/bridge/br_if.c
+++ b/net/bridge/br_if.c
@@ -291,15 +291,15 @@ int br_min_mtu(const struct net_bridge *br)
291/* 291/*
292 * Recomputes features using slave's features 292 * Recomputes features using slave's features
293 */ 293 */
294void br_features_recompute(struct net_bridge *br) 294u32 br_features_recompute(struct net_bridge *br, u32 features)
295{ 295{
296 struct net_bridge_port *p; 296 struct net_bridge_port *p;
297 u32 features, mask; 297 u32 mask;
298 298
299 features = mask = br->feature_mask;
300 if (list_empty(&br->port_list)) 299 if (list_empty(&br->port_list))
301 goto done; 300 return features;
302 301
302 mask = features;
303 features &= ~NETIF_F_ONE_FOR_ALL; 303 features &= ~NETIF_F_ONE_FOR_ALL;
304 304
305 list_for_each_entry(p, &br->port_list, list) { 305 list_for_each_entry(p, &br->port_list, list) {
@@ -307,8 +307,7 @@ void br_features_recompute(struct net_bridge *br)
307 p->dev->features, mask); 307 p->dev->features, mask);
308 } 308 }
309 309
310done: 310 return features;
311 br->dev->features = netdev_fix_features(br->dev, features);
312} 311}
313 312
314/* called with RTNL */ 313/* called with RTNL */
@@ -373,9 +372,10 @@ int br_add_if(struct net_bridge *br, struct net_device *dev)
373 372
374 list_add_rcu(&p->list, &br->port_list); 373 list_add_rcu(&p->list, &br->port_list);
375 374
375 netdev_update_features(br->dev);
376
376 spin_lock_bh(&br->lock); 377 spin_lock_bh(&br->lock);
377 changed_addr = br_stp_recalculate_bridge_id(br); 378 changed_addr = br_stp_recalculate_bridge_id(br);
378 br_features_recompute(br);
379 379
380 if ((dev->flags & IFF_UP) && netif_carrier_ok(dev) && 380 if ((dev->flags & IFF_UP) && netif_carrier_ok(dev) &&
381 (br->dev->flags & IFF_UP)) 381 (br->dev->flags & IFF_UP))
@@ -423,9 +423,10 @@ int br_del_if(struct net_bridge *br, struct net_device *dev)
423 423
424 spin_lock_bh(&br->lock); 424 spin_lock_bh(&br->lock);
425 br_stp_recalculate_bridge_id(br); 425 br_stp_recalculate_bridge_id(br);
426 br_features_recompute(br);
427 spin_unlock_bh(&br->lock); 426 spin_unlock_bh(&br->lock);
428 427
428 netdev_update_features(br->dev);
429
429 return 0; 430 return 0;
430} 431}
431 432