aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/mthca/mthca_srq.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/infiniband/hw/mthca/mthca_srq.c')
-rw-r--r--drivers/infiniband/hw/mthca/mthca_srq.c28
1 files changed, 6 insertions, 22 deletions
diff --git a/drivers/infiniband/hw/mthca/mthca_srq.c b/drivers/infiniband/hw/mthca/mthca_srq.c
index b8f05a526673..88d219e730ad 100644
--- a/drivers/infiniband/hw/mthca/mthca_srq.c
+++ b/drivers/infiniband/hw/mthca/mthca_srq.c
@@ -543,20 +543,12 @@ int mthca_tavor_post_srq_recv(struct ib_srq *ibsrq, struct ib_recv_wr *wr,
543 } 543 }
544 544
545 for (i = 0; i < wr->num_sge; ++i) { 545 for (i = 0; i < wr->num_sge; ++i) {
546 ((struct mthca_data_seg *) wqe)->byte_count = 546 mthca_set_data_seg(wqe, wr->sg_list + i);
547 cpu_to_be32(wr->sg_list[i].length);
548 ((struct mthca_data_seg *) wqe)->lkey =
549 cpu_to_be32(wr->sg_list[i].lkey);
550 ((struct mthca_data_seg *) wqe)->addr =
551 cpu_to_be64(wr->sg_list[i].addr);
552 wqe += sizeof (struct mthca_data_seg); 547 wqe += sizeof (struct mthca_data_seg);
553 } 548 }
554 549
555 if (i < srq->max_gs) { 550 if (i < srq->max_gs)
556 ((struct mthca_data_seg *) wqe)->byte_count = 0; 551 mthca_set_data_seg_inval(wqe);
557 ((struct mthca_data_seg *) wqe)->lkey = cpu_to_be32(MTHCA_INVAL_LKEY);
558 ((struct mthca_data_seg *) wqe)->addr = 0;
559 }
560 552
561 ((struct mthca_next_seg *) prev_wqe)->nda_op = 553 ((struct mthca_next_seg *) prev_wqe)->nda_op =
562 cpu_to_be32((ind << srq->wqe_shift) | 1); 554 cpu_to_be32((ind << srq->wqe_shift) | 1);
@@ -662,20 +654,12 @@ int mthca_arbel_post_srq_recv(struct ib_srq *ibsrq, struct ib_recv_wr *wr,
662 } 654 }
663 655
664 for (i = 0; i < wr->num_sge; ++i) { 656 for (i = 0; i < wr->num_sge; ++i) {
665 ((struct mthca_data_seg *) wqe)->byte_count = 657 mthca_set_data_seg(wqe, wr->sg_list + i);
666 cpu_to_be32(wr->sg_list[i].length);
667 ((struct mthca_data_seg *) wqe)->lkey =
668 cpu_to_be32(wr->sg_list[i].lkey);
669 ((struct mthca_data_seg *) wqe)->addr =
670 cpu_to_be64(wr->sg_list[i].addr);
671 wqe += sizeof (struct mthca_data_seg); 658 wqe += sizeof (struct mthca_data_seg);
672 } 659 }
673 660
674 if (i < srq->max_gs) { 661 if (i < srq->max_gs)
675 ((struct mthca_data_seg *) wqe)->byte_count = 0; 662 mthca_set_data_seg_inval(wqe);
676 ((struct mthca_data_seg *) wqe)->lkey = cpu_to_be32(MTHCA_INVAL_LKEY);
677 ((struct mthca_data_seg *) wqe)->addr = 0;
678 }
679 663
680 srq->wrid[ind] = wr->wr_id; 664 srq->wrid[ind] = wr->wr_id;
681 srq->first_free = next_ind; 665 srq->first_free = next_ind;