Lines Matching refs:sriov
156 struct rb_root *sl_id_map = &to_mdev(ibdev)->sriov.sl_id_map; in id_map_find_by_sl_id()
183 struct mlx4_ib_sriov *sriov = &dev->sriov; in id_map_ent_timeout() local
184 struct rb_root *sl_id_map = &sriov->sl_id_map; in id_map_ent_timeout()
186 spin_lock(&sriov->id_map_lock); in id_map_ent_timeout()
187 if (!xa_erase(&sriov->pv_id_table, ent->pv_cm_id)) in id_map_ent_timeout()
195 spin_unlock(&sriov->id_map_lock); in id_map_ent_timeout()
201 struct rb_root *sl_id_map = &to_mdev(ibdev)->sriov.sl_id_map; in sl_id_map_add()
236 struct mlx4_ib_sriov *sriov = &to_mdev(ibdev)->sriov; in id_map_alloc() local
248 ret = xa_alloc_cyclic(&sriov->pv_id_table, &ent->pv_cm_id, ent, in id_map_alloc()
249 xa_limit_32b, &sriov->pv_id_next, GFP_KERNEL); in id_map_alloc()
251 spin_lock(&sriov->id_map_lock); in id_map_alloc()
253 list_add_tail(&ent->list, &sriov->cm_list); in id_map_alloc()
254 spin_unlock(&sriov->id_map_lock); in id_map_alloc()
268 struct mlx4_ib_sriov *sriov = &to_mdev(ibdev)->sriov; in id_map_get() local
270 spin_lock(&sriov->id_map_lock); in id_map_get()
276 ent = xa_load(&sriov->pv_id_table, *pv_cm_id); in id_map_get()
277 spin_unlock(&sriov->id_map_lock); in id_map_get()
284 struct mlx4_ib_sriov *sriov = &to_mdev(ibdev)->sriov; in schedule_delayed() local
287 spin_lock(&sriov->id_map_lock); in schedule_delayed()
288 spin_lock_irqsave(&sriov->going_down_lock, flags); in schedule_delayed()
290 if (!sriov->is_going_down && !id->scheduled_delete) { in schedule_delayed()
297 spin_unlock_irqrestore(&sriov->going_down_lock, flags); in schedule_delayed()
298 spin_unlock(&sriov->id_map_lock); in schedule_delayed()
360 static int alloc_rej_tmout(struct mlx4_ib_sriov *sriov, u32 rem_pv_cm_id, int slave) in alloc_rej_tmout() argument
366 xa_lock(&sriov->xa_rej_tmout); in alloc_rej_tmout()
367 item = xa_load(&sriov->xa_rej_tmout, (unsigned long)rem_pv_cm_id); in alloc_rej_tmout()
377 xa_unlock(&sriov->xa_rej_tmout); in alloc_rej_tmout()
386 item->xa_rej_tmout = &sriov->xa_rej_tmout; in alloc_rej_tmout()
388 old = xa_cmpxchg(&sriov->xa_rej_tmout, (unsigned long)rem_pv_cm_id, NULL, item, GFP_KERNEL); in alloc_rej_tmout()
402 xa_unlock(&sriov->xa_rej_tmout); in alloc_rej_tmout()
406 static int lookup_rej_tmout_slave(struct mlx4_ib_sriov *sriov, u32 rem_pv_cm_id) in lookup_rej_tmout_slave() argument
411 xa_lock(&sriov->xa_rej_tmout); in lookup_rej_tmout_slave()
412 item = xa_load(&sriov->xa_rej_tmout, (unsigned long)rem_pv_cm_id); in lookup_rej_tmout_slave()
421 xa_unlock(&sriov->xa_rej_tmout); in lookup_rej_tmout_slave()
429 struct mlx4_ib_sriov *sriov = &to_mdev(ibdev)->sriov; in mlx4_ib_demux_cm_handler() local
450 sts = alloc_rej_tmout(sriov, rem_pv_cm_id, *slave); in mlx4_ib_demux_cm_handler()
465 *slave = lookup_rej_tmout_slave(sriov, rem_pv_cm_id); in mlx4_ib_demux_cm_handler()
487 spin_lock_init(&dev->sriov.id_map_lock); in mlx4_ib_cm_paravirt_init()
488 INIT_LIST_HEAD(&dev->sriov.cm_list); in mlx4_ib_cm_paravirt_init()
489 dev->sriov.sl_id_map = RB_ROOT; in mlx4_ib_cm_paravirt_init()
490 xa_init_flags(&dev->sriov.pv_id_table, XA_FLAGS_ALLOC); in mlx4_ib_cm_paravirt_init()
491 xa_init(&dev->sriov.xa_rej_tmout); in mlx4_ib_cm_paravirt_init()
494 static void rej_tmout_xa_cleanup(struct mlx4_ib_sriov *sriov, int slave) in rej_tmout_xa_cleanup() argument
501 xa_lock(&sriov->xa_rej_tmout); in rej_tmout_xa_cleanup()
502 xa_for_each(&sriov->xa_rej_tmout, id, item) { in rej_tmout_xa_cleanup()
509 xa_unlock(&sriov->xa_rej_tmout); in rej_tmout_xa_cleanup()
518 WARN_ON(!xa_empty(&sriov->xa_rej_tmout)); in rej_tmout_xa_cleanup()
525 struct mlx4_ib_sriov *sriov = &dev->sriov; in mlx4_ib_cm_paravirt_clean() local
526 struct rb_root *sl_id_map = &sriov->sl_id_map; in mlx4_ib_cm_paravirt_clean()
533 spin_lock(&sriov->id_map_lock); in mlx4_ib_cm_paravirt_clean()
534 list_for_each_entry_safe(map, tmp_map, &dev->sriov.cm_list, list) { in mlx4_ib_cm_paravirt_clean()
541 spin_unlock(&sriov->id_map_lock); in mlx4_ib_cm_paravirt_clean()
547 spin_lock(&sriov->id_map_lock); in mlx4_ib_cm_paravirt_clean()
555 xa_erase(&sriov->pv_id_table, ent->pv_cm_id); in mlx4_ib_cm_paravirt_clean()
557 list_splice_init(&dev->sriov.cm_list, &lh); in mlx4_ib_cm_paravirt_clean()
571 xa_erase(&sriov->pv_id_table, map->pv_cm_id); in mlx4_ib_cm_paravirt_clean()
575 list_for_each_entry_safe(map, tmp_map, &dev->sriov.cm_list, list) { in mlx4_ib_cm_paravirt_clean()
581 spin_unlock(&sriov->id_map_lock); in mlx4_ib_cm_paravirt_clean()
589 rej_tmout_xa_cleanup(sriov, slave); in mlx4_ib_cm_paravirt_clean()