diff options
author | Stephen Hemminger <shemminger@osdl.org> | 2006-03-21 01:58:36 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2006-03-21 01:58:36 -0500 |
commit | f8ae737deea1be001d7d8ac11c382a7b73a1c98f (patch) | |
tree | fdf933b58a17e525e38683e1f8d5a52c4708964b /net/bridge | |
parent | fdeabdefb227be9aa932f59a23ddb47e003e643e (diff) |
[BRIDGE]: forwarding remove unneeded preempt and bh diasables
Optimize the forwarding and transmit paths. Both places are
called with bottom half/no preempt so there is no need to use
spin_lock_bh or rcu_read_lock.
Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/bridge')
-rw-r--r-- | net/bridge/br_device.c | 3 | ||||
-rw-r--r-- | net/bridge/br_fdb.c | 6 |
2 files changed, 3 insertions, 6 deletions
diff --git a/net/bridge/br_device.c b/net/bridge/br_device.c index 0b33a7b3a00c..0c88a2ac32c1 100644 --- a/net/bridge/br_device.c +++ b/net/bridge/br_device.c | |||
@@ -27,6 +27,7 @@ static struct net_device_stats *br_dev_get_stats(struct net_device *dev) | |||
27 | return &br->statistics; | 27 | return &br->statistics; |
28 | } | 28 | } |
29 | 29 | ||
30 | /* net device transmit always called with no BH (preempt_disabled) */ | ||
30 | int br_dev_xmit(struct sk_buff *skb, struct net_device *dev) | 31 | int br_dev_xmit(struct sk_buff *skb, struct net_device *dev) |
31 | { | 32 | { |
32 | struct net_bridge *br = netdev_priv(dev); | 33 | struct net_bridge *br = netdev_priv(dev); |
@@ -39,7 +40,6 @@ int br_dev_xmit(struct sk_buff *skb, struct net_device *dev) | |||
39 | skb->mac.raw = skb->data; | 40 | skb->mac.raw = skb->data; |
40 | skb_pull(skb, ETH_HLEN); | 41 | skb_pull(skb, ETH_HLEN); |
41 | 42 | ||
42 | rcu_read_lock(); | ||
43 | if (dest[0] & 1) | 43 | if (dest[0] & 1) |
44 | br_flood_deliver(br, skb, 0); | 44 | br_flood_deliver(br, skb, 0); |
45 | else if ((dst = __br_fdb_get(br, dest)) != NULL) | 45 | else if ((dst = __br_fdb_get(br, dest)) != NULL) |
@@ -47,7 +47,6 @@ int br_dev_xmit(struct sk_buff *skb, struct net_device *dev) | |||
47 | else | 47 | else |
48 | br_flood_deliver(br, skb, 0); | 48 | br_flood_deliver(br, skb, 0); |
49 | 49 | ||
50 | rcu_read_unlock(); | ||
51 | return 0; | 50 | return 0; |
52 | } | 51 | } |
53 | 52 | ||
diff --git a/net/bridge/br_fdb.c b/net/bridge/br_fdb.c index 1f08a59b51ea..3a73b8c94271 100644 --- a/net/bridge/br_fdb.c +++ b/net/bridge/br_fdb.c | |||
@@ -341,7 +341,6 @@ void br_fdb_update(struct net_bridge *br, struct net_bridge_port *source, | |||
341 | if (hold_time(br) == 0) | 341 | if (hold_time(br) == 0) |
342 | return; | 342 | return; |
343 | 343 | ||
344 | rcu_read_lock(); | ||
345 | fdb = fdb_find(head, addr); | 344 | fdb = fdb_find(head, addr); |
346 | if (likely(fdb)) { | 345 | if (likely(fdb)) { |
347 | /* attempt to update an entry for a local interface */ | 346 | /* attempt to update an entry for a local interface */ |
@@ -356,13 +355,12 @@ void br_fdb_update(struct net_bridge *br, struct net_bridge_port *source, | |||
356 | fdb->ageing_timer = jiffies; | 355 | fdb->ageing_timer = jiffies; |
357 | } | 356 | } |
358 | } else { | 357 | } else { |
359 | spin_lock_bh(&br->hash_lock); | 358 | spin_lock(&br->hash_lock); |
360 | if (!fdb_find(head, addr)) | 359 | if (!fdb_find(head, addr)) |
361 | fdb_create(head, source, addr, 0); | 360 | fdb_create(head, source, addr, 0); |
362 | /* else we lose race and someone else inserts | 361 | /* else we lose race and someone else inserts |
363 | * it first, don't bother updating | 362 | * it first, don't bother updating |
364 | */ | 363 | */ |
365 | spin_unlock_bh(&br->hash_lock); | 364 | spin_unlock(&br->hash_lock); |
366 | } | 365 | } |
367 | rcu_read_unlock(); | ||
368 | } | 366 | } |