diff options
author | Eric Dumazet <eric.dumazet@gmail.com> | 2009-06-05 00:04:16 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-06-08 03:21:48 -0400 |
commit | 042a53a9e437feaf2230dd2cadcecfae9c7bfe05 (patch) | |
tree | ae9078f61e390a3014aecb3fe80d3438ab25ee51 /drivers/net/e1000e | |
parent | eae3f29cc73f83cc3f1891d3ad40021b5172c630 (diff) |
net: skb_shared_info optimization
skb_dma_unmap() is quite expensive for small packets,
because we use two different cache lines from skb_shared_info.
One to access nr_frags, one to access dma_maps[0]
Instead of dma_maps being an array of MAX_SKB_FRAGS + 1 elements,
let dma_head alone in a new dma_head field, close to nr_frags,
to reduce cache lines misses.
Tested on my dev machine (bnx2 & tg3 adapters), nice speedup !
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/e1000e')
-rw-r--r-- | drivers/net/e1000e/netdev.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c index 38694c79edcc..9043f1b845fe 100644 --- a/drivers/net/e1000e/netdev.c +++ b/drivers/net/e1000e/netdev.c | |||
@@ -3916,7 +3916,7 @@ static int e1000_tx_map(struct e1000_adapter *adapter, | |||
3916 | buffer_info->length = size; | 3916 | buffer_info->length = size; |
3917 | buffer_info->time_stamp = jiffies; | 3917 | buffer_info->time_stamp = jiffies; |
3918 | buffer_info->next_to_watch = i; | 3918 | buffer_info->next_to_watch = i; |
3919 | buffer_info->dma = map[0] + offset; | 3919 | buffer_info->dma = skb_shinfo(skb)->dma_head + offset; |
3920 | count++; | 3920 | count++; |
3921 | 3921 | ||
3922 | len -= size; | 3922 | len -= size; |
@@ -3947,7 +3947,7 @@ static int e1000_tx_map(struct e1000_adapter *adapter, | |||
3947 | buffer_info->length = size; | 3947 | buffer_info->length = size; |
3948 | buffer_info->time_stamp = jiffies; | 3948 | buffer_info->time_stamp = jiffies; |
3949 | buffer_info->next_to_watch = i; | 3949 | buffer_info->next_to_watch = i; |
3950 | buffer_info->dma = map[f + 1] + offset; | 3950 | buffer_info->dma = map[f] + offset; |
3951 | 3951 | ||
3952 | len -= size; | 3952 | len -= size; |
3953 | offset += size; | 3953 | offset += size; |