[openib-general] SA multicast patches

Roland Dreier rdreier at cisco.com
Fri Feb 16 09:43:17 PST 2007


 > The pkey is the default partition, full membership pkey.  I believe
 > all nodes will have either 0xffff or 0x7fff as their pkey.  We could
 > probably call ib_get_cached_pkey() instead and just use the first
 > entry in the table.

Well the consumer has to know what P_Key to use since it must match
the QP that will be used to send/receive.  So I would suggest not
trying to guess in the low-level multicast.c code, and rely on the
consumer to set it properly.

 > We don't want to to set the privileged bit of the q_key, so that's
 > wrong.  Good catch.

OK, I'll replace the code with something like random32() & 0x7fffffff

One other question about the PS_IPOIB stuff:

 > +static int cma_set_qkey(struct ib_device *device, u8 port_num,
 > +			enum rdma_port_space ps,
 > +			struct rdma_dev_addr *dev_addr, u32 *qkey)
 > +{
 > +	struct ib_sa_mcmember_rec rec;
 > +	int ret = 0;
 > +
 > +	switch (ps) {
 > +	case RDMA_PS_UDP:
 > +		*qkey = RDMA_UDP_QKEY;
 > +		break;
 > +	case RDMA_PS_IPOIB:
 > +		ib_addr_get_mgid(dev_addr, &rec.mgid);
 > +		ret = ib_sa_get_mcmember_rec(device, port_num, &rec.mgid, &rec);
 > +		*qkey = be32_to_cpu(rec.qkey);
 > +		break;

Does this work if userspace tries to join a new IPoIB MCG that the
kernel driver hasn't joined yet?  From reading the code it seems that
ib_sa_get_mcmember_rec() would fail with -EADDRNOTAVAIL and so the
whole join request would fail.

Am I reading this correctly?  Is it supposed to work?  I would think
that it would be nice to be able to receive on IPoIB MCGs not also
being received by the kernel.

 - R.




More information about the general mailing list