diff options
author | Eric Dumazet <eric.dumazet@gmail.com> | 2009-11-01 19:45:16 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-11-01 23:55:12 -0800 |
commit | 05e8689c9a3a208bf75b60662778d81e23eac460 (patch) | |
tree | 8253e265212cbd469d1b299c760dc7c38914dbf3 /drivers/net/ifb.c | |
parent | 3710becf8a58a5c6c4e797e3a3c968c161abdb41 (diff) | |
download | linux-05e8689c9a3a208bf75b60662778d81e23eac460.tar.bz2 |
ifb: RCU locking avoids touching dev refcount
Avoids touching dev refcount in hotpath
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ifb.c')
-rw-r--r-- | drivers/net/ifb.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/net/ifb.c b/drivers/net/ifb.c index 030913f8bd26..69c25668dd63 100644 --- a/drivers/net/ifb.c +++ b/drivers/net/ifb.c @@ -98,13 +98,15 @@ static void ri_tasklet(unsigned long dev) stats->tx_packets++; stats->tx_bytes +=skb->len; - skb->dev = dev_get_by_index(&init_net, skb->iif); + rcu_read_lock(); + skb->dev = dev_get_by_index_rcu(&init_net, skb->iif); if (!skb->dev) { + rcu_read_unlock(); dev_kfree_skb(skb); stats->tx_dropped++; break; } - dev_put(skb->dev); + rcu_read_unlock(); skb->iif = _dev->ifindex; if (from & AT_EGRESS) { |