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>
This commit is contained in:
parent
db176edc89
commit
aabef8b240
|
@ -3073,7 +3073,6 @@ bnx2_rx_int(struct bnx2 *bp, struct bnx2_napi *bnapi, int budget)
|
||||||
u16 hw_cons, sw_cons, sw_ring_cons, sw_prod, sw_ring_prod;
|
u16 hw_cons, sw_cons, sw_ring_cons, sw_prod, sw_ring_prod;
|
||||||
struct l2_fhdr *rx_hdr;
|
struct l2_fhdr *rx_hdr;
|
||||||
int rx_pkt = 0, pg_ring_used = 0;
|
int rx_pkt = 0, pg_ring_used = 0;
|
||||||
struct pci_dev *pdev = bp->pdev;
|
|
||||||
|
|
||||||
hw_cons = bnx2_get_hw_rx_cons(bnapi);
|
hw_cons = bnx2_get_hw_rx_cons(bnapi);
|
||||||
sw_cons = rxr->rx_cons;
|
sw_cons = rxr->rx_cons;
|
||||||
|
@ -3099,12 +3098,10 @@ bnx2_rx_int(struct bnx2 *bp, struct bnx2_napi *bnapi, int budget)
|
||||||
skb = rx_buf->skb;
|
skb = rx_buf->skb;
|
||||||
prefetchw(skb);
|
prefetchw(skb);
|
||||||
|
|
||||||
if (!get_dma_ops(&pdev->dev)->sync_single_for_cpu) {
|
|
||||||
next_rx_buf =
|
next_rx_buf =
|
||||||
&rxr->rx_buf_ring[
|
&rxr->rx_buf_ring[RX_RING_IDX(NEXT_RX_BD(sw_cons))];
|
||||||
RX_RING_IDX(NEXT_RX_BD(sw_cons))];
|
|
||||||
prefetch(next_rx_buf->desc);
|
prefetch(next_rx_buf->desc);
|
||||||
}
|
|
||||||
rx_buf->skb = NULL;
|
rx_buf->skb = NULL;
|
||||||
|
|
||||||
dma_addr = dma_unmap_addr(rx_buf, mapping);
|
dma_addr = dma_unmap_addr(rx_buf, mapping);
|
||||||
|
|
Loading…
Reference in New Issue