The pkey is the default partition, full membership pkey. I believe
all nodes will have either 0x 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
OK, another question about the multicast.c code:
+static struct mcast_group *mcast_find(struct mcast_port *port,
+ union ib_gid *mgid)
+{
+struct rb_node *node = port-table.rb_node;
+struct mcast_group *group;
+int ret;
+
+while
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
Roland Dreier wrote:
OK, another question about the multicast.c code:
+static struct mcast_group *mcast_find(struct mcast_port *port,
+union ib_gid *mgid)
+{
+ struct rb_node *node = port-table.rb_node;
+ struct mcast_group *group;
+ int ret;
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.)
I'm not sure if you'll need this,
All multicast groups need to be tracked, which is why even groups with
MGID 0 are inserted into the tree.
OK...
Immediately above this code, the group is returned if ret == 0.
Right, I missed that. But...
Calling mcast_find() for MGID 0 isn't useful, so the code avoids doing
this,
Or is it that you want to be able to iterate through the whole rbtree
and get the MGID 0 groups too?
This is it - see mcast_groups_lost(). That call transitions all multicast
groups into an error state, and reports to the user that the group information
may have been lost by the SA. (We
So I'm reading this over, and the following code looks kind of odd to me:
+int ib_sa_get_mcmember_rec(struct ib_device *device, u8 port_num,
+ union ib_gid *mgid, struct ib_sa_mcmember_rec *rec)
...
+} else {
+memset(rec, 0, sizeof *rec);
+