[ofa-general] [PATCH] IB/mlx4: Optimize stamping for selective signalling QPs

Eli Cohen eli at mellanox.co.il
Wed May 21 05:59:29 PDT 2008


>From e6b956c2233669fc21ba1565fbcf78ce2cd186b7 Mon Sep 17 00:00:00 2001
From: Eli Cohen <eli at mellanox.co.il>
Date: Wed, 21 May 2008 15:55:51 +0300
Subject: [PATCH] IB/mlx4: Optimize stamping for selective signalling QPs

The idea is that for selective signaling QPs, before stamping the WQE,
you read the value of the DS field which denotes the effective size of the
descriptor as used in the previous post, and stamp only that area, relying
on the fact that the rest of the descriptor is already stamped.

Signed-off-by: Eli Cohen <eli at mellanox.co.il>
---

This version cleanly applies on the head of the "for-2.6.26" branch.

 drivers/infiniband/hw/mlx4/qp.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/infiniband/hw/mlx4/qp.c b/drivers/infiniband/hw/mlx4/qp.c
index cec030e..b4d25c2 100644
--- a/drivers/infiniband/hw/mlx4/qp.c
+++ b/drivers/infiniband/hw/mlx4/qp.c
@@ -129,9 +129,10 @@ static void stamp_send_wqe(struct mlx4_ib_qp *qp, int n, int size)
 	int ind;
 	void *buf;
 	__be32 stamp;
+        struct mlx4_wqe_ctrl_seg *ctrl;
 
-	s = roundup(size, 1U << qp->sq.wqe_shift);
 	if (qp->sq_max_wqes_per_wr > 1) {
+		s = roundup(size, 1U << qp->sq.wqe_shift);
 		for (i = 0; i < s; i += 64) {
 			ind = (i >> qp->sq.wqe_shift) + n;
 			stamp = ind & qp->sq.wqe_cnt ? cpu_to_be32(0x7fffffff) :
@@ -141,7 +142,8 @@ static void stamp_send_wqe(struct mlx4_ib_qp *qp, int n, int size)
 			*wqe = stamp;
 		}
 	} else {
-		buf = get_send_wqe(qp, n & (qp->sq.wqe_cnt - 1));
+		ctrl = buf = get_send_wqe(qp, n & (qp->sq.wqe_cnt - 1));
+		s = (ctrl->fence_size & 0x3f) << 4;
 		for (i = 64; i < s; i += 64) {
 			wqe = buf + i;
 			*wqe = cpu_to_be32(0xffffffff);
-- 
1.5.5.1






More information about the general mailing list