Lines Matching defs:pkey

47  * sel_ib_pkey_hashfn - Hashing function for the pkey table
48 * @pkey: pkey number
51 * This is the hashing function for the pkey table, it returns the bucket
52 * number for the given pkey.
55 static unsigned int sel_ib_pkey_hashfn(u16 pkey)
57 return (pkey & (SEL_PKEY_HASH_SIZE - 1));
61 * sel_ib_pkey_find - Search for a pkey record
66 * Search the pkey table and return the matching record. If an entry
73 struct sel_ib_pkey *pkey;
76 list_for_each_entry_rcu(pkey, &sel_ib_pkey_hash[idx].list, list) {
77 if (pkey->psec.pkey == pkey_num &&
78 pkey->psec.subnet_prefix == subnet_prefix)
79 return pkey;
86 * sel_ib_pkey_insert - Insert a new pkey into the table
87 * @pkey: the new pkey record
90 * Add a new pkey record to the hash table.
93 static void sel_ib_pkey_insert(struct sel_ib_pkey *pkey)
100 idx = sel_ib_pkey_hashfn(pkey->psec.pkey);
101 list_add_rcu(&pkey->list, &sel_ib_pkey_hash[idx].list);
118 * sel_ib_pkey_sid_slow - Lookup the SID of a pkey using the policy
120 * @pkey_num: pkey number
121 * @sid: pkey SID
124 * This function determines the SID of a pkey by querying the security
125 * policy. The result is added to the pkey table to speedup future
132 struct sel_ib_pkey *pkey;
137 pkey = sel_ib_pkey_find(subnet_prefix, pkey_num);
138 if (pkey) {
139 *sid = pkey->psec.sid;
159 new->psec.pkey = pkey_num;
171 * @pkey_num: pkey number
172 * @sid: pkey SID
176 * possible. First the pkey table is queried, but if an entry can't be found
183 struct sel_ib_pkey *pkey;
186 pkey = sel_ib_pkey_find(subnet_prefix, pkey_num);
187 if (pkey) {
188 *sid = pkey->psec.sid;
198 * sel_ib_pkey_flush - Flush the entire pkey table
201 * Remove all entries from the pkey table
207 struct sel_ib_pkey *pkey, *pkey_tmp;
212 list_for_each_entry_safe(pkey, pkey_tmp,
214 list_del_rcu(&pkey->list);
215 kfree_rcu(pkey, rcu);