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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 12 Jul 2022 14:35:15 +0000 (16:35 +0200)
commite7a1d51009217125e71b2287f0c57909bcca0914
tree588d747cfaba5cd908a3422ba1bc0a6a9ac888e8
parenta2b92fffd51b9b7fddf77427f52a55d2f25a9692
xsk: Clear page contiguity bit when unmapping pool

[ Upstream commit 512d1999b8e94a5d43fba3afc73e774849674742 ]

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
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/xdp/xsk_buff_pool.c