[ofa-general] [PATCH] libmlx4: Fix the value of the pkey_index in the completion

Dotan Barak dotanb at dev.mellanox.co.il
Sun Jan 6 08:01:25 PST 2008


Fix the value of the pkey_index in the completion to get a valid value for GSI QPs.

Signed-off-by: Dotan Barak <dotanb at dev.mellanox.co.il>

---


diff --git a/src/cq.c b/src/cq.c
index 06ae9e2..33823c8 100644
--- a/src/cq.c
+++ b/src/cq.c
@@ -319,7 +319,7 @@ static int mlx4_poll_one(struct mlx4_cq *cq,
 		wc->src_qp	   = g_mlpath_rqpn & 0xffffff;
 		wc->dlid_path_bits = (g_mlpath_rqpn >> 24) & 0x7f;
 		wc->wc_flags	  |= g_mlpath_rqpn & 0x80000000 ? IBV_WC_GRH : 0;
-		wc->pkey_index     = ntohl(cqe->immed_rss_invalid) >> 16;
+		wc->pkey_index     = (uint16_t)(ntohl(cqe->immed_rss_invalid) & 0x7f);
 	}
 
 	return CQ_OK;



More information about the general mailing list