Home
last modified time | relevance | path

Searched refs:vq (Results 1 – 25 of 109) sorted by relevance

12345

/drivers/virtio/
Dvirtio_ring.c34 dev_err(&(_vq)->vq.vdev->dev, \
35 "%s:"fmt, (_vq)->vq.name, ##args); \
43 (_vq)->vq.name, (_vq)->in_use); \
51 dev_err(&_vq->vq.vdev->dev, \
52 "%s:"fmt, (_vq)->vq.name, ##args); \
55 #define START_USE(vq) argument
56 #define END_USE(vq) argument
65 struct virtqueue vq; member
97 bool (*notify)(struct virtqueue *vq);
117 #define to_vvq(_vq) container_of(_vq, struct vring_virtqueue, vq)
[all …]
Dvirtio_pci_common.c44 bool vp_notify(struct virtqueue *vq) in vp_notify() argument
48 iowrite16(vq->index, (void __iomem *)vq->priv); in vp_notify()
71 if (vring_interrupt(irq, info->vq) == IRQ_HANDLED) in vp_vring_interrupt()
226 void (*callback)(struct virtqueue *vq), in vp_setup_vq() argument
232 struct virtqueue *vq; in vp_setup_vq() local
239 vq = vp_dev->setup_vq(vp_dev, info, index, callback, name, msix_vec); in vp_setup_vq()
240 if (IS_ERR(vq)) in vp_setup_vq()
243 info->vq = vq; in vp_setup_vq()
253 return vq; in vp_setup_vq()
257 return vq; in vp_setup_vq()
[all …]
Dvirtio_pci_legacy.c117 void (*callback)(struct virtqueue *vq), in setup_vq() argument
121 struct virtqueue *vq; in setup_vq() local
136 vq = vring_create_virtqueue(index, num, in setup_vq()
139 if (!vq) in setup_vq()
143 iowrite32(virtqueue_get_desc_addr(vq) >> VIRTIO_PCI_QUEUE_ADDR_SHIFT, in setup_vq()
146 vq->priv = (void __force *)vp_dev->ioaddr + VIRTIO_PCI_QUEUE_NOTIFY; in setup_vq()
157 return vq; in setup_vq()
161 vring_del_virtqueue(vq); in setup_vq()
167 struct virtqueue *vq = info->vq; in del_vq() local
168 struct virtio_pci_device *vp_dev = to_vp_device(vq->vdev); in del_vq()
[all …]
Dvirtio_mmio.c101 struct virtqueue *vq; member
276 static bool vm_notify(struct virtqueue *vq) in vm_notify() argument
278 struct virtio_mmio_device *vm_dev = to_virtio_mmio_device(vq->vdev); in vm_notify()
282 writel(vq->index, vm_dev->base + VIRTIO_MMIO_QUEUE_NOTIFY); in vm_notify()
307 ret |= vring_interrupt(irq, info->vq); in vm_interrupt()
316 static void vm_del_vq(struct virtqueue *vq) in vm_del_vq() argument
318 struct virtio_mmio_device *vm_dev = to_virtio_mmio_device(vq->vdev); in vm_del_vq()
319 struct virtio_mmio_vq_info *info = vq->priv; in vm_del_vq()
321 unsigned int index = vq->index; in vm_del_vq()
336 vring_del_virtqueue(vq); in vm_del_vq()
[all …]
Dvirtio_pci_modern.c298 void (*callback)(struct virtqueue *vq), in setup_vq() argument
303 struct virtqueue *vq; in setup_vq() local
329 vq = vring_create_virtqueue(index, num, in setup_vq()
332 if (!vq) in setup_vq()
336 vp_iowrite16(virtqueue_get_vring_size(vq), &cfg->queue_size); in setup_vq()
337 vp_iowrite64_twopart(virtqueue_get_desc_addr(vq), in setup_vq()
339 vp_iowrite64_twopart(virtqueue_get_avail_addr(vq), in setup_vq()
341 vp_iowrite64_twopart(virtqueue_get_used_addr(vq), in setup_vq()
356 vq->priv = (void __force *)vp_dev->notify_base + in setup_vq()
359 vq->priv = (void __force *)map_capability(vp_dev->pci_dev, in setup_vq()
[all …]
Dvirtio_balloon.c112 static void balloon_ack(struct virtqueue *vq) in balloon_ack() argument
114 struct virtio_balloon *vb = vq->vdev->priv; in balloon_ack()
119 static void tell_host(struct virtio_balloon *vb, struct virtqueue *vq) in tell_host() argument
127 virtqueue_add_outbuf(vq, &sg, 1, vb, GFP_KERNEL); in tell_host()
128 virtqueue_kick(vq); in tell_host()
131 wait_event(vb->acked, virtqueue_get_buf(vq, &len)); in tell_host()
283 static void stats_request(struct virtqueue *vq) in stats_request() argument
285 struct virtio_balloon *vb = vq->vdev->priv; in stats_request()
295 struct virtqueue *vq; in stats_handle_request() local
301 vq = vb->stats_vq; in stats_handle_request()
[all …]
/drivers/vhost/
Dvhost.c47 #define vhost_used_event(vq) ((__virtio16 __user *)&vq->avail->ring[vq->num]) argument
48 #define vhost_avail_event(vq) ((__virtio16 __user *)&vq->used->ring[vq->num]) argument
55 static void vhost_disable_cross_endian(struct vhost_virtqueue *vq) in vhost_disable_cross_endian() argument
57 vq->user_be = !virtio_legacy_is_little_endian(); in vhost_disable_cross_endian()
60 static void vhost_enable_cross_endian_big(struct vhost_virtqueue *vq) in vhost_enable_cross_endian_big() argument
62 vq->user_be = true; in vhost_enable_cross_endian_big()
65 static void vhost_enable_cross_endian_little(struct vhost_virtqueue *vq) in vhost_enable_cross_endian_little() argument
67 vq->user_be = false; in vhost_enable_cross_endian_little()
70 static long vhost_set_vring_endian(struct vhost_virtqueue *vq, int __user *argp) in vhost_set_vring_endian() argument
74 if (vq->private_data) in vhost_set_vring_endian()
[all …]
Dnet.c82 struct vhost_virtqueue *vq; member
86 struct vhost_virtqueue vq; member
117 static void vhost_net_enable_zcopy(int vq) in vhost_net_enable_zcopy() argument
119 vhost_net_zcopy_mask |= 0x1 << vq; in vhost_net_enable_zcopy()
123 vhost_net_ubuf_alloc(struct vhost_virtqueue *vq, bool zcopy) in vhost_net_ubuf_alloc() argument
134 ubufs->vq = vq; in vhost_net_ubuf_alloc()
240 struct vhost_virtqueue *vq) in vhost_zerocopy_signal_used() argument
243 container_of(vq, struct vhost_net_virtqueue, vq); in vhost_zerocopy_signal_used()
248 if (vq->heads[i].len == VHOST_DMA_FAILED_LEN) in vhost_zerocopy_signal_used()
250 if (VHOST_DMA_IS_DONE(vq->heads[i].len)) { in vhost_zerocopy_signal_used()
[all …]
Dvsock.c77 struct vhost_virtqueue *vq) in vhost_transport_do_send_pkt() argument
83 mutex_lock(&vq->mutex); in vhost_transport_do_send_pkt()
85 if (!vq->private_data) in vhost_transport_do_send_pkt()
89 vhost_disable_notify(&vsock->dev, vq); in vhost_transport_do_send_pkt()
102 vhost_enable_notify(&vsock->dev, vq); in vhost_transport_do_send_pkt()
111 head = vhost_get_vq_desc(vq, vq->iov, ARRAY_SIZE(vq->iov), in vhost_transport_do_send_pkt()
120 if (head == vq->num) { in vhost_transport_do_send_pkt()
128 if (unlikely(vhost_enable_notify(&vsock->dev, vq))) { in vhost_transport_do_send_pkt()
129 vhost_disable_notify(&vsock->dev, vq); in vhost_transport_do_send_pkt()
137 vq_err(vq, "Expected 0 output buffers, got %u\n", out); in vhost_transport_do_send_pkt()
[all …]
Dtest.c40 struct vhost_virtqueue *vq = &n->vqs[VHOST_TEST_VQ]; in handle_vq() local
46 mutex_lock(&vq->mutex); in handle_vq()
47 private = vq->private_data; in handle_vq()
49 mutex_unlock(&vq->mutex); in handle_vq()
53 vhost_disable_notify(&n->dev, vq); in handle_vq()
56 head = vhost_get_vq_desc(vq, vq->iov, in handle_vq()
57 ARRAY_SIZE(vq->iov), in handle_vq()
64 if (head == vq->num) { in handle_vq()
65 if (unlikely(vhost_enable_notify(&n->dev, vq))) { in handle_vq()
66 vhost_disable_notify(&n->dev, vq); in handle_vq()
[all …]
Dscsi.c175 struct vhost_virtqueue vq; member
231 struct vhost_virtqueue *vq; in vhost_scsi_init_inflight() local
235 vq = &vs->vqs[i].vq; in vhost_scsi_init_inflight()
237 mutex_lock(&vq->mutex); in vhost_scsi_init_inflight()
250 mutex_unlock(&vq->mutex); in vhost_scsi_init_inflight()
255 vhost_scsi_get_inflight(struct vhost_virtqueue *vq) in vhost_scsi_get_inflight() argument
260 svq = container_of(vq, struct vhost_scsi_virtqueue, vq); in vhost_scsi_get_inflight()
408 struct vhost_virtqueue *vq = &vs->vqs[VHOST_SCSI_VQ_EVT].vq; in vhost_scsi_allocate_evt() local
418 vq_err(vq, "Failed to allocate vhost_scsi_evt\n"); in vhost_scsi_allocate_evt()
423 evt->event.event = cpu_to_vhost32(vq, event); in vhost_scsi_allocate_evt()
[all …]
Dvhost.h148 struct vhost_virtqueue *vq; member
179 int vhost_vq_access_ok(struct vhost_virtqueue *vq);
201 int vhost_log_write(struct vhost_virtqueue *vq, struct vhost_log *log,
203 int vq_iotlb_prefetch(struct vhost_virtqueue *vq);
205 struct vhost_msg_node *vhost_new_msg(struct vhost_virtqueue *vq, int type);
219 #define vq_err(vq, fmt, ...) do { \ argument
221 if ((vq)->error_ctx) \
222 eventfd_signal((vq)->error_ctx, 1);\
234 static inline bool vhost_has_feature(struct vhost_virtqueue *vq, int bit) in vhost_has_feature() argument
236 return vq->acked_features & (1ULL << bit); in vhost_has_feature()
[all …]
/drivers/remoteproc/
Dremoteproc_virtio.c33 static bool rproc_virtio_notify(struct virtqueue *vq) in rproc_virtio_notify() argument
35 struct rproc_vring *rvring = vq->priv; in rproc_virtio_notify()
64 if (!rvring || !rvring->vq) in rproc_vq_interrupt()
67 return vring_interrupt(0, rvring->vq); in rproc_vq_interrupt()
73 void (*callback)(struct virtqueue *vq), in rp_find_vq() argument
80 struct virtqueue *vq; in rp_find_vq() local
110 vq = vring_new_virtqueue(id, len, rvring->align, vdev, false, addr, in rp_find_vq()
112 if (!vq) { in rp_find_vq()
118 rvring->vq = vq; in rp_find_vq()
119 vq->priv = rvring; in rp_find_vq()
[all …]
/drivers/s390/virtio/
Dkvm_virtio.c174 static bool kvm_notify(struct virtqueue *vq) in kvm_notify() argument
177 struct kvm_vqconfig *config = vq->priv; in kvm_notify()
191 void (*callback)(struct virtqueue *vq), in kvm_find_vq() argument
196 struct virtqueue *vq; in kvm_find_vq() local
213 vq = vring_new_virtqueue(index, config->num, KVM_S390_VIRTIO_RING_ALIGN, in kvm_find_vq()
216 if (!vq) { in kvm_find_vq()
225 config->token = (u64) vq; in kvm_find_vq()
227 vq->priv = config; in kvm_find_vq()
228 return vq; in kvm_find_vq()
237 static void kvm_del_vq(struct virtqueue *vq) in kvm_del_vq() argument
[all …]
Dvirtio_ccw.c111 struct virtqueue *vq; member
170 static void drop_airq_indicator(struct virtqueue *vq, struct airq_info *info) in drop_airq_indicator() argument
176 if (vq == (void *)airq_iv_get_ptr(info->aiv, i)) { in drop_airq_indicator()
286 drop_airq_indicator(info->vq, vcdev->airq_info); in virtio_ccw_drop_indicators()
396 static bool virtio_ccw_kvm_notify(struct virtqueue *vq) in virtio_ccw_kvm_notify() argument
398 struct virtio_ccw_vq_info *info = vq->priv; in virtio_ccw_kvm_notify()
402 vcdev = to_vc_device(info->vq->vdev); in virtio_ccw_kvm_notify()
404 info->cookie = do_kvm_notify(schid, vq->index, info->cookie); in virtio_ccw_kvm_notify()
426 static void virtio_ccw_del_vq(struct virtqueue *vq, struct ccw1 *ccw) in virtio_ccw_del_vq() argument
428 struct virtio_ccw_device *vcdev = to_vc_device(vq->vdev); in virtio_ccw_del_vq()
[all …]
/drivers/media/v4l2-core/
Dv4l2-mem2mem.c310 struct vb2_queue *vq; in v4l2_m2m_reqbufs() local
313 vq = v4l2_m2m_get_vq(m2m_ctx, reqbufs->type); in v4l2_m2m_reqbufs()
314 ret = vb2_reqbufs(vq, reqbufs); in v4l2_m2m_reqbufs()
318 vq->owner = reqbufs->count ? file->private_data : NULL; in v4l2_m2m_reqbufs()
327 struct vb2_queue *vq; in v4l2_m2m_querybuf() local
331 vq = v4l2_m2m_get_vq(m2m_ctx, buf->type); in v4l2_m2m_querybuf()
332 ret = vb2_querybuf(vq, buf); in v4l2_m2m_querybuf()
335 if (buf->memory == V4L2_MEMORY_MMAP && !V4L2_TYPE_IS_OUTPUT(vq->type)) { in v4l2_m2m_querybuf()
336 if (V4L2_TYPE_IS_MULTIPLANAR(vq->type)) { in v4l2_m2m_querybuf()
352 struct vb2_queue *vq; in v4l2_m2m_qbuf() local
[all …]
/drivers/scsi/
Dvirtio_scsi.c66 struct virtqueue *vq; member
224 struct virtqueue *vq = virtscsi_vq->vq; in virtscsi_vq_done() local
228 virtqueue_disable_cb(vq); in virtscsi_vq_done()
229 while ((buf = virtqueue_get_buf(vq, &len)) != NULL) in virtscsi_vq_done()
232 if (unlikely(virtqueue_is_broken(vq))) in virtscsi_vq_done()
234 } while (!virtqueue_enable_cb(vq)); in virtscsi_vq_done()
238 static void virtscsi_req_done(struct virtqueue *vq) in virtscsi_req_done() argument
240 struct Scsi_Host *sh = virtio_scsi_host(vq->vdev); in virtscsi_req_done()
242 int index = vq->index - VIRTIO_SCSI_VQ_BASE; in virtscsi_req_done()
266 static void virtscsi_ctrl_done(struct virtqueue *vq) in virtscsi_ctrl_done() argument
[all …]
/drivers/char/hw_random/
Dvirtio-rng.c32 struct virtqueue *vq; member
42 static void random_recv_done(struct virtqueue *vq) in random_recv_done() argument
44 struct virtrng_info *vi = vq->vdev->priv; in random_recv_done()
47 if (!virtqueue_get_buf(vi->vq, &vi->data_avail)) in random_recv_done()
61 virtqueue_add_inbuf(vi->vq, &sg, 1, buf, GFP_KERNEL); in register_buffer()
63 virtqueue_kick(vi->vq); in register_buffer()
127 vi->vq = virtio_find_single_vq(vdev, random_recv_done, "input"); in probe_common()
128 if (IS_ERR(vi->vq)) { in probe_common()
129 err = PTR_ERR(vi->vq); in probe_common()
/drivers/gpu/drm/virtio/
Dvirtgpu_vq.c61 void virtio_gpu_ctrl_ack(struct virtqueue *vq) in virtio_gpu_ctrl_ack() argument
63 struct drm_device *dev = vq->vdev->priv; in virtio_gpu_ctrl_ack()
68 void virtio_gpu_cursor_ack(struct virtqueue *vq) in virtio_gpu_cursor_ack() argument
70 struct drm_device *dev = vq->vdev->priv; in virtio_gpu_cursor_ack()
83 count += virtqueue_get_vring_size(vgdev->ctrlq.vq); in virtio_gpu_alloc_vbufs()
84 count += virtqueue_get_vring_size(vgdev->cursorq.vq); in virtio_gpu_alloc_vbufs()
107 count += virtqueue_get_vring_size(vgdev->ctrlq.vq); in virtio_gpu_free_vbufs()
108 count += virtqueue_get_vring_size(vgdev->cursorq.vq); in virtio_gpu_free_vbufs()
214 static void reclaim_vbufs(struct virtqueue *vq, struct list_head *reclaim_list) in reclaim_vbufs() argument
220 while ((vbuf = virtqueue_get_buf(vq, &len))) { in reclaim_vbufs()
[all …]
/drivers/net/
Dvirtio_net.c76 struct virtqueue *vq; member
88 struct virtqueue *vq; member
179 static int vq2txq(struct virtqueue *vq) in vq2txq() argument
181 return (vq->index - 1) / 2; in vq2txq()
189 static int vq2rxq(struct virtqueue *vq) in vq2rxq() argument
191 return vq->index / 2; in vq2rxq()
231 static void skb_xmit_done(struct virtqueue *vq) in skb_xmit_done() argument
233 struct virtnet_info *vi = vq->vdev->priv; in skb_xmit_done()
236 virtqueue_disable_cb(vq); in skb_xmit_done()
239 netif_wake_subqueue(vi->dev, vq2txq(vq)); in skb_xmit_done()
[all …]
/drivers/media/platform/sti/hva/
Dhva-v4l2.c433 struct vb2_queue *vq; in hva_s_fmt_stream() local
443 vq = v4l2_m2m_get_vq(ctx->fh.m2m_ctx, f->type); in hva_s_fmt_stream()
444 if (vb2_is_streaming(vq)) { in hva_s_fmt_stream()
464 struct vb2_queue *vq; in hva_s_fmt_frame() local
474 vq = v4l2_m2m_get_vq(ctx->fh.m2m_ctx, f->type); in hva_s_fmt_frame()
475 if (vb2_is_streaming(vq)) { in hva_s_fmt_frame()
546 struct vb2_queue *vq; in hva_qbuf() local
549 vq = v4l2_m2m_get_vq(ctx->fh.m2m_ctx, buf->type); in hva_qbuf()
551 if (buf->index >= vq->num_buffers) { in hva_qbuf()
553 ctx->name, buf->index, vq->num_buffers); in hva_qbuf()
[all …]
/drivers/media/platform/vivid/
Dvivid-vbi-out.c30 static int vbi_out_queue_setup(struct vb2_queue *vq, in vbi_out_queue_setup() argument
34 struct vivid_dev *dev = vb2_get_drv_priv(vq); in vbi_out_queue_setup()
36 unsigned size = vq->type == V4L2_BUF_TYPE_SLICED_VBI_OUTPUT ? in vbi_out_queue_setup()
45 if (vq->num_buffers + *nbuffers < 2) in vbi_out_queue_setup()
46 *nbuffers = 2 - vq->num_buffers; in vbi_out_queue_setup()
93 static int vbi_out_start_streaming(struct vb2_queue *vq, unsigned count) in vbi_out_start_streaming() argument
95 struct vivid_dev *dev = vb2_get_drv_priv(vq); in vbi_out_start_streaming()
119 static void vbi_out_stop_streaming(struct vb2_queue *vq) in vbi_out_stop_streaming() argument
121 struct vivid_dev *dev = vb2_get_drv_priv(vq); in vbi_out_stop_streaming()
/drivers/misc/mic/vop/
Dvop_main.c238 static bool vop_notify(struct virtqueue *vq) in vop_notify() argument
240 struct _vop_vdev *vdev = vq->priv; in vop_notify()
247 static void vop_del_vq(struct virtqueue *vq, int n) in vop_del_vq() argument
249 struct _vop_vdev *vdev = to_vopvdev(vq->vdev); in vop_del_vq()
250 struct vring *vr = (struct vring *)(vq + 1); in vop_del_vq()
256 vring_del_virtqueue(vq); in vop_del_vq()
264 struct virtqueue *vq, *n; in vop_del_vqs() local
269 list_for_each_entry_safe(vq, n, &dev->vqs, list) in vop_del_vqs()
270 vop_del_vq(vq, idx++); in vop_del_vqs()
280 void (*callback)(struct virtqueue *vq), in vop_find_vq() argument
[all …]
/drivers/block/
Dvirtio_blk.c26 struct virtqueue *vq; member
75 static int __virtblk_add_req(struct virtqueue *vq, in __virtblk_add_req() argument
82 __virtio32 type = vbr->out_hdr.type & ~cpu_to_virtio32(vq->vdev, VIRTIO_BLK_T_OUT); in __virtblk_add_req()
93 if (type == cpu_to_virtio32(vq->vdev, VIRTIO_BLK_T_SCSI_CMD)) { in __virtblk_add_req()
99 if (vbr->out_hdr.type & cpu_to_virtio32(vq->vdev, VIRTIO_BLK_T_OUT)) in __virtblk_add_req()
105 if (type == cpu_to_virtio32(vq->vdev, VIRTIO_BLK_T_SCSI_CMD)) { in __virtblk_add_req()
116 return virtqueue_add_sgs(vq, sgs, num_out, num_in, vbr, GFP_ATOMIC); in __virtblk_add_req()
136 static void virtblk_done(struct virtqueue *vq) in virtblk_done() argument
138 struct virtio_blk *vblk = vq->vdev->priv; in virtblk_done()
140 int qid = vq->index; in virtblk_done()
[all …]
/drivers/char/
Dvirtio_console.c329 struct virtqueue *vq) in find_port_by_vq() argument
336 if (port->in_vq == vq || port->out_vq == vq) in find_port_by_vq()
425 static struct port_buffer *alloc_buf(struct virtqueue *vq, size_t buf_size, in alloc_buf() argument
448 if (is_rproc_serial(vq->vdev)) { in alloc_buf()
458 if (!vq->vdev->dev.parent || !vq->vdev->dev.parent->parent) in alloc_buf()
460 buf->dev = vq->vdev->dev.parent->parent; in alloc_buf()
508 static int add_inbuf(struct virtqueue *vq, struct port_buffer *buf) in add_inbuf() argument
515 ret = virtqueue_add_inbuf(vq, sg, 1, buf, GFP_ATOMIC); in add_inbuf()
516 virtqueue_kick(vq); in add_inbuf()
518 ret = vq->num_free; in add_inbuf()
[all …]

12345