Commit b64bf4b7 authored by Nimrod Andy's avatar Nimrod Andy Committed by David S. Miller

net: fec: align rx data buffer size for dma map/unmap

Align allocated rx data buffer size for dma map/unmap, otherwise
kernel print warning when enable DMA_API_DEBUG.
Signed-off-by: default avatarFugang Duan <B38611@freescale.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent f88c7ede
...@@ -1403,7 +1403,8 @@ fec_enet_rx_queue(struct net_device *ndev, int budget, u16 queue_id) ...@@ -1403,7 +1403,8 @@ fec_enet_rx_queue(struct net_device *ndev, int budget, u16 queue_id)
index = fec_enet_get_bd_index(rxq->rx_bd_base, bdp, fep); index = fec_enet_get_bd_index(rxq->rx_bd_base, bdp, fep);
data = rxq->rx_skbuff[index]->data; data = rxq->rx_skbuff[index]->data;
dma_sync_single_for_cpu(&fep->pdev->dev, bdp->cbd_bufaddr, dma_sync_single_for_cpu(&fep->pdev->dev, bdp->cbd_bufaddr,
FEC_ENET_RX_FRSIZE, DMA_FROM_DEVICE); FEC_ENET_RX_FRSIZE - fep->rx_align,
DMA_FROM_DEVICE);
if (id_entry->driver_data & FEC_QUIRK_SWAP_FRAME) if (id_entry->driver_data & FEC_QUIRK_SWAP_FRAME)
swap_buffer(data, pkt_len); swap_buffer(data, pkt_len);
...@@ -1475,7 +1476,8 @@ fec_enet_rx_queue(struct net_device *ndev, int budget, u16 queue_id) ...@@ -1475,7 +1476,8 @@ fec_enet_rx_queue(struct net_device *ndev, int budget, u16 queue_id)
} }
dma_sync_single_for_device(&fep->pdev->dev, bdp->cbd_bufaddr, dma_sync_single_for_device(&fep->pdev->dev, bdp->cbd_bufaddr,
FEC_ENET_RX_FRSIZE, DMA_FROM_DEVICE); FEC_ENET_RX_FRSIZE - fep->rx_align,
DMA_FROM_DEVICE);
rx_processing_done: rx_processing_done:
/* Clear the status flags for this buffer */ /* Clear the status flags for this buffer */
status &= ~BD_ENET_RX_STATS; status &= ~BD_ENET_RX_STATS;
...@@ -2448,7 +2450,7 @@ static void fec_enet_free_buffers(struct net_device *ndev) ...@@ -2448,7 +2450,7 @@ static void fec_enet_free_buffers(struct net_device *ndev)
if (skb) { if (skb) {
dma_unmap_single(&fep->pdev->dev, dma_unmap_single(&fep->pdev->dev,
bdp->cbd_bufaddr, bdp->cbd_bufaddr,
FEC_ENET_RX_FRSIZE, FEC_ENET_RX_FRSIZE - fep->rx_align,
DMA_FROM_DEVICE); DMA_FROM_DEVICE);
dev_kfree_skb(skb); dev_kfree_skb(skb);
} }
......
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