提交 3ed3a83e 编写于 作者: M Michael Chan 提交者: David S. Miller

bnxt_en: Fix DMA unmapping of the RX buffers in XDP mode during shutdown.

In bnxt_free_rx_skbs(), which is called to free up all RX buffers during
shutdown, we need to unmap the page if we are running in XDP mode.

Fixes: c61fb99c ("bnxt_en: Add RX page mode support.")
Signed-off-by: NMichael Chan <michael.chan@broadcom.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 23e12c89
......@@ -1983,20 +1983,25 @@ static void bnxt_free_rx_skbs(struct bnxt *bp)
for (j = 0; j < max_idx; j++) {
struct bnxt_sw_rx_bd *rx_buf = &rxr->rx_buf_ring[j];
dma_addr_t mapping = rx_buf->mapping;
void *data = rx_buf->data;
if (!data)
continue;
dma_unmap_single(&pdev->dev, rx_buf->mapping,
bp->rx_buf_use_size, bp->rx_dir);
rx_buf->data = NULL;
if (BNXT_RX_PAGE_MODE(bp))
if (BNXT_RX_PAGE_MODE(bp)) {
mapping -= bp->rx_dma_offset;
dma_unmap_page(&pdev->dev, mapping,
PAGE_SIZE, bp->rx_dir);
__free_page(data);
else
} else {
dma_unmap_single(&pdev->dev, mapping,
bp->rx_buf_use_size,
bp->rx_dir);
kfree(data);
}
}
for (j = 0; j < max_agg_idx; j++) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册