Lines Matching refs:ent
170 struct id_map_entry *ent = container_of(delay, struct id_map_entry, timeout); in id_map_ent_timeout() local
172 struct mlx4_ib_dev *dev = ent->dev; in id_map_ent_timeout()
175 int pv_id = (int) ent->pv_cm_id; in id_map_ent_timeout()
181 found_ent = id_map_find_by_sl_id(&dev->ib_dev, ent->slave_id, ent->sl_cm_id); in id_map_ent_timeout()
182 if (found_ent && found_ent == ent) in id_map_ent_timeout()
187 list_del(&ent->list); in id_map_ent_timeout()
189 kfree(ent); in id_map_ent_timeout()
196 struct id_map_entry *ent, *found_ent; in id_map_find_del() local
199 ent = (struct id_map_entry *)idr_find(&sriov->pv_id_table, pv_cm_id); in id_map_find_del()
200 if (!ent) in id_map_find_del()
202 found_ent = id_map_find_by_sl_id(ibdev, ent->slave_id, ent->sl_cm_id); in id_map_find_del()
203 if (found_ent && found_ent == ent) in id_map_find_del()
214 struct id_map_entry *ent; in sl_id_map_add() local
218 ent = id_map_find_by_sl_id(ibdev, slave_id, sl_cm_id); in sl_id_map_add()
219 if (ent) { in sl_id_map_add()
223 rb_replace_node(&ent->node, &new->node, sl_id_map); in sl_id_map_add()
230 ent = rb_entry(parent, struct id_map_entry, node); in sl_id_map_add()
232 if (ent->sl_cm_id > sl_cm_id || (ent->sl_cm_id == sl_cm_id && ent->slave_id > slave_id)) in sl_id_map_add()
246 struct id_map_entry *ent; in id_map_alloc() local
249 ent = kmalloc(sizeof (struct id_map_entry), GFP_KERNEL); in id_map_alloc()
250 if (!ent) { in id_map_alloc()
255 ent->sl_cm_id = sl_cm_id; in id_map_alloc()
256 ent->slave_id = slave_id; in id_map_alloc()
257 ent->scheduled_delete = 0; in id_map_alloc()
258 ent->dev = to_mdev(ibdev); in id_map_alloc()
259 INIT_DELAYED_WORK(&ent->timeout, id_map_ent_timeout); in id_map_alloc()
264 ret = idr_alloc_cyclic(&sriov->pv_id_table, ent, 0, 0, GFP_NOWAIT); in id_map_alloc()
266 ent->pv_cm_id = (u32)ret; in id_map_alloc()
267 sl_id_map_add(ibdev, ent); in id_map_alloc()
268 list_add_tail(&ent->list, &sriov->cm_list); in id_map_alloc()
275 return ent; in id_map_alloc()
278 kfree(ent); in id_map_alloc()
286 struct id_map_entry *ent; in id_map_get() local
291 ent = id_map_find_by_sl_id(ibdev, sl_cm_id, slave_id); in id_map_get()
292 if (ent) in id_map_get()
293 *pv_cm_id = (int) ent->pv_cm_id; in id_map_get()
295 ent = (struct id_map_entry *)idr_find(&sriov->pv_id_table, *pv_cm_id); in id_map_get()
298 return ent; in id_map_get()
440 struct id_map_entry *ent = in mlx4_ib_cm_paravirt_clean() local
444 rb_erase(&ent->node, sl_id_map); in mlx4_ib_cm_paravirt_clean()
445 idr_remove(&sriov->pv_id_table, (int) ent->pv_cm_id); in mlx4_ib_cm_paravirt_clean()
452 struct id_map_entry *ent = in mlx4_ib_cm_paravirt_clean() local
455 if (ent->slave_id == slave) in mlx4_ib_cm_paravirt_clean()
456 list_move_tail(&ent->list, &lh); in mlx4_ib_cm_paravirt_clean()