aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband
diff options
context:
space:
mode:
authorRalph Campbell <ralph.campbell@qlogic.com>2007-08-17 14:28:48 -0400
committerRoland Dreier <rolandd@cisco.com>2007-10-09 23:44:56 -0400
commit55046698faf6357ff7c53593dbfd43a9a3f681a7 (patch)
tree3635486eaad2407d924fdbdce196fb7a020441e0 /drivers/infiniband
parent9ef8617af77136e743e5dd4b081a61797888a977 (diff)
IB/ipath: UC RDMA WRITE with IMMEDIATE doesn't send the immediate
This patch fixes a bug in the receive processing for UC RDMA WRITE with immediate which caused the last packet to be dropped. 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/ipath/ipath_uc.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/drivers/infiniband/hw/ipath/ipath_uc.c b/drivers/infiniband/hw/ipath/ipath_uc.c
index 767beb903c25..2dd8de20d221 100644
--- a/drivers/infiniband/hw/ipath/ipath_uc.c
+++ b/drivers/infiniband/hw/ipath/ipath_uc.c
@@ -464,6 +464,16 @@ void ipath_uc_rcv(struct ipath_ibdev *dev, struct ipath_ib_header *hdr,
464 464
465 case OP(RDMA_WRITE_LAST_WITH_IMMEDIATE): 465 case OP(RDMA_WRITE_LAST_WITH_IMMEDIATE):
466 rdma_last_imm: 466 rdma_last_imm:
467 if (header_in_data) {
468 wc.imm_data = *(__be32 *) data;
469 data += sizeof(__be32);
470 } else {
471 /* Immediate data comes after BTH */
472 wc.imm_data = ohdr->u.imm_data;
473 }
474 hdrsize += 4;
475 wc.wc_flags = IB_WC_WITH_IMM;
476
467 /* Get the number of bytes the message was padded by. */ 477 /* Get the number of bytes the message was padded by. */
468 pad = (be32_to_cpu(ohdr->bth[0]) >> 20) & 3; 478 pad = (be32_to_cpu(ohdr->bth[0]) >> 20) & 3;
469 /* Check for invalid length. */ 479 /* Check for invalid length. */
@@ -484,16 +494,7 @@ void ipath_uc_rcv(struct ipath_ibdev *dev, struct ipath_ib_header *hdr,
484 dev->n_pkt_drops++; 494 dev->n_pkt_drops++;
485 goto done; 495 goto done;
486 } 496 }
487 if (header_in_data) { 497 wc.byte_len = qp->r_len;
488 wc.imm_data = *(__be32 *) data;
489 data += sizeof(__be32);
490 } else {
491 /* Immediate data comes after BTH */
492 wc.imm_data = ohdr->u.imm_data;
493 }
494 hdrsize += 4;
495 wc.wc_flags = IB_WC_WITH_IMM;
496 wc.byte_len = 0;
497 goto last_imm; 498 goto last_imm;
498 499
499 case OP(RDMA_WRITE_LAST): 500 case OP(RDMA_WRITE_LAST):