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/igbvf | |
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/igbvf')
-rw-r--r-- | drivers/net/igbvf/netdev.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/net/igbvf/netdev.c b/drivers/net/igbvf/netdev.c index 5f7ba1a4990b..22aadb7884fa 100644 --- a/drivers/net/igbvf/netdev.c +++ b/drivers/net/igbvf/netdev.c | |||
@@ -2119,8 +2119,7 @@ static inline int igbvf_tx_map_adv(struct igbvf_adapter *adapter, | |||
2119 | /* set time_stamp *before* dma to help avoid a possible race */ | 2119 | /* set time_stamp *before* dma to help avoid a possible race */ |
2120 | buffer_info->time_stamp = jiffies; | 2120 | buffer_info->time_stamp = jiffies; |
2121 | buffer_info->next_to_watch = i; | 2121 | buffer_info->next_to_watch = i; |
2122 | buffer_info->dma = map[count]; | 2122 | buffer_info->dma = skb_shinfo(skb)->dma_head; |
2123 | count++; | ||
2124 | 2123 | ||
2125 | for (f = 0; f < skb_shinfo(skb)->nr_frags; f++) { | 2124 | for (f = 0; f < skb_shinfo(skb)->nr_frags; f++) { |
2126 | struct skb_frag_struct *frag; | 2125 | struct skb_frag_struct *frag; |
@@ -2144,7 +2143,7 @@ static inline int igbvf_tx_map_adv(struct igbvf_adapter *adapter, | |||
2144 | tx_ring->buffer_info[i].skb = skb; | 2143 | tx_ring->buffer_info[i].skb = skb; |
2145 | tx_ring->buffer_info[first].next_to_watch = i; | 2144 | tx_ring->buffer_info[first].next_to_watch = i; |
2146 | 2145 | ||
2147 | return count; | 2146 | return count + 1; |
2148 | } | 2147 | } |
2149 | 2148 | ||
2150 | static inline void igbvf_tx_queue_adv(struct igbvf_adapter *adapter, | 2149 | static inline void igbvf_tx_queue_adv(struct igbvf_adapter *adapter, |