Skip to content

Commit 512d199

Browse files
ol-ivanmalborkmann
authored andcommitted
xsk: Clear page contiguity bit when unmapping pool
When a XSK pool gets mapped, xp_check_dma_contiguity() adds bit 0x1 to pages' DMA addresses that go in ascending order and at 4K stride. The problem is that the bit does not get cleared before doing unmap. As a result, a lot of warnings from iommu_dma_unmap_page() are seen in dmesg, which indicates that lookups by iommu_iova_to_phys() fail. Fixes: 2b43470 ("xsk: Introduce AF_XDP buffer allocation API") Signed-off-by: Ivan Malov <[email protected]> Signed-off-by: Daniel Borkmann <[email protected]> Acked-by: Magnus Karlsson <[email protected]> Link: https://lore.kernel.org/bpf/[email protected]
1 parent 32df6fe commit 512d199

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

net/xdp/xsk_buff_pool.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,7 @@ static void __xp_dma_unmap(struct xsk_dma_map *dma_map, unsigned long attrs)
332332
for (i = 0; i < dma_map->dma_pages_cnt; i++) {
333333
dma = &dma_map->dma_pages[i];
334334
if (*dma) {
335+
*dma &= ~XSK_NEXT_PG_CONTIG_MASK;
335336
dma_unmap_page_attrs(dma_map->dev, *dma, PAGE_SIZE,
336337
DMA_BIDIRECTIONAL, attrs);
337338
*dma = 0;

0 commit comments

Comments
 (0)