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>
This commit is contained in:

gecommit door
David S. Miller

bovenliggende
eae3f29cc7
commit
042a53a9e4
@@ -2998,7 +2998,7 @@ static int e1000_tx_map(struct e1000_adapter *adapter,
|
||||
size -= 4;
|
||||
|
||||
buffer_info->length = size;
|
||||
buffer_info->dma = map[0] + offset;
|
||||
buffer_info->dma = skb_shinfo(skb)->dma_head + offset;
|
||||
buffer_info->time_stamp = jiffies;
|
||||
buffer_info->next_to_watch = i;
|
||||
|
||||
@@ -3039,7 +3039,7 @@ static int e1000_tx_map(struct e1000_adapter *adapter,
|
||||
size -= 4;
|
||||
|
||||
buffer_info->length = size;
|
||||
buffer_info->dma = map[f + 1] + offset;
|
||||
buffer_info->dma = map[f] + offset;
|
||||
buffer_info->time_stamp = jiffies;
|
||||
buffer_info->next_to_watch = i;
|
||||
|
||||
|
Verwijs in nieuw issue
Block a user