Lines Matching refs:lkey_id
41 struct mlxsw_sp_acl_atcam_lkey_id *lkey_id);
105 struct mlxsw_sp_acl_atcam_lkey_id *lkey_id) in mlxsw_sp_acl_atcam_generic_lkey_id_put() argument
171 struct mlxsw_sp_acl_atcam_lkey_id *lkey_id; in mlxsw_sp_acl_atcam_lkey_id_create() local
182 lkey_id = kzalloc(sizeof(*lkey_id), GFP_KERNEL); in mlxsw_sp_acl_atcam_lkey_id_create()
183 if (!lkey_id) { in mlxsw_sp_acl_atcam_lkey_id_create()
188 lkey_id->id = id; in mlxsw_sp_acl_atcam_lkey_id_create()
189 memcpy(&lkey_id->ht_key, ht_key, sizeof(*ht_key)); in mlxsw_sp_acl_atcam_lkey_id_create()
190 refcount_set(&lkey_id->refcnt, 1); in mlxsw_sp_acl_atcam_lkey_id_create()
193 &lkey_id->ht_node, in mlxsw_sp_acl_atcam_lkey_id_create()
198 return lkey_id; in mlxsw_sp_acl_atcam_lkey_id_create()
201 kfree(lkey_id); in mlxsw_sp_acl_atcam_lkey_id_create()
209 struct mlxsw_sp_acl_atcam_lkey_id *lkey_id) in mlxsw_sp_acl_atcam_lkey_id_destroy() argument
212 u32 id = lkey_id->id; in mlxsw_sp_acl_atcam_lkey_id_destroy()
214 rhashtable_remove_fast(®ion_12kb->lkey_ht, &lkey_id->ht_node, in mlxsw_sp_acl_atcam_lkey_id_destroy()
216 kfree(lkey_id); in mlxsw_sp_acl_atcam_lkey_id_destroy()
229 struct mlxsw_sp_acl_atcam_lkey_id *lkey_id; in mlxsw_sp_acl_atcam_12kb_lkey_id_get() local
236 lkey_id = rhashtable_lookup_fast(®ion_12kb->lkey_ht, &ht_key, in mlxsw_sp_acl_atcam_12kb_lkey_id_get()
238 if (lkey_id) { in mlxsw_sp_acl_atcam_12kb_lkey_id_get()
239 refcount_inc(&lkey_id->refcnt); in mlxsw_sp_acl_atcam_12kb_lkey_id_get()
240 return lkey_id; in mlxsw_sp_acl_atcam_12kb_lkey_id_get()
248 struct mlxsw_sp_acl_atcam_lkey_id *lkey_id) in mlxsw_sp_acl_atcam_12kb_lkey_id_put() argument
250 if (refcount_dec_and_test(&lkey_id->refcnt)) in mlxsw_sp_acl_atcam_12kb_lkey_id_put()
251 mlxsw_sp_acl_atcam_lkey_id_destroy(aregion, lkey_id); in mlxsw_sp_acl_atcam_12kb_lkey_id_put()
385 struct mlxsw_sp_acl_atcam_lkey_id *lkey_id; in mlxsw_sp_acl_atcam_region_entry_insert() local
394 lkey_id = aregion->ops->lkey_id_get(aregion, aentry->enc_key, erp_id); in mlxsw_sp_acl_atcam_region_entry_insert()
395 if (IS_ERR(lkey_id)) in mlxsw_sp_acl_atcam_region_entry_insert()
396 return PTR_ERR(lkey_id); in mlxsw_sp_acl_atcam_region_entry_insert()
397 aentry->lkey_id = lkey_id; in mlxsw_sp_acl_atcam_region_entry_insert()
406 refcount_read(&lkey_id->refcnt) != 1, lkey_id->id, in mlxsw_sp_acl_atcam_region_entry_insert()
415 aregion->ops->lkey_id_put(aregion, lkey_id); in mlxsw_sp_acl_atcam_region_entry_insert()
424 struct mlxsw_sp_acl_atcam_lkey_id *lkey_id = aentry->lkey_id; in mlxsw_sp_acl_atcam_region_entry_remove() local
435 refcount_read(&lkey_id->refcnt) != 1, in mlxsw_sp_acl_atcam_region_entry_remove()
436 lkey_id->id, 0); in mlxsw_sp_acl_atcam_region_entry_remove()
438 aregion->ops->lkey_id_put(aregion, lkey_id); in mlxsw_sp_acl_atcam_region_entry_remove()
447 struct mlxsw_sp_acl_atcam_lkey_id *lkey_id = aentry->lkey_id; in mlxsw_sp_acl_atcam_region_entry_action_replace() local
464 refcount_read(&lkey_id->refcnt) != 1, lkey_id->id, in mlxsw_sp_acl_atcam_region_entry_action_replace()