]> git.openfabrics.org - ~shefty/ibacm.git/commitdiff
[ibacm,3/8] acm.c: Invalid pkey has low order 15 bits 0
authorHal Rosenstock <hal@dev.mellanox.co.il>
Tue, 6 Aug 2013 11:45:22 +0000 (07:45 -0400)
committerSean Hefty <sean.hefty@intel.com>
Mon, 12 Aug 2013 17:12:58 +0000 (10:12 -0700)
so add in handling for pkey 0x8000 as well as 0 for invalid

Signed-off-by: Hal Rosenstock <hal@mellanox.com>
Signed-off-by: Sean Hefty <sean.hefty@intel.com>
src/acm.c

index 2eb0e22a1f8e97e76e30e49c553878aa2271b802..45ed13391076bcafa6920adbded5fa829136012f 100644 (file)
--- a/src/acm.c
+++ b/src/acm.c
@@ -3210,7 +3210,7 @@ static void acm_port_up(struct acm_port *port)
        atomic_set(&port->sa_dest.refcnt, 1);
        for (i = 0; i < attr.pkey_tbl_len; i++) {
                ret = ibv_query_pkey(port->dev->verbs, port->port_num, i, &pkey);
-               if (ret || !pkey)
+               if (ret || !(ntohs(pkey) & 0x7fff))
                        continue;
                acm_ep_up(port, (uint16_t) i);
        }