aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband
diff options
context:
space:
mode:
authorJason Gunthorpe <jgunthorpe@obsidianresearch.com>2010-10-22 18:00:48 -0400
committerRoland Dreier <rolandd@cisco.com>2010-10-23 01:12:15 -0400
commit5715f5d44b93507693feca6c62290e123e5ef688 (patch)
tree45c739a21a57736c32be1794f321ef9589336dbe /drivers/infiniband
parent0f2f930a67c763a71aacfdbc76de9a76de7d1a9e (diff)
IB/qib: Process RDMA WRITE ONLY with IMMEDIATE properly
See table 35 in IBA - the header order for RDMA_WRITE_ONLY_WITH_IMMEDIATE and SEND_LAST_WITH_IMMEDIATE is different: the RDMA_WRITE_ONLY has a RETH header before the immediate data, so we need a different code path to extract the immediate data. I tested this with a userspace app that does RDMA_WRITE with immediate on a QLE7140. Signed-off-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com> Signed-off-by: Ralph Campbell <ralph.campbell@qlogic.com> Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r--drivers/infiniband/hw/qib/qib_rc.c5
-rw-r--r--drivers/infiniband/hw/qib/qib_uc.c6
2 files changed, 8 insertions, 3 deletions
diff --git a/drivers/infiniband/hw/qib/qib_rc.c b/drivers/infiniband/hw/qib/qib_rc.c
index a0931119bd78..955fb7157793 100644
--- a/drivers/infiniband/hw/qib/qib_rc.c
+++ b/drivers/infiniband/hw/qib/qib_rc.c
@@ -2068,7 +2068,10 @@ send_last:
2068 goto nack_op_err; 2068 goto nack_op_err;
2069 if (!ret) 2069 if (!ret)
2070 goto rnr_nak; 2070 goto rnr_nak;
2071 goto send_last_imm; 2071 wc.ex.imm_data = ohdr->u.rc.imm_data;
2072 hdrsize += 4;
2073 wc.wc_flags = IB_WC_WITH_IMM;
2074 goto send_last;
2072 2075
2073 case OP(RDMA_READ_REQUEST): { 2076 case OP(RDMA_READ_REQUEST): {
2074 struct qib_ack_entry *e; 2077 struct qib_ack_entry *e;
diff --git a/drivers/infiniband/hw/qib/qib_uc.c b/drivers/infiniband/hw/qib/qib_uc.c
index b9c8b6346c1b..32ccf3c824ca 100644
--- a/drivers/infiniband/hw/qib/qib_uc.c
+++ b/drivers/infiniband/hw/qib/qib_uc.c
@@ -457,8 +457,10 @@ rdma_first:
457 } 457 }
458 if (opcode == OP(RDMA_WRITE_ONLY)) 458 if (opcode == OP(RDMA_WRITE_ONLY))
459 goto rdma_last; 459 goto rdma_last;
460 else if (opcode == OP(RDMA_WRITE_ONLY_WITH_IMMEDIATE)) 460 else if (opcode == OP(RDMA_WRITE_ONLY_WITH_IMMEDIATE)) {
461 wc.ex.imm_data = ohdr->u.rc.imm_data;
461 goto rdma_last_imm; 462 goto rdma_last_imm;
463 }
462 /* FALLTHROUGH */ 464 /* FALLTHROUGH */
463 case OP(RDMA_WRITE_MIDDLE): 465 case OP(RDMA_WRITE_MIDDLE):
464 /* Check for invalid length PMTU or posted rwqe len. */ 466 /* Check for invalid length PMTU or posted rwqe len. */
@@ -471,8 +473,8 @@ rdma_first:
471 break; 473 break;
472 474
473 case OP(RDMA_WRITE_LAST_WITH_IMMEDIATE): 475 case OP(RDMA_WRITE_LAST_WITH_IMMEDIATE):
474rdma_last_imm:
475 wc.ex.imm_data = ohdr->u.imm_data; 476 wc.ex.imm_data = ohdr->u.imm_data;
477rdma_last_imm:
476 hdrsize += 4; 478 hdrsize += 4;
477 wc.wc_flags = IB_WC_WITH_IMM; 479 wc.wc_flags = IB_WC_WITH_IMM;
478 480