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

MFC after: 1 week
Reviewed by: kib
Sponsored by: Mellanox Technologies // NVIDIA Networking

Details

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