Skip to content

Commit

Permalink
RDMA/irdma: Validate max_send_wr and max_recv_wr
Browse files Browse the repository at this point in the history
[ Upstream commit ee10718 ]

Validate that max_send_wr and max_recv_wr is within the
supported range.

Fixes: b48c24c ("RDMA/irdma: Implement device supported verb APIs")
Change-Id: I2fc8b10292b641fddd20b36986a9dae90a93f4be
Signed-off-by: Shiraz Saleem <shiraz.saleem@intel.com>
Signed-off-by: Sindhu Devale <sindhu.devale@intel.com>
Link: https://lore.kernel.org/r/20240131233849.400285-3-sindhu.devale@intel.com
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
shirazsaleem authored and gregkh committed Mar 1, 2024
1 parent c6f1ca2 commit 9afa1e4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/infiniband/hw/irdma/verbs.c
Original file line number Diff line number Diff line change
Expand Up @@ -839,7 +839,9 @@ static int irdma_validate_qp_attrs(struct ib_qp_init_attr *init_attr,

if (init_attr->cap.max_inline_data > uk_attrs->max_hw_inline ||
init_attr->cap.max_send_sge > uk_attrs->max_hw_wq_frags ||
init_attr->cap.max_recv_sge > uk_attrs->max_hw_wq_frags)
init_attr->cap.max_recv_sge > uk_attrs->max_hw_wq_frags ||
init_attr->cap.max_send_wr > uk_attrs->max_hw_wq_quanta ||
init_attr->cap.max_recv_wr > uk_attrs->max_hw_rq_quanta)
return -EINVAL;

if (rdma_protocol_roce(&iwdev->ibdev, 1)) {
Expand Down

0 comments on commit 9afa1e4

Please sign in to comment.