[ofa-general] [PATCH] libmlx4: fix thinko in headroom marking order commit

Jack Morgenstein jackm at dev.mellanox.co.il
Mon Oct 22 06:30:39 PDT 2007


Fix thinko bug in commit c45efd89ef667b30b84e4f63d8c712d1ebcabde2,
wherein s/g entries were written in forward (rather than
reverse) order.

Signed-off-by: Jack Morgenstein <jackm at dev.mellanox.co.il>

diff --git a/src/qp.c b/src/qp.c
index 8213533..b82029c 100644
--- a/src/qp.c
+++ b/src/qp.c
@@ -344,7 +344,7 @@ int mlx4_post_send(struct ibv_qp *ibqp, struct ibv_send_wr *wr,
 		} else {
 			struct mlx4_wqe_data_seg *seg = wqe;
 
-			for (i = 0; i < wr->num_sge; ++i)
+			for (i = wr->num_sge - 1; i >= 0 ; --i)
 				set_data_seg(seg + i, wr->sg_list + i);
 
 			size += wr->num_sge * (sizeof *seg / 16);



More information about the general mailing list