aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/i40iw
diff options
context:
space:
mode:
authorShiraz Saleem <shiraz.saleem@intel.com>2016-04-22 14:14:27 -0500
committerDoug Ledford <dledford@redhat.com>2016-04-28 16:32:55 -0400
commit6c2f76197db63e337fb60b16800f234f6428c32d (patch)
tree79455cd597ad9fc279161c57a7e2dad8f032c981 /drivers/infiniband/hw/i40iw
parentRDMA/i40iw: Fix for the size of kernel mode SQ (diff)
downloadlinux-dev-6c2f76197db63e337fb60b16800f234f6428c32d.tar.xz
linux-dev-6c2f76197db63e337fb60b16800f234f6428c32d.zip
RDMA/i40iw: Fix for using one sge for RDMA READ
A check is added to validate the requested sge number. iWARP doesn't support multiple sg elements for RDMA READ work requests. Signed-off-by: Tatyana Nikolova <tatyana.e.nikolova@intel.com> Signed-off-by: Faisal Latif <faisal.latif@intel.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 2d832c758c66..45f70f5e14a7 100644
--- a/drivers/infiniband/hw/i40iw/i40iw_verbs.c
+++ b/drivers/infiniband/hw/i40iw/i40iw_verbs.c
@@ -74,7 +74,7 @@ static int i40iw_query_device(struct ib_device *ibdev,
props->max_cqe = iwdev->max_cqe;
props->max_mr = iwdev->max_mr;
props->max_pd = iwdev->max_pd;
- props->max_sge_rd = 1;
+ props->max_sge_rd = I40IW_MAX_SGE_RD;
props->max_qp_rd_atom = I40IW_MAX_IRD_SIZE;
props->max_qp_init_rd_atom = props->max_qp_rd_atom;
props->atomic_cap = IB_ATOMIC_NONE;
@@ -2117,6 +2117,10 @@ static int i40iw_post_send(struct ib_qp *ibqp,
inv_stag = true;
/* fall-through*/
case IB_WR_RDMA_READ:
+ if (ib_wr->num_sge > I40IW_MAX_SGE_RD) {
+ err = -EINVAL;
+ break;
+ }
info.op_type = I40IW_OP_TYPE_RDMA_READ;
info.op.rdma_read.rem_addr.tag_off = rdma_wr(ib_wr)->remote_addr;
info.op.rdma_read.rem_addr.stag = rdma_wr(ib_wr)->rkey;