[openib-general] SA multicast patches

Sean Hefty sean.hefty at intel.com
Fri Feb 16 10:02:10 PST 2007


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

I'm fine leaving it at 0.

For now, I think the safest thing to do is just remove the entire 'else' portion
from the function and return an error if the MGID is 0.  Neither of the places
that call into ib_sa_get_mcmember_rec() should pass in an MGID of 0.  (I'm
testing this now to verify.)  See below for its use:

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

In short, yes.

ib_addr_get_mgid() is returning the MGID for the ipoib broadcast group, so ipoib
must have joined that group.  The code then looks up the MCMemberRecord for the
broadcast group, and extracts the qkey for that group to use when joining the
new group.

- Sean




More information about the general mailing list