Re: [PATCH 3/3] cnic,bnx2,bnx2x: use UIO_MEM_DMA_COHERENT

Jacob Keller
2023-09-29T17:19:57Z

On 9/29/2023 10:00 AM, Chris Leech wrote:
> Make use of the new UIO_MEM_DMA_COHERENT type to properly handle mmap
> for dma_alloc_coherent buffers.
>
> The cnic l2_ring and l2_buf mmaps have caused page refcount issues since
> the misuse of the __GFP_COMP flag was removed from their
> dma_alloc_coherent calls. Fix that by having the uio device use
> dma_mmap_coherent.
>
> The bnx2 and bnx2x status block allocations are also dma_alloc_coherent,
> and should use dma_mmap_coherent. They didn't allocate multiple pages,
> but also didn't seem to work correctly with an iommu enabled.
>
> Fixes: bb73955c0b1d ("cnic: don't pass bogus GFP_ flags to dma_alloc_coherent")
> Signed-off-by: Chris Leech <cleech@redhat.com>
> ---

Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>