HomeFreeBSD

mlx5ib: Simplify mlx5_ib_cont_pages()

Description

mlx5ib: Simplify mlx5_ib_cont_pages()

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).

Linux commit:
d67bc5d4e3e100d762c0f57ea67f28bc219698a6

Reviewed by: kib
Sponsored by: Mellanox Technologies // NVIDIA Networking

(cherry picked from commit 21bc3710a4b46655067cbad54d1f21952c871dd2)

Details

Provenance
hselaskyAuthored on Jun 16 2021, 1:01 PM
Parents
rG6b49b46f2692: mlx5en: Add more error checks in the transmit path.
Branches
Unknown
Tags
Unknown