aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/infiniband/hw/mlx4/qp.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/infiniband/hw/mlx4/qp.c b/drivers/infiniband/hw/mlx4/qp.c
index 2ba243084089..f5210c17e312 100644
--- a/drivers/infiniband/hw/mlx4/qp.c
+++ b/drivers/infiniband/hw/mlx4/qp.c
@@ -1200,7 +1200,7 @@ out:
1200} 1200}
1201 1201
1202static int build_mlx_header(struct mlx4_ib_sqp *sqp, struct ib_send_wr *wr, 1202static int build_mlx_header(struct mlx4_ib_sqp *sqp, struct ib_send_wr *wr,
1203 void *wqe) 1203 void *wqe, unsigned *mlx_seg_len)
1204{ 1204{
1205 struct ib_device *ib_dev = &to_mdev(sqp->qp.ibqp.device)->ib_dev; 1205 struct ib_device *ib_dev = &to_mdev(sqp->qp.ibqp.device)->ib_dev;
1206 struct mlx4_wqe_mlx_seg *mlx = wqe; 1206 struct mlx4_wqe_mlx_seg *mlx = wqe;
@@ -1321,7 +1321,9 @@ static int build_mlx_header(struct mlx4_ib_sqp *sqp, struct ib_send_wr *wr,
1321 i = 2; 1321 i = 2;
1322 } 1322 }
1323 1323
1324 return ALIGN(i * sizeof (struct mlx4_wqe_inline_seg) + header_size, 16); 1324 *mlx_seg_len =
1325 ALIGN(i * sizeof (struct mlx4_wqe_inline_seg) + header_size, 16);
1326 return 0;
1325} 1327}
1326 1328
1327static int mlx4_wq_overflow(struct mlx4_ib_wq *wq, int nreq, struct ib_cq *ib_cq) 1329static int mlx4_wq_overflow(struct mlx4_ib_wq *wq, int nreq, struct ib_cq *ib_cq)
@@ -1548,15 +1550,13 @@ int mlx4_ib_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr,
1548 1550
1549 case IB_QPT_SMI: 1551 case IB_QPT_SMI:
1550 case IB_QPT_GSI: 1552 case IB_QPT_GSI:
1551 err = build_mlx_header(to_msqp(qp), wr, ctrl); 1553 err = build_mlx_header(to_msqp(qp), wr, ctrl, &seglen);
1552 if (err < 0) { 1554 if (unlikely(err)) {
1553 *bad_wr = wr; 1555 *bad_wr = wr;
1554 goto out; 1556 goto out;
1555 } 1557 }
1556 wqe += err; 1558 wqe += seglen;
1557 size += err / 16; 1559 size += seglen / 16;
1558
1559 err = 0;
1560 break; 1560 break;
1561 1561
1562 default: 1562 default: