diff options
author | Eli Cohen <eli@dev.mellanox.co.il> | 2008-06-16 11:09:18 +0300 |
---|---|---|
committer | Roland Dreier <rolandd@cisco.com> | 2008-06-23 13:24:34 -0700 |
commit | 80c5a3720ed111b202809671b3614f84cb1d3724 (patch) | |
tree | dbfd17d9ef2b7e3f8b5a8b875f88676c6dd2c86c | |
parent | cb026cc2b080322a51f23fe06a661c1f31afde0d (diff) | |
download | libmlx4-80c5a3720ed111b202809671b3614f84cb1d3724.tar.gz |
Optimize QP stamping
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>
-rw-r--r-- | src/qp.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -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); } |