Skip to content

Commit 0a5ec36

Browse files
mmarcinijgunthorpe
authored andcommitted
RDMA/irdma: Ensure iWarp QP queue memory is OS paged aligned
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]>
1 parent 4fbc3a5 commit 0a5ec36

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
@@ -2946,6 +2946,11 @@ static int irdma_reg_user_mr_type_qp(struct irdma_mem_reg_req req,
29462946
int err;
29472947
u8 lvl;
29482948

2949+
/* iWarp: Catch page not starting on OS page boundary */
2950+
if (!rdma_protocol_roce(&iwdev->ibdev, 1) &&
2951+
ib_umem_offset(iwmr->region))
2952+
return -EINVAL;
2953+
29492954
total = req.sq_pages + req.rq_pages + 1;
29502955
if (total > iwmr->page_cnt)
29512956
return -EINVAL;

0 commit comments

Comments
 (0)