RDMA/mlx5: Use mlx5_umem_find_best_quantized_pgoff() for WQ
authorJason Gunthorpe <jgg@nvidia.com>
Sun, 15 Nov 2020 11:43:06 +0000 (13:43 +0200)
committerJason Gunthorpe <jgg@nvidia.com>
Mon, 16 Nov 2020 20:53:29 +0000 (16:53 -0400)
commitad480ea5d6ea605bf63d23f5f91447d5cac3c95e
tree8f903143b87a2a3a39dd9d36e4b3270e1fd1c9e4
parentb045db62f6f61c2f0f993696abe620379db34163
RDMA/mlx5: Use mlx5_umem_find_best_quantized_pgoff() for WQ

This fixes a subtle bug, the WQ mailbox has only 5 bits to describe the
page_offset, while mlx5_ib_get_buf_offset() is hard wired to only work
with 6 bit page_offsets.

Thus it did not properly reject badly aligned buffers.

Fixes: 79b20a6c3014 ("IB/mlx5: Add receive Work Queue verbs")
Fixes: 0fb2ed66a14c ("IB/mlx5: Add create and destroy functionality for Raw Packet QP")
Link: https://lore.kernel.org/r/20201115114311.136250-3-leon@kernel.org
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
drivers/infiniband/hw/mlx5/qp.c