Skip to contentSkip to conversation

libmlx4: initialize SRQ scatter entries when creating an SRQ

PATCH New Jack Morgenstein 1 participant 1 message Dec 17, 2009 InfiniBand

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 libmlx4: initialize SRQ scatter entries when creating an SRQ

As in libmthca, need to initialize SRQ WQE scatter entries to the invalid lkey at work queue creation time.

src/srq.c +6 -0
index ba2ceb9..f1d1240 100644
@@ -128,6 +128,7 @@ int mlx4_alloc_srq_buf(struct ibv_pd *pd, struct ibv_srq_attr *attr,
 		       struct mlx4_srq *srq)
 {
 	struct mlx4_wqe_srq_next_seg *next;
+	struct mlx4_wqe_data_seg *scatter;
 	int size;
 	int buf_size;
 	int i;
@@ -160,6 +161,11 @@ int mlx4_alloc_srq_buf(struct ibv_pd *pd, struct ibv_srq_attr *attr,
 	for (i = 0; i < srq->max; ++i) {
 		next = get_wqe(srq, i);
 		next->next_wqe_index = htons((i + 1) & (srq->max - 1));
+
+		for (scatter = (void *) (next + 1);
+		     (void *) scatter < (void *) next + (1 << srq->wqe_shift);
+		     ++scatter)
+			scatter->lkey = htonl(MLX4_INVALID_LKEY);
 	}
 
 	srq->head = 0;

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html