]> git.karo-electronics.de Git - karo-tx-linux.git/commit
IB/core: Handle table with full and partial membership for the same P_Key
authorJack Morgenstein <jackm@dev.mellanox.co.il>
Fri, 3 Aug 2012 08:40:38 +0000 (08:40 +0000)
committerRoland Dreier <roland@purestorage.com>
Wed, 19 Sep 2012 05:08:59 +0000 (22:08 -0700)
commit507a2360697f3e28b6801bd2e5e462de97814f55
treeb9edde76cb7fca8905a3ddf965735627e2ac29f0
parent67714e3dff7c71d825ebf736bb8f6241af6ae4a5
IB/core: Handle table with full and partial membership for the same P_Key

Extend the cached and non-cached P_Key table lookups to handle limited
and full membership of the same P_Key to co-exist in the P_Key table.

This is necessary for SR-IOV, to allow for some guests would to have
the full membership P_Key in their virtual P_Key table, while other
guests on the same physical HCA would have the limited one.
To support this, we need both the limited and full membership P_Keys
to be present in the master's (hypervisor physical port) P_Key table.

The algorithm for handling P_Key tables which contain both the limited
and the full membership versions of the same P_Key works as follows:

When scanning the P_Key table for a 15-bit P_Key:

A. If there is a full member version of that P_Key anywhere in the
    table, return its index (even if a limited-member version of the
    P_Key exists earlier in the table).

B. If the full member version is not in the table, but the
   limited-member version is in the table, return the index of the
   limited P_Key.

Signed-off-by: Liran Liss <liranl@mellanox.com>
Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
drivers/infiniband/core/cache.c
drivers/infiniband/core/device.c