summaryrefslogtreecommitdiff
path: root/drivers/infiniband/hw/i40iw
diff options
context:
space:
mode:
authorHenry Orosco <henry.orosco@intel.com>2016-11-09 21:26:39 -0600
committerDoug Ledford <dledford@redhat.com>2016-12-05 16:09:34 -0500
commit01d0b36798732d826fbf84de8961a09b3a2fbf3f (patch)
treea3dcecf8161e3b4df1a7c860d98dae914ea2ff64 /drivers/infiniband/hw/i40iw
parente69c5093617afdbd2ab02c289d0adaac044dff66 (diff)
i40iw: Correct values for max_recv_sge, max_send_sge
When creating QPs, ensure init_attr->cap.max_recv_sge is clipped to MAX_FRAG_COUNT. Expose MAX_FRAG_COUNT for max_recv_sge and max_send_sge in i40iw_query_qp(). Signed-off-by: Shiraz Saleem <shiraz.saleem@intel.com> Signed-off-by: Henry Orosco <henry.orosco@intel.com> Reviewed-By: Leon Romanovsky <leonro@mellanox.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'drivers/infiniband/hw/i40iw')
-rw-r--r--drivers/infiniband/hw/i40iw/i40iw_verbs.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/infiniband/hw/i40iw/i40iw_verbs.c b/drivers/infiniband/hw/i40iw/i40iw_verbs.c
index aacaa0fcfb77..6b516d6156dc 100644
--- a/drivers/infiniband/hw/i40iw/i40iw_verbs.c
+++ b/drivers/infiniband/hw/i40iw/i40iw_verbs.c
@@ -608,6 +608,9 @@ static struct ib_qp *i40iw_create_qp(struct ib_pd *ibpd,
if (init_attr->cap.max_send_sge > I40IW_MAX_WQ_FRAGMENT_COUNT)
init_attr->cap.max_send_sge = I40IW_MAX_WQ_FRAGMENT_COUNT;
+ if (init_attr->cap.max_recv_sge > I40IW_MAX_WQ_FRAGMENT_COUNT)
+ init_attr->cap.max_recv_sge = I40IW_MAX_WQ_FRAGMENT_COUNT;
+
memset(&init_info, 0, sizeof(init_info));
sq_size = init_attr->cap.max_send_wr;
@@ -813,8 +816,9 @@ static int i40iw_query_qp(struct ib_qp *ibqp,
attr->qp_access_flags = 0;
attr->cap.max_send_wr = qp->qp_uk.sq_size;
attr->cap.max_recv_wr = qp->qp_uk.rq_size;
- attr->cap.max_recv_sge = 1;
attr->cap.max_inline_data = I40IW_MAX_INLINE_DATA_SIZE;
+ attr->cap.max_send_sge = I40IW_MAX_WQ_FRAGMENT_COUNT;
+ attr->cap.max_recv_sge = I40IW_MAX_WQ_FRAGMENT_COUNT;
init_attr->event_handler = iwqp->ibqp.event_handler;
init_attr->qp_context = iwqp->ibqp.qp_context;
init_attr->send_cq = iwqp->ibqp.send_cq;