aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/infiniband/hw/mlx4/qp.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/drivers/infiniband/hw/mlx4/qp.c b/drivers/infiniband/hw/mlx4/qp.c
index 8d09aa38fc83..a59c7f04ca18 100644
--- a/drivers/infiniband/hw/mlx4/qp.c
+++ b/drivers/infiniband/hw/mlx4/qp.c
@@ -1183,6 +1183,14 @@ static int mlx4_wq_overflow(struct mlx4_ib_wq *wq, int nreq, struct ib_cq *ib_cq
1183 return cur + nreq >= wq->max_post; 1183 return cur + nreq >= wq->max_post;
1184} 1184}
1185 1185
1186static void set_data_seg(struct mlx4_wqe_data_seg *dseg,
1187 struct ib_sge *sg)
1188{
1189 dseg->byte_count = cpu_to_be32(sg->length);
1190 dseg->lkey = cpu_to_be32(sg->lkey);
1191 dseg->addr = cpu_to_be64(sg->addr);
1192}
1193
1186int mlx4_ib_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr, 1194int mlx4_ib_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr,
1187 struct ib_send_wr **bad_wr) 1195 struct ib_send_wr **bad_wr)
1188{ 1196{
@@ -1313,12 +1321,7 @@ int mlx4_ib_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr,
1313 } 1321 }
1314 1322
1315 for (i = 0; i < wr->num_sge; ++i) { 1323 for (i = 0; i < wr->num_sge; ++i) {
1316 ((struct mlx4_wqe_data_seg *) wqe)->byte_count = 1324 set_data_seg(wqe, wr->sg_list + i);
1317 cpu_to_be32(wr->sg_list[i].length);
1318 ((struct mlx4_wqe_data_seg *) wqe)->lkey =
1319 cpu_to_be32(wr->sg_list[i].lkey);
1320 ((struct mlx4_wqe_data_seg *) wqe)->addr =
1321 cpu_to_be64(wr->sg_list[i].addr);
1322 1325
1323 wqe += sizeof (struct mlx4_wqe_data_seg); 1326 wqe += sizeof (struct mlx4_wqe_data_seg);
1324 size += sizeof (struct mlx4_wqe_data_seg) / 16; 1327 size += sizeof (struct mlx4_wqe_data_seg) / 16;