• Ilya Lesokhin's avatar
    IB/mlx5: Simplify mlx5_ib_cont_pages · d67bc5d4
    Ilya Lesokhin authored
    The patch simplifies mlx5_ib_cont_pages and fixes the following
    issues in the original implementation:
    
    First issues is related to alignment of the PFNs. After the check
    base + p != PFN, the alignment of the PFN wasn't checked. So the PFN
    sequence 0, 1, 1, 2 would result in a page_shift of 13 even though
    the 3rd PFN is not 8KB aligned.
    
    This wasn't actually a bug because it was supported by all the
    existing mlx5 compatible device, but we don't want to require
    this support in all future devices.
    
    Another issue is because the inner loop didn't advance PFN so
    the test "if (base + p != pfn)" always failed for SGE with
    len > (1<<page_shift).
    
    Fixes: e126ba97 ("mlx5: Add driver for Mellanox Connect-IB adapters")
    Signed-off-by: default avatarIlya Lesokhin <ilyal@mellanox.com>
    Reviewed-by: default avatarEli Cohen <eli@mellanox.com>
    Signed-off-by: default avatarLeon Romanovsky <leon@kernel.org>
    Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
    d67bc5d4
mem.c 6.08 KB