Skip to contentSkip to conversation

mlx4: Non-xrc SRQs need an xrcd which will never be used by xrc

PATCH In review Jack Morgenstein 2 participants 3 messages Jun 22, 2011 2 messages not in the archive

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

PATCH 1/1 mlx4: Non-xrc SRQs need an xrcd which will never be used by xrc

Non-xrc SRQs should be created with a domain number which will never be assigned to an XRC TGT QP. This is so there is no possibility of such an SRQ inadvertently receiving an XRC transmission.

XRC Domain number allocations begin with (dev->dev->caps.reserved_xrcds + 1); Domain number (dev->dev->caps.reserved_xrcds) has been set aside to be used for this purpose.

---
Sean,
This was a little "glitch" that I noticed during my code review.

-Jack

drivers/infiniband/hw/mlx4/srq.c +3 -2
index 361838f..39542f3 100644
@@ -77,7 +77,7 @@ struct ib_srq *mlx4_ib_create_srq(struct ib_pd *pd,
 	struct mlx4_wqe_srq_next_seg *next;
 	struct mlx4_wqe_data_seg *scatter;
 	u32 cqn;
-	u32 xrcdn;
+	u16 xrcdn;
 	int desc_size;
 	int buf_size;
 	int err;
@@ -179,7 +179,8 @@ struct ib_srq *mlx4_ib_create_srq(struct ib_pd *pd,
 	cqn = (init_attr->srq_type == IB_SRQT_XRC) ?
 		to_mcq(init_attr->ext.xrc.cq)->mcq.cqn : 0;
 	xrcdn = (init_attr->srq_type == IB_SRQT_XRC) ?
-		to_mxrcd(init_attr->ext.xrc.xrcd)->xrcdn : 0;
+		to_mxrcd(init_attr->ext.xrc.xrcd)->xrcdn :
+		(u16) dev->dev->caps.reserved_xrcds;
 	err = mlx4_srq_alloc(dev->dev, to_mpd(pd)->pdn, cqn, xrcdn, &srq->mtt,
 			     srq->db.dma, &srq->msrq);
 	if (err)

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

#2 lore raw
In reply to a message not in the archive
Quoted 11 lines

Non-xrc SRQs should be created with a domain number which will never be assigned to an XRC TGT QP. This is so there is no possibility of such an SRQ
inadvertently receiving an XRC transmission.

XRC Domain number allocations begin with (dev->dev->caps.reserved_xrcds + 1);
Domain number (dev->dev->caps.reserved_xrcds) has been set aside to be used
for this purpose.

Quoted 5 lines

---
Sean,
This was a little "glitch" that I noticed during my code review.

Thanks - If it's okay, I'll merge this change into the existing patches.

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

#4 lore raw
In reply to a message not in the archive
Quoted 4 lines · Sean

Sean,

Quoted 1 line

This was a little "glitch" that I noticed during my code review.

Thanks - If it's okay, I'll merge this change into the existing patches.

That's just fine!

-Jack

Quoted 2 lines

- Sean

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