Lines Matching refs:vq
41 struct vhost_virtqueue *vq = &n->dev.vqs[VHOST_TEST_VQ]; in handle_vq() local
47 private = rcu_dereference_check(vq->private_data, 1); in handle_vq()
51 mutex_lock(&vq->mutex); in handle_vq()
52 vhost_disable_notify(&n->dev, vq); in handle_vq()
55 head = vhost_get_vq_desc(&n->dev, vq, vq->iov, in handle_vq()
56 ARRAY_SIZE(vq->iov), in handle_vq()
63 if (head == vq->num) { in handle_vq()
64 if (unlikely(vhost_enable_notify(&n->dev, vq))) { in handle_vq()
65 vhost_disable_notify(&n->dev, vq); in handle_vq()
71 vq_err(vq, "Unexpected descriptor format for TX: " in handle_vq()
75 len = iov_length(vq->iov, out); in handle_vq()
78 vq_err(vq, "Unexpected 0 len for TX\n"); in handle_vq()
81 vhost_add_used_and_signal(&n->dev, vq, head, 0); in handle_vq()
84 vhost_poll_queue(&vq->poll); in handle_vq()
89 mutex_unlock(&vq->mutex); in handle_vq()
94 struct vhost_virtqueue *vq = container_of(work, struct vhost_virtqueue, in handle_vq_kick() local
96 struct vhost_test *n = container_of(vq->dev, struct vhost_test, dev); in handle_vq_kick()
124 struct vhost_virtqueue *vq) in vhost_test_stop_vq() argument
128 mutex_lock(&vq->mutex); in vhost_test_stop_vq()
129 private = rcu_dereference_protected(vq->private_data, in vhost_test_stop_vq()
130 lockdep_is_held(&vq->mutex)); in vhost_test_stop_vq()
131 rcu_assign_pointer(vq->private_data, NULL); in vhost_test_stop_vq()
132 mutex_unlock(&vq->mutex); in vhost_test_stop_vq()
169 struct vhost_virtqueue *vq; in vhost_test_run() local
189 vq = n->vqs + index; in vhost_test_run()
190 mutex_lock(&vq->mutex); in vhost_test_run()
194 oldpriv = rcu_dereference_protected(vq->private_data, in vhost_test_run()
195 lockdep_is_held(&vq->mutex)); in vhost_test_run()
196 rcu_assign_pointer(vq->private_data, priv); in vhost_test_run()
200 mutex_unlock(&vq->mutex); in vhost_test_run()