aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/vxge/vxge-main.c
diff options
context:
space:
mode:
authorBenjamin LaHaise <ben.lahaise@neterion.com>2009-08-04 06:21:57 -0400
committerDavid S. Miller <davem@davemloft.net>2009-08-05 16:10:45 -0400
commitea11bbe0c94b045fdefc05476b69a2eef999a9c4 (patch)
tree17e6ba82dbfd3e90f7728fa6b08fb01d1613168b /drivers/net/vxge/vxge-main.c
parent3f23e436d241ac1cf50a659228a5a0e1e6572c1a (diff)
vxge: prefetch skb->data
This patch implements prefetching of skb->data from a copy of the pointer in the descriptor (which is already in the L1 cache at this point). This improves netperf rx performance (netperf -L 0,0 -c -H 192.168.254.2 -- -M 131072 -m 131072) by 4.9% on a P4 Xeon host. Signed-off-by: Benjamin LaHaise <ben.lahaise@neterion.com> Signed-off-by: Sreenivasa Honnur <sreenivasa.honnur@neterion.com> Signed-off-by: Ramkrishna Vepa <ram.vepa@neterion.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/vxge/vxge-main.c')
-rw-r--r--drivers/net/vxge/vxge-main.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/net/vxge/vxge-main.c b/drivers/net/vxge/vxge-main.c
index e93651c19f59..094d15548a2b 100644
--- a/drivers/net/vxge/vxge-main.c
+++ b/drivers/net/vxge/vxge-main.c
@@ -286,6 +286,7 @@ vxge_rx_alloc(void *dtrh, struct vxge_ring *ring, const int skb_size)
286 skb_reserve(skb, VXGE_HW_HEADER_ETHERNET_II_802_3_ALIGN); 286 skb_reserve(skb, VXGE_HW_HEADER_ETHERNET_II_802_3_ALIGN);
287 287
288 rx_priv->skb = skb; 288 rx_priv->skb = skb;
289 rx_priv->skb_data = NULL;
289 rx_priv->data_size = skb_size; 290 rx_priv->data_size = skb_size;
290 vxge_debug_entryexit(VXGE_TRACE, 291 vxge_debug_entryexit(VXGE_TRACE,
291 "%s: %s:%d Exiting...", ring->ndev->name, __func__, __LINE__); 292 "%s: %s:%d Exiting...", ring->ndev->name, __func__, __LINE__);
@@ -305,7 +306,8 @@ static int vxge_rx_map(void *dtrh, struct vxge_ring *ring)
305 ring->ndev->name, __func__, __LINE__); 306 ring->ndev->name, __func__, __LINE__);
306 rx_priv = vxge_hw_ring_rxd_private_get(dtrh); 307 rx_priv = vxge_hw_ring_rxd_private_get(dtrh);
307 308
308 dma_addr = pci_map_single(ring->pdev, rx_priv->skb->data, 309 rx_priv->skb_data = rx_priv->skb->data;
310 dma_addr = pci_map_single(ring->pdev, rx_priv->skb_data,
309 rx_priv->data_size, PCI_DMA_FROMDEVICE); 311 rx_priv->data_size, PCI_DMA_FROMDEVICE);
310 312
311 if (dma_addr == 0) { 313 if (dma_addr == 0) {
@@ -450,6 +452,7 @@ vxge_rx_1b_compl(struct __vxge_hw_ring *ringh, void *dtr,
450 skb = rx_priv->skb; 452 skb = rx_priv->skb;
451 data_size = rx_priv->data_size; 453 data_size = rx_priv->data_size;
452 data_dma = rx_priv->data_dma; 454 data_dma = rx_priv->data_dma;
455 prefetch(rx_priv->skb_data);
453 456
454 vxge_debug_rx(VXGE_TRACE, 457 vxge_debug_rx(VXGE_TRACE,
455 "%s: %s:%d skb = 0x%p", 458 "%s: %s:%d skb = 0x%p",
@@ -1056,6 +1059,7 @@ vxge_rx_term(void *dtrh, enum vxge_hw_rxd_state state, void *userdata)
1056 rx_priv->data_size, PCI_DMA_FROMDEVICE); 1059 rx_priv->data_size, PCI_DMA_FROMDEVICE);
1057 1060
1058 dev_kfree_skb(rx_priv->skb); 1061 dev_kfree_skb(rx_priv->skb);
1062 rx_priv->skb_data = NULL;
1059 1063
1060 vxge_debug_entryexit(VXGE_TRACE, 1064 vxge_debug_entryexit(VXGE_TRACE,
1061 "%s: %s:%d Exiting...", 1065 "%s: %s:%d Exiting...",