Lines Matching refs:ev_file

35 	struct devx_async_cmd_event_file *ev_file;  member
76 struct devx_async_event_file *ev_file; member
1679 struct devx_async_cmd_event_file *ev_file; in UVERBS_HANDLER() local
1685 ev_file = container_of(uobj, struct devx_async_cmd_event_file, in UVERBS_HANDLER()
1687 devx_init_event_queue(&ev_file->ev_queue); in UVERBS_HANDLER()
1688 mlx5_cmd_init_async_ctx(mdev->mdev, &ev_file->async_ctx); in UVERBS_HANDLER()
1697 struct devx_async_event_file *ev_file; in UVERBS_HANDLER() local
1711 ev_file = container_of(uobj, struct devx_async_event_file, in UVERBS_HANDLER()
1713 spin_lock_init(&ev_file->lock); in UVERBS_HANDLER()
1714 INIT_LIST_HEAD(&ev_file->event_list); in UVERBS_HANDLER()
1715 init_waitqueue_head(&ev_file->poll_wait); in UVERBS_HANDLER()
1717 ev_file->omit_data = 1; in UVERBS_HANDLER()
1718 INIT_LIST_HEAD(&ev_file->subscribed_events_list); in UVERBS_HANDLER()
1719 ev_file->dev = dev; in UVERBS_HANDLER()
1728 struct devx_async_cmd_event_file *ev_file = async_data->ev_file; in devx_query_callback() local
1729 struct devx_async_event_queue *ev_queue = &ev_file->ev_queue; in devx_query_callback()
1761 struct devx_async_cmd_event_file *ev_file; in UVERBS_HANDLER() local
1787 ev_file = container_of(fd_uobj, struct devx_async_cmd_event_file, in UVERBS_HANDLER()
1790 if (atomic_add_return(cmd_out_len, &ev_file->ev_queue.bytes_in_use) > in UVERBS_HANDLER()
1792 atomic_sub(cmd_out_len, &ev_file->ev_queue.bytes_in_use); in UVERBS_HANDLER()
1810 async_data->ev_file = ev_file; in UVERBS_HANDLER()
1813 err = mlx5_cmd_exec_cb(&ev_file->async_ctx, cmd_in, in UVERBS_HANDLER()
1828 atomic_sub(cmd_out_len, &ev_file->ev_queue.bytes_in_use); in UVERBS_HANDLER()
1988 struct devx_async_event_file *ev_file; in UVERBS_HANDLER() local
2017 ev_file = container_of(fd_uobj, struct devx_async_event_file, in UVERBS_HANDLER()
2086 uverbs_uobject_get(&ev_file->uobj); in UVERBS_HANDLER()
2099 event_sub->ev_file = ev_file; in UVERBS_HANDLER()
2116 spin_lock_irq(&ev_file->lock); in UVERBS_HANDLER()
2118 &ev_file->subscribed_events_list); in UVERBS_HANDLER()
2119 spin_unlock_irq(&ev_file->lock); in UVERBS_HANDLER()
2153 uverbs_uobject_put(&event_sub->ev_file->uobj); in UVERBS_HANDLER()
2432 struct devx_async_event_file *ev_file; in deliver_event() local
2436 ev_file = event_sub->ev_file; in deliver_event()
2438 if (ev_file->omit_data) { in deliver_event()
2439 spin_lock_irqsave(&ev_file->lock, flags); in deliver_event()
2441 ev_file->is_destroyed) { in deliver_event()
2442 spin_unlock_irqrestore(&ev_file->lock, flags); in deliver_event()
2446 list_add_tail(&event_sub->event_list, &ev_file->event_list); in deliver_event()
2447 spin_unlock_irqrestore(&ev_file->lock, flags); in deliver_event()
2448 wake_up_interruptible(&ev_file->poll_wait); in deliver_event()
2455 spin_lock_irqsave(&ev_file->lock, flags); in deliver_event()
2456 ev_file->is_overflow_err = 1; in deliver_event()
2457 spin_unlock_irqrestore(&ev_file->lock, flags); in deliver_event()
2464 spin_lock_irqsave(&ev_file->lock, flags); in deliver_event()
2465 if (!ev_file->is_destroyed) in deliver_event()
2466 list_add_tail(&event_data->list, &ev_file->event_list); in deliver_event()
2469 spin_unlock_irqrestore(&ev_file->lock, flags); in deliver_event()
2470 wake_up_interruptible(&ev_file->poll_wait); in deliver_event()
2663 struct devx_async_event_file *ev_file = filp->private_data; in devx_async_event_read() local
2671 omit_data = ev_file->omit_data; in devx_async_event_read()
2673 spin_lock_irq(&ev_file->lock); in devx_async_event_read()
2675 if (ev_file->is_overflow_err) { in devx_async_event_read()
2676 ev_file->is_overflow_err = 0; in devx_async_event_read()
2677 spin_unlock_irq(&ev_file->lock); in devx_async_event_read()
2682 while (list_empty(&ev_file->event_list)) { in devx_async_event_read()
2683 spin_unlock_irq(&ev_file->lock); in devx_async_event_read()
2688 if (wait_event_interruptible(ev_file->poll_wait, in devx_async_event_read()
2689 (!list_empty(&ev_file->event_list) || in devx_async_event_read()
2690 ev_file->is_destroyed))) { in devx_async_event_read()
2694 spin_lock_irq(&ev_file->lock); in devx_async_event_read()
2695 if (ev_file->is_destroyed) { in devx_async_event_read()
2696 spin_unlock_irq(&ev_file->lock); in devx_async_event_read()
2702 event_sub = list_first_entry(&ev_file->event_list, in devx_async_event_read()
2708 event = list_first_entry(&ev_file->event_list, in devx_async_event_read()
2716 spin_unlock_irq(&ev_file->lock); in devx_async_event_read()
2725 spin_unlock_irq(&ev_file->lock); in devx_async_event_read()
2741 struct devx_async_event_file *ev_file = filp->private_data; in devx_async_event_poll() local
2744 poll_wait(filp, &ev_file->poll_wait, wait); in devx_async_event_poll()
2746 spin_lock_irq(&ev_file->lock); in devx_async_event_poll()
2747 if (ev_file->is_destroyed) in devx_async_event_poll()
2749 else if (!list_empty(&ev_file->event_list)) in devx_async_event_poll()
2751 spin_unlock_irq(&ev_file->lock); in devx_async_event_poll()
2763 uverbs_uobject_put(&event_sub->ev_file->uobj); in devx_free_subscription()
2803 struct devx_async_event_file *ev_file = in devx_async_event_destroy_uobj() local
2807 struct mlx5_ib_dev *dev = ev_file->dev; in devx_async_event_destroy_uobj()
2809 spin_lock_irq(&ev_file->lock); in devx_async_event_destroy_uobj()
2810 ev_file->is_destroyed = 1; in devx_async_event_destroy_uobj()
2813 if (ev_file->omit_data) { in devx_async_event_destroy_uobj()
2816 list_for_each_entry_safe(event_sub, tmp, &ev_file->event_list, in devx_async_event_destroy_uobj()
2823 list_for_each_entry_safe(entry, tmp, &ev_file->event_list, in devx_async_event_destroy_uobj()
2830 spin_unlock_irq(&ev_file->lock); in devx_async_event_destroy_uobj()
2831 wake_up_interruptible(&ev_file->poll_wait); in devx_async_event_destroy_uobj()
2836 &ev_file->subscribed_events_list, file_list) { in devx_async_event_destroy_uobj()