]> git.openfabrics.org - ~shefty/libmlx4.git/commitdiff
Fix returned max_inline_data QP cap
authorRoland Dreier <rolandd@cisco.com>
Sat, 16 Jun 2007 21:27:38 +0000 (14:27 -0700)
committerRoland Dreier <rolandd@cisco.com>
Sat, 16 Jun 2007 21:27:38 +0000 (14:27 -0700)
Set the value of max_inline_data that is returned in the QP caps from
mlx4_create_qp() after we calculate the real value, rather than just
returning whatever uninitialized junk is in qp->max_inline_data before
it is set.

Signed-off-by: Roland Dreier <rolandd@cisco.com>
src/qp.c

index 0d536233148323b96b3c694202b945eab29405f7..8f4bc0f8d1ed5634572050e5902312398eb67ef6 100644 (file)
--- a/src/qp.c
+++ b/src/qp.c
@@ -583,7 +583,6 @@ void mlx4_set_sq_sizes(struct mlx4_qp *qp, struct ibv_qp_cap *cap,
 
        qp->sq.max_gs        = wqe_size / sizeof (struct mlx4_wqe_data_seg);
        cap->max_send_sge    = qp->sq.max_gs;
-       cap->max_inline_data = qp->max_inline_data;
        qp->sq.max_post      = qp->sq.wqe_cnt - qp->sq_spare_wqes;
        cap->max_send_wr     = qp->sq.max_post;
 
@@ -596,6 +595,7 @@ void mlx4_set_sq_sizes(struct mlx4_qp *qp, struct ibv_qp_cap *cap,
        qp->max_inline_data  = wqe_size -
                sizeof (struct mlx4_wqe_inline_seg) *
                (align(wqe_size, MLX4_INLINE_ALIGN) / MLX4_INLINE_ALIGN);
+       cap->max_inline_data = qp->max_inline_data;
 }
 
 struct mlx4_qp *mlx4_find_qp(struct mlx4_context *ctx, uint32_t qpn)