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:

committed by
David S. Miller

parent
eae3f29cc7
commit
042a53a9e4
@@ -1300,7 +1300,7 @@ ixgb_tx_map(struct ixgb_adapter *adapter, struct sk_buff *skb,
|
||||
buffer_info->length = size;
|
||||
WARN_ON(buffer_info->dma != 0);
|
||||
buffer_info->time_stamp = jiffies;
|
||||
buffer_info->dma = map[0] + offset;
|
||||
buffer_info->dma = skb_shinfo(skb)->dma_head + offset;
|
||||
pci_map_single(adapter->pdev,
|
||||
skb->data + offset,
|
||||
size,
|
||||
@@ -1340,7 +1340,7 @@ ixgb_tx_map(struct ixgb_adapter *adapter, struct sk_buff *skb,
|
||||
|
||||
buffer_info->length = size;
|
||||
buffer_info->time_stamp = jiffies;
|
||||
buffer_info->dma = map[f + 1] + offset;
|
||||
buffer_info->dma = map[f] + offset;
|
||||
buffer_info->next_to_watch = 0;
|
||||
|
||||
len -= size;
|
||||
|
Reference in New Issue
Block a user