Skip to content

Commit

Permalink
providers/irdma: Verify max_send_wr and max_recv_wr
Browse files Browse the repository at this point in the history
[ Upstream commit 03034ff ]

Make sure to verify that the provided max_send_wr and max_recv_wr are in
the supported range.

Fixes: 14a0fc8 ("rdma-core/irdma: Implement device supported verb APIs")
Signed-off-by: Kamal Heib <[email protected]>
Signed-off-by: Nicolas Morey <[email protected]>
  • Loading branch information
Kamalheib authored and nmorey committed Sep 4, 2023
1 parent a88e3c5 commit b2343b1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions providers/irdma/uverbs.c
Original file line number Diff line number Diff line change
Expand Up @@ -1328,6 +1328,8 @@ struct ibv_qp *irdma_ucreate_qp(struct ibv_pd *pd,

if (attr->cap.max_send_sge > uk_attrs->max_hw_wq_frags ||
attr->cap.max_recv_sge > uk_attrs->max_hw_wq_frags ||
attr->cap.max_send_wr > uk_attrs->max_hw_wq_quanta ||
attr->cap.max_recv_wr > uk_attrs->max_hw_rq_quanta ||
attr->cap.max_inline_data > uk_attrs->max_hw_inline) {
errno = EINVAL;
return NULL;
Expand Down

0 comments on commit b2343b1

Please sign in to comment.