Skip to contentSkip to conversation

mlx4_ib: initialize SRQ scatter entries when creating an SRQ

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

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 2/2 mlx4_ib: initialize SRQ scatter entries when creating an SRQ

As in the mthca-memfree driver, need to initialize SRQ WQE scatter entries to the invalid lkey at work queue creation time.

drivers/infiniband/hw/mlx4/srq.c +7 -0
index d425652..403ccbc 100644
@@ -130,6 +130,8 @@ struct ib_srq *mlx4_ib_create_srq(struct ib_pd *pd,
 		if (err)
 			goto err_mtt;
 	} else {
+		struct mlx4_wqe_data_seg *scatter;
+
 		err = mlx4_db_alloc(dev->dev, &srq->db, 0);
 		if (err)
 			goto err_srq;
@@ -149,6 +151,11 @@ struct ib_srq *mlx4_ib_create_srq(struct ib_pd *pd,
 			next = get_wqe(srq, i);
 			next->next_wqe_index =
 				cpu_to_be16((i + 1) & (srq->msrq.max - 1));
+
+			for (scatter = (void *) (next + 1);
+			     (void *) scatter < (void *) next + desc_size;
+			     ++scatter)
+				scatter->lkey = cpu_to_be32(MLX4_INVALID_LKEY);
 		}
 
 		err = mlx4_mtt_init(dev->dev, srq->buf.npages, srq->buf.page_shift,

--
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