xsk: Clear page contiguity bit when unmapping pool
authorIvan Malov <ivan.malov@oktetlabs.ru>
Tue, 28 Jun 2022 09:18:48 +0000 (12:18 +0300)
committerDaniel Borkmann <daniel@iogearbox.net>
Tue, 28 Jun 2022 20:49:04 +0000 (22:49 +0200)
commit512d1999b8e94a5d43fba3afc73e774849674742
tree1620d5c2ea2fa738a2e8ad3041e234e54e05469f
parent32df6fe110c443763d6749a758f33a7117ec1270
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: 2b43470add8c ("xsk: Introduce AF_XDP buffer allocation API")
Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Magnus Karlsson <magnus.karlsson@intel.com>
Link: https://lore.kernel.org/bpf/20220628091848.534803-1-ivan.malov@oktetlabs.ru
net/xdp/xsk_buff_pool.c