| 1777 | } |
| 1778 | |
| 1779 | static int |
| 1780 | vring_state_changed(int vid, uint16_t queue_id, int enable) |
| 1781 | { |
| 1782 | struct vhost_dev *vdev = NULL; |
| 1783 | |
| 1784 | TAILQ_FOREACH(vdev, &vhost_dev_list, global_vdev_entry) { |
| 1785 | if (vdev->vid == vid) |
| 1786 | break; |
| 1787 | } |
| 1788 | if (!vdev) |
| 1789 | return -1; |
| 1790 | |
| 1791 | if (dma_bind[vid2socketid[vid]].dmas[queue_id].async_enabled) { |
| 1792 | if (!enable) |
| 1793 | vhost_clear_queue_thread_unsafe(vdev, queue_id); |
| 1794 | } |
| 1795 | |
| 1796 | return 0; |
| 1797 | } |
| 1798 | |
| 1799 | /* |
| 1800 | * These callback allow devices to be added to the data core when configuration |
nothing calls this directly
no test coverage detected