aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/bnx2.c
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2010-06-17 11:56:05 -0400
committerDavid S. Miller <davem@davemloft.net>2010-06-17 11:56:05 -0400
commitaabef8b240880439b91574c9a9e33dcc44bfd8c7 (patch)
tree80cc9175da9ca00d179ac83b9039fa9ed6e1be14 /drivers/net/bnx2.c
parentdb176edc89abbf22e6db6853f8581f9475fe8ec1 (diff)
bnx2: fix dma_get_ops compilation breakage
This removes dma_get_ops() prefetch optimization in bnx2. bnx2 uses dma_get_ops() to see if dma_sync_single_for_cpu() is noop. bnx2 does prefetch if it's noop. But dma_get_ops() isn't available on all the architectures (only the architectures that uses dma_map_ops struct have it). Using dma_get_ops() in drivers leads to compilation breakage on many architectures. This patch removes dma_get_ops() and changes bnx2 to do prefetch on all the architectures. This adds useless prefetch on non-coherent architectures but this is harmless. It is also unlikely to cause the performance drop. [ Remove now unused local variable 'pdev' -DaveM ] Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Acked-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/bnx2.c')
-rw-r--r--drivers/net/bnx2.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c
index 949d7a9dcf92..117432222a09 100644
--- a/drivers/net/bnx2.c
+++ b/drivers/net/bnx2.c
@@ -3073,7 +3073,6 @@ bnx2_rx_int(struct bnx2 *bp, struct bnx2_napi *bnapi, int budget)
3073 u16 hw_cons, sw_cons, sw_ring_cons, sw_prod, sw_ring_prod; 3073 u16 hw_cons, sw_cons, sw_ring_cons, sw_prod, sw_ring_prod;
3074 struct l2_fhdr *rx_hdr; 3074 struct l2_fhdr *rx_hdr;
3075 int rx_pkt = 0, pg_ring_used = 0; 3075 int rx_pkt = 0, pg_ring_used = 0;
3076 struct pci_dev *pdev = bp->pdev;
3077 3076
3078 hw_cons = bnx2_get_hw_rx_cons(bnapi); 3077 hw_cons = bnx2_get_hw_rx_cons(bnapi);
3079 sw_cons = rxr->rx_cons; 3078 sw_cons = rxr->rx_cons;
@@ -3099,12 +3098,10 @@ bnx2_rx_int(struct bnx2 *bp, struct bnx2_napi *bnapi, int budget)
3099 skb = rx_buf->skb; 3098 skb = rx_buf->skb;
3100 prefetchw(skb); 3099 prefetchw(skb);
3101 3100
3102 if (!get_dma_ops(&pdev->dev)->sync_single_for_cpu) { 3101 next_rx_buf =
3103 next_rx_buf = 3102 &rxr->rx_buf_ring[RX_RING_IDX(NEXT_RX_BD(sw_cons))];
3104 &rxr->rx_buf_ring[ 3103 prefetch(next_rx_buf->desc);
3105 RX_RING_IDX(NEXT_RX_BD(sw_cons))]; 3104
3106 prefetch(next_rx_buf->desc);
3107 }
3108 rx_buf->skb = NULL; 3105 rx_buf->skb = NULL;
3109 3106
3110 dma_addr = dma_unmap_addr(rx_buf, mapping); 3107 dma_addr = dma_unmap_addr(rx_buf, mapping);