diff options
Diffstat (limited to 'drivers/infiniband')
-rw-r--r-- | drivers/infiniband/hw/ipath/ipath_uc.c | 21 |
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): |