aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/bnx2.c
diff options
context:
space:
mode:
authorEric Dumazet <eric.dumazet@gmail.com>2009-06-05 00:04:16 -0400
committerDavid S. Miller <davem@davemloft.net>2009-06-08 03:21:48 -0400
commit042a53a9e437feaf2230dd2cadcecfae9c7bfe05 (patch)
treeae9078f61e390a3014aecb3fe80d3438ab25ee51 /drivers/net/bnx2.c
parenteae3f29cc73f83cc3f1891d3ad40021b5172c630 (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/bnx2.c')
-rw-r--r--drivers/net/bnx2.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c
index f53017250e09..391d2d47089c 100644
--- a/drivers/net/bnx2.c
+++ b/drivers/net/bnx2.c
@@ -5487,7 +5487,7 @@ bnx2_run_loopback(struct bnx2 *bp, int loopback_mode)
5487 dev_kfree_skb(skb); 5487 dev_kfree_skb(skb);
5488 return -EIO; 5488 return -EIO;
5489 } 5489 }
5490 map = skb_shinfo(skb)->dma_maps[0]; 5490 map = skb_shinfo(skb)->dma_head;
5491 5491
5492 REG_WR(bp, BNX2_HC_COMMAND, 5492 REG_WR(bp, BNX2_HC_COMMAND,
5493 bp->hc_cmd | BNX2_HC_COMMAND_COAL_NOW_WO_INT); 5493 bp->hc_cmd | BNX2_HC_COMMAND_COAL_NOW_WO_INT);
@@ -6167,7 +6167,7 @@ bnx2_start_xmit(struct sk_buff *skb, struct net_device *dev)
6167 } 6167 }
6168 6168
6169 sp = skb_shinfo(skb); 6169 sp = skb_shinfo(skb);
6170 mapping = sp->dma_maps[0]; 6170 mapping = sp->dma_head;
6171 6171
6172 tx_buf = &txr->tx_buf_ring[ring_prod]; 6172 tx_buf = &txr->tx_buf_ring[ring_prod];
6173 tx_buf->skb = skb; 6173 tx_buf->skb = skb;
@@ -6191,7 +6191,7 @@ bnx2_start_xmit(struct sk_buff *skb, struct net_device *dev)
6191 txbd = &txr->tx_desc_ring[ring_prod]; 6191 txbd = &txr->tx_desc_ring[ring_prod];
6192 6192
6193 len = frag->size; 6193 len = frag->size;
6194 mapping = sp->dma_maps[i + 1]; 6194 mapping = sp->dma_maps[i];
6195 6195
6196 txbd->tx_bd_haddr_hi = (u64) mapping >> 32; 6196 txbd->tx_bd_haddr_hi = (u64) mapping >> 32;
6197 txbd->tx_bd_haddr_lo = (u64) mapping & 0xffffffff; 6197 txbd->tx_bd_haddr_lo = (u64) mapping & 0xffffffff;