Skip to content

Commit 12a7757

Browse files
mmarcinigregkh
authored andcommitted
RDMA/irdma: Ensure iWarp QP queue memory is OS paged aligned
[ Upstream commit 0a5ec36 ] The SQ is shared for between kernel and used by storing the kernel page pointer and passing that to a kmap_atomic(). This then requires that the alignment is PAGE_SIZE aligned. Fix by adding an iWarp specific alignment check. Fixes: e965ef0 ("RDMA/irdma: Split QP handler into irdma_reg_user_mr_type_qp") Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mike Marciniszyn <[email protected]> Signed-off-by: Shiraz Saleem <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent d103c13 commit 12a7757

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

drivers/infiniband/hw/irdma/verbs.c

+5
Original file line numberDiff line numberDiff line change
@@ -2935,6 +2935,11 @@ static int irdma_reg_user_mr_type_qp(struct irdma_mem_reg_req req,
29352935
int err;
29362936
u8 lvl;
29372937

2938+
/* iWarp: Catch page not starting on OS page boundary */
2939+
if (!rdma_protocol_roce(&iwdev->ibdev, 1) &&
2940+
ib_umem_offset(iwmr->region))
2941+
return -EINVAL;
2942+
29382943
total = req.sq_pages + req.rq_pages + 1;
29392944
if (total > iwmr->page_cnt)
29402945
return -EINVAL;

0 commit comments

Comments
 (0)