Lines Matching refs:sriov
146 struct rb_root *sl_id_map = &to_mdev(ibdev)->sriov.sl_id_map; in id_map_find_by_sl_id()
173 struct mlx4_ib_sriov *sriov = &dev->sriov; in id_map_ent_timeout() local
174 struct rb_root *sl_id_map = &sriov->sl_id_map; in id_map_ent_timeout()
177 spin_lock(&sriov->id_map_lock); in id_map_ent_timeout()
178 db_ent = (struct id_map_entry *)idr_find(&sriov->pv_id_table, pv_id); in id_map_ent_timeout()
184 idr_remove(&sriov->pv_id_table, pv_id); in id_map_ent_timeout()
188 spin_unlock(&sriov->id_map_lock); in id_map_ent_timeout()
194 struct mlx4_ib_sriov *sriov = &to_mdev(ibdev)->sriov; in id_map_find_del() local
195 struct rb_root *sl_id_map = &sriov->sl_id_map; in id_map_find_del()
198 spin_lock(&sriov->id_map_lock); in id_map_find_del()
199 ent = (struct id_map_entry *)idr_find(&sriov->pv_id_table, pv_cm_id); in id_map_find_del()
205 idr_remove(&sriov->pv_id_table, pv_cm_id); in id_map_find_del()
207 spin_unlock(&sriov->id_map_lock); in id_map_find_del()
212 struct rb_root *sl_id_map = &to_mdev(ibdev)->sriov.sl_id_map; in sl_id_map_add()
247 struct mlx4_ib_sriov *sriov = &to_mdev(ibdev)->sriov; in id_map_alloc() local
262 spin_lock(&to_mdev(ibdev)->sriov.id_map_lock); in id_map_alloc()
264 ret = idr_alloc_cyclic(&sriov->pv_id_table, ent, 0, 0, GFP_NOWAIT); in id_map_alloc()
268 list_add_tail(&ent->list, &sriov->cm_list); in id_map_alloc()
271 spin_unlock(&sriov->id_map_lock); in id_map_alloc()
287 struct mlx4_ib_sriov *sriov = &to_mdev(ibdev)->sriov; in id_map_get() local
289 spin_lock(&sriov->id_map_lock); in id_map_get()
295 ent = (struct id_map_entry *)idr_find(&sriov->pv_id_table, *pv_cm_id); in id_map_get()
296 spin_unlock(&sriov->id_map_lock); in id_map_get()
303 struct mlx4_ib_sriov *sriov = &to_mdev(ibdev)->sriov; in schedule_delayed() local
306 spin_lock(&sriov->id_map_lock); in schedule_delayed()
307 spin_lock_irqsave(&sriov->going_down_lock, flags); in schedule_delayed()
309 if (!sriov->is_going_down) { in schedule_delayed()
313 spin_unlock_irqrestore(&sriov->going_down_lock, flags); in schedule_delayed()
314 spin_unlock(&sriov->id_map_lock); in schedule_delayed()
405 spin_lock_init(&dev->sriov.id_map_lock); in mlx4_ib_cm_paravirt_init()
406 INIT_LIST_HEAD(&dev->sriov.cm_list); in mlx4_ib_cm_paravirt_init()
407 dev->sriov.sl_id_map = RB_ROOT; in mlx4_ib_cm_paravirt_init()
408 idr_init(&dev->sriov.pv_id_table); in mlx4_ib_cm_paravirt_init()
415 struct mlx4_ib_sriov *sriov = &dev->sriov; in mlx4_ib_cm_paravirt_clean() local
416 struct rb_root *sl_id_map = &sriov->sl_id_map; in mlx4_ib_cm_paravirt_clean()
423 spin_lock(&sriov->id_map_lock); in mlx4_ib_cm_paravirt_clean()
424 list_for_each_entry_safe(map, tmp_map, &dev->sriov.cm_list, list) { in mlx4_ib_cm_paravirt_clean()
431 spin_unlock(&sriov->id_map_lock); in mlx4_ib_cm_paravirt_clean()
437 spin_lock(&sriov->id_map_lock); in mlx4_ib_cm_paravirt_clean()
445 idr_remove(&sriov->pv_id_table, (int) ent->pv_cm_id); in mlx4_ib_cm_paravirt_clean()
447 list_splice_init(&dev->sriov.cm_list, &lh); in mlx4_ib_cm_paravirt_clean()
461 idr_remove(&sriov->pv_id_table, (int) map->pv_cm_id); in mlx4_ib_cm_paravirt_clean()
465 list_for_each_entry_safe(map, tmp_map, &dev->sriov.cm_list, list) { in mlx4_ib_cm_paravirt_clean()
471 spin_unlock(&sriov->id_map_lock); in mlx4_ib_cm_paravirt_clean()