Commit 53771522 authored by Lennert Buytenhek's avatar Lennert Buytenhek Committed by David S. Miller

mv643xx_eth: calculate descriptor pointer only once in rxq_refill()

Signed-off-by: default avatarLennert Buytenhek <buytenh@marvell.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent f61e5547
...@@ -593,6 +593,7 @@ static int rxq_refill(struct rx_queue *rxq, int budget) ...@@ -593,6 +593,7 @@ static int rxq_refill(struct rx_queue *rxq, int budget)
struct sk_buff *skb; struct sk_buff *skb;
int unaligned; int unaligned;
int rx; int rx;
struct rx_desc *rx_desc;
skb = __skb_dequeue(&mp->rx_recycle); skb = __skb_dequeue(&mp->rx_recycle);
if (skb == NULL) if (skb == NULL)
...@@ -615,13 +616,14 @@ static int rxq_refill(struct rx_queue *rxq, int budget) ...@@ -615,13 +616,14 @@ static int rxq_refill(struct rx_queue *rxq, int budget)
if (rxq->rx_used_desc == rxq->rx_ring_size) if (rxq->rx_used_desc == rxq->rx_ring_size)
rxq->rx_used_desc = 0; rxq->rx_used_desc = 0;
rxq->rx_desc_area[rx].buf_ptr = dma_map_single(NULL, skb->data, rx_desc = rxq->rx_desc_area + rx;
mp->skb_size, DMA_FROM_DEVICE);
rxq->rx_desc_area[rx].buf_size = mp->skb_size; rx_desc->buf_ptr = dma_map_single(NULL, skb->data,
mp->skb_size, DMA_FROM_DEVICE);
rx_desc->buf_size = mp->skb_size;
rxq->rx_skb[rx] = skb; rxq->rx_skb[rx] = skb;
wmb(); wmb();
rxq->rx_desc_area[rx].cmd_sts = BUFFER_OWNED_BY_DMA | rx_desc->cmd_sts = BUFFER_OWNED_BY_DMA | RX_ENABLE_INTERRUPT;
RX_ENABLE_INTERRUPT;
wmb(); wmb();
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment