diff options
author | Robert Walsh <robert.walsh@qlogic.com> | 2007-06-18 17:24:48 -0400 |
---|---|---|
committer | Roland Dreier <rolandd@cisco.com> | 2007-07-09 23:12:26 -0400 |
commit | b506e1dc59726a1c608f26e7294b9fe186255139 (patch) | |
tree | ae8550e392380cb953e19ab92ba0ae0716bcc1ab /drivers/infiniband/hw/ipath/ipath_ruc.c | |
parent | e8e7ad711509f576b1bffd92c3ae4672fe92ec48 (diff) |
IB/ipath: Send ACK invalid where appropriate
The IB specification ch. 9.9.3 table 58 says that a QP which isn't set
up for the operation should return a NAK invalid request.
Signed-off-by: Robert Walsh <robert.walsh@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband/hw/ipath/ipath_ruc.c')
-rw-r--r-- | drivers/infiniband/hw/ipath/ipath_ruc.c | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/drivers/infiniband/hw/ipath/ipath_ruc.c b/drivers/infiniband/hw/ipath/ipath_ruc.c index 1b0e62b761bb..d47ad7c8a0d2 100644 --- a/drivers/infiniband/hw/ipath/ipath_ruc.c +++ b/drivers/infiniband/hw/ipath/ipath_ruc.c | |||
@@ -319,12 +319,22 @@ again: | |||
319 | break; | 319 | break; |
320 | 320 | ||
321 | case IB_WR_RDMA_WRITE_WITH_IMM: | 321 | case IB_WR_RDMA_WRITE_WITH_IMM: |
322 | if (unlikely(!(qp->qp_access_flags & | ||
323 | IB_ACCESS_REMOTE_WRITE))) { | ||
324 | wc.status = IB_WC_REM_INV_REQ_ERR; | ||
325 | goto err; | ||
326 | } | ||
322 | wc.wc_flags = IB_WC_WITH_IMM; | 327 | wc.wc_flags = IB_WC_WITH_IMM; |
323 | wc.imm_data = wqe->wr.imm_data; | 328 | wc.imm_data = wqe->wr.imm_data; |
324 | if (!ipath_get_rwqe(qp, 1)) | 329 | if (!ipath_get_rwqe(qp, 1)) |
325 | goto rnr_nak; | 330 | goto rnr_nak; |
326 | /* FALLTHROUGH */ | 331 | /* FALLTHROUGH */ |
327 | case IB_WR_RDMA_WRITE: | 332 | case IB_WR_RDMA_WRITE: |
333 | if (unlikely(!(qp->qp_access_flags & | ||
334 | IB_ACCESS_REMOTE_WRITE))) { | ||
335 | wc.status = IB_WC_REM_INV_REQ_ERR; | ||
336 | goto err; | ||
337 | } | ||
328 | if (wqe->length == 0) | 338 | if (wqe->length == 0) |
329 | break; | 339 | break; |
330 | if (unlikely(!ipath_rkey_ok(qp, &qp->r_sge, wqe->length, | 340 | if (unlikely(!ipath_rkey_ok(qp, &qp->r_sge, wqe->length, |
@@ -354,8 +364,10 @@ again: | |||
354 | 364 | ||
355 | case IB_WR_RDMA_READ: | 365 | case IB_WR_RDMA_READ: |
356 | if (unlikely(!(qp->qp_access_flags & | 366 | if (unlikely(!(qp->qp_access_flags & |
357 | IB_ACCESS_REMOTE_READ))) | 367 | IB_ACCESS_REMOTE_READ))) { |
358 | goto acc_err; | 368 | wc.status = IB_WC_REM_INV_REQ_ERR; |
369 | goto err; | ||
370 | } | ||
359 | if (unlikely(!ipath_rkey_ok(qp, &sqp->s_sge, wqe->length, | 371 | if (unlikely(!ipath_rkey_ok(qp, &sqp->s_sge, wqe->length, |
360 | wqe->wr.wr.rdma.remote_addr, | 372 | wqe->wr.wr.rdma.remote_addr, |
361 | wqe->wr.wr.rdma.rkey, | 373 | wqe->wr.wr.rdma.rkey, |
@@ -369,8 +381,10 @@ again: | |||
369 | case IB_WR_ATOMIC_CMP_AND_SWP: | 381 | case IB_WR_ATOMIC_CMP_AND_SWP: |
370 | case IB_WR_ATOMIC_FETCH_AND_ADD: | 382 | case IB_WR_ATOMIC_FETCH_AND_ADD: |
371 | if (unlikely(!(qp->qp_access_flags & | 383 | if (unlikely(!(qp->qp_access_flags & |
372 | IB_ACCESS_REMOTE_ATOMIC))) | 384 | IB_ACCESS_REMOTE_ATOMIC))) { |
373 | goto acc_err; | 385 | wc.status = IB_WC_REM_INV_REQ_ERR; |
386 | goto err; | ||
387 | } | ||
374 | if (unlikely(!ipath_rkey_ok(qp, &qp->r_sge, sizeof(u64), | 388 | if (unlikely(!ipath_rkey_ok(qp, &qp->r_sge, sizeof(u64), |
375 | wqe->wr.wr.atomic.remote_addr, | 389 | wqe->wr.wr.atomic.remote_addr, |
376 | wqe->wr.wr.atomic.rkey, | 390 | wqe->wr.wr.atomic.rkey, |