[openib-general] [PATCH] rq formatting for arbel-native

Michael S. Tsirkin mst at mellanox.co.il
Tue Mar 8 07:52:16 PST 2005


For arbel native, the ee_nds field in the receive queue must include the
rq max_gs value (plus header), and not according to the wqe shift value.
This differs from current documentation, documentation will be updated.
This patch is required to make memfree work on MT25204.

Signed-off-by: Michael S. Tsirkin <mst at mellanox.co.il>


Index: hw/mthca/mthca_qp.c
===================================================================
--- hw/mthca/mthca_qp.c	(revision 1943)
+++ hw/mthca/mthca_qp.c	(working copy)
@@ -1119,10 +1119,15 @@ static int mthca_alloc_qp_common(struct 
 
 	if (dev->hca_type == ARBEL_NATIVE) {
 		for (i = 0; i < qp->rq.max; ++i) {
+			int size;
 			wqe = get_recv_wqe(qp, i);
 			wqe->nda_op = cpu_to_be32(((i + 1) & (qp->rq.max - 1)) <<
 						  qp->rq.wqe_shift);
-			wqe->ee_nds = cpu_to_be32(1 << (qp->rq.wqe_shift - 4));
+
+			size = sizeof (struct mthca_next_seg) +
+				qp->rq.max_gs * sizeof (struct mthca_data_seg);
+
+			wqe->ee_nds = cpu_to_be32(size / 16);
 		}
 
 		for (i = 0; i < qp->sq.max; ++i) {

-- 
MST - Michael S. Tsirkin



More information about the general mailing list