]> git.openfabrics.org - ~shefty/libmlx4.git/commitdiff
Optimize QP stamping
authorEli Cohen <eli@dev.mellanox.co.il>
Mon, 16 Jun 2008 08:09:18 +0000 (11:09 +0300)
committerRoland Dreier <rolandd@cisco.com>
Mon, 23 Jun 2008 20:24:34 +0000 (13:24 -0700)
Optimize samping by reading the value of the DS field just before we
stamp, which would give the effective size of the descriptor as used
in the previous post and. Then we stamp only that area, since the rest
of the descriptor is already stamped.

Signed-off-by: Eli Cohen <eli@mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
src/qp.c

index 5721860a3ed6fc85abd9e1017546208d56f33de3..bb98c09c8a7c08e60bfc7c067752a0769955c242 100644 (file)
--- a/src/qp.c
+++ b/src/qp.c
@@ -74,8 +74,9 @@ static void stamp_send_wqe(struct mlx4_qp *qp, int n)
 {
        uint32_t *wqe = get_send_wqe(qp, n);
        int i;
+       int ds = (((struct mlx4_wqe_ctrl_seg *)wqe)->fence_size & 0x3f) << 2;
 
-       for (i = 16; i < 1 << (qp->sq.wqe_shift - 2); i += 16)
+       for (i = 16; i < ds; i += 16)
                wqe[i] = 0xffffffff;
 }
 
@@ -95,6 +96,7 @@ void mlx4_qp_init_sq_ownership(struct mlx4_qp *qp)
        for (i = 0; i < qp->sq.wqe_cnt; ++i) {
                ctrl = get_send_wqe(qp, i);
                ctrl->owner_opcode = htonl(1 << 31);
+               ctrl->fence_size = 1 << (qp->sq.wqe_shift - 4);
 
                stamp_send_wqe(qp, i);
        }