I think the following patch would make ipoib spec compliant.
ib_find_cached_pkey is called by ib_cm, rdma_cm, ib_srp, and ib_ipoib.
I'm not certain what this change would do to SRP, but the ib_cm and
rdma_cm look okay, given that non-reversible paths aren't supported
yet anyway.
--

ib_find_cached_pkey masks off the upper-bit of the PKey when searching
for a match.  The upper bit indicates partial or full membership.  Ignoring
the upper bit can result in a full membership PKey matching with a partial
membership PKey.  For ipoib, this can result in joining a multicast group
that disallows communication between all members.

Signed-off-by: Sean Hefty <[EMAIL PROTECTED]>
---
 drivers/infiniband/core/cache.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/infiniband/core/cache.c b/drivers/infiniband/core/cache.c
index 558c9a0..6f366c3 100644
--- a/drivers/infiniband/core/cache.c
+++ b/drivers/infiniband/core/cache.c
@@ -179,7 +179,7 @@ int ib_find_cached_pkey(struct ib_device *device,
        *index = -1;
 
        for (i = 0; i < cache->table_len; ++i)
-               if ((cache->table[i] & 0x7fff) == (pkey & 0x7fff)) {
+               if (cache->table[i] == pkey) {
                        *index = i;
                        ret = 0;
                        break;
-- 
1.4.4.3



_______________________________________________
openib-general mailing list
openib-general@openib.org
http://openib.org/mailman/listinfo/openib-general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general

Reply via email to