/drivers/virtio/ |
D | virtio_ring.c | 21 dev_err(&(_vq)->vq.vdev->dev, \ 22 "%s:"fmt, (_vq)->vq.name, ##args); \ 30 (_vq)->vq.name, (_vq)->in_use); \ 58 dev_err(&_vq->vq.vdev->dev, \ 59 "%s:"fmt, (_vq)->vq.name, ##args); \ 62 #define START_USE(vq) argument 63 #define END_USE(vq) argument 64 #define LAST_ADD_TIME_UPDATE(vq) argument 65 #define LAST_ADD_TIME_CHECK(vq) argument 66 #define LAST_ADD_TIME_INVALID(vq) argument [all …]
|
D | virtio_vdpa.c | 39 struct virtqueue *vq; member 107 static bool virtio_vdpa_notify(struct virtqueue *vq) in virtio_vdpa_notify() argument 109 struct vdpa_device *vdpa = vd_get_vdpa(vq->vdev); in virtio_vdpa_notify() 112 ops->kick_vq(vdpa, vq->index); in virtio_vdpa_notify() 130 return vring_interrupt(0, info->vq); in virtio_vdpa_virtqueue_cb() 135 void (*callback)(struct virtqueue *vq), in virtio_vdpa_setup_vq() argument 143 struct virtqueue *vq; in virtio_vdpa_setup_vq() local 174 vq = vring_create_virtqueue(index, num, align, vdev, in virtio_vdpa_setup_vq() 177 if (!vq) { in virtio_vdpa_setup_vq() 186 ops->set_vq_num(vdpa, index, virtqueue_get_vring_size(vq)); in virtio_vdpa_setup_vq() [all …]
|
D | virtio_pci_modern.c | 187 void (*callback)(struct virtqueue *vq), in setup_vq() argument 194 struct virtqueue *vq; in setup_vq() local 214 vq = vring_create_virtqueue(index, num, in setup_vq() 218 if (!vq) in setup_vq() 222 vp_modern_set_queue_size(mdev, index, virtqueue_get_vring_size(vq)); in setup_vq() 223 vp_modern_queue_address(mdev, index, virtqueue_get_desc_addr(vq), in setup_vq() 224 virtqueue_get_avail_addr(vq), in setup_vq() 225 virtqueue_get_used_addr(vq)); in setup_vq() 227 vq->priv = (void __force *)vp_modern_map_vq_notify(mdev, index, NULL); in setup_vq() 228 if (!vq->priv) { in setup_vq() [all …]
|
D | virtio_pci_common.c | 41 bool vp_notify(struct virtqueue *vq) in vp_notify() argument 45 iowrite16(vq->index, (void __iomem *)vq->priv); in vp_notify() 68 if (vring_interrupt(irq, info->vq) == IRQ_HANDLED) in vp_vring_interrupt() 175 void (*callback)(struct virtqueue *vq), in vp_setup_vq() argument 182 struct virtqueue *vq; in vp_setup_vq() local 189 vq = vp_dev->setup_vq(vp_dev, info, index, callback, name, ctx, in vp_setup_vq() 191 if (IS_ERR(vq)) in vp_setup_vq() 194 info->vq = vq; in vp_setup_vq() 204 return vq; in vp_setup_vq() 208 return vq; in vp_setup_vq() [all …]
|
D | virtio_pci_legacy.c | 116 void (*callback)(struct virtqueue *vq), in setup_vq() argument 121 struct virtqueue *vq; in setup_vq() local 137 vq = vring_create_virtqueue(index, num, in setup_vq() 141 if (!vq) in setup_vq() 144 q_pfn = virtqueue_get_desc_addr(vq) >> VIRTIO_PCI_QUEUE_ADDR_SHIFT; in setup_vq() 156 vq->priv = (void __force *)vp_dev->ioaddr + VIRTIO_PCI_QUEUE_NOTIFY; in setup_vq() 167 return vq; in setup_vq() 172 vring_del_virtqueue(vq); in setup_vq() 178 struct virtqueue *vq = info->vq; in del_vq() local 179 struct virtio_pci_device *vp_dev = to_vp_device(vq->vdev); in del_vq() [all …]
|
D | virtio_mmio.c | 98 struct virtqueue *vq; member 273 static bool vm_notify(struct virtqueue *vq) in vm_notify() argument 275 struct virtio_mmio_device *vm_dev = to_virtio_mmio_device(vq->vdev); in vm_notify() 279 writel(vq->index, vm_dev->base + VIRTIO_MMIO_QUEUE_NOTIFY); in vm_notify() 304 ret |= vring_interrupt(irq, info->vq); in vm_interrupt() 313 static void vm_del_vq(struct virtqueue *vq) in vm_del_vq() argument 315 struct virtio_mmio_device *vm_dev = to_virtio_mmio_device(vq->vdev); in vm_del_vq() 316 struct virtio_mmio_vq_info *info = vq->priv; in vm_del_vq() 318 unsigned int index = vq->index; in vm_del_vq() 333 vring_del_virtqueue(vq); in vm_del_vq() [all …]
|
D | virtio_balloon.c | 145 static void balloon_ack(struct virtqueue *vq) in balloon_ack() argument 147 struct virtio_balloon *vb = vq->vdev->priv; in balloon_ack() 152 static void tell_host(struct virtio_balloon *vb, struct virtqueue *vq) in tell_host() argument 160 virtqueue_add_outbuf(vq, &sg, 1, vb, GFP_KERNEL); in tell_host() 161 virtqueue_kick(vq); in tell_host() 164 wait_event(vb->acked, virtqueue_get_buf(vq, &len)); in tell_host() 173 struct virtqueue *vq = vb->reporting_vq; in virtballoon_free_page_report() local 177 err = virtqueue_add_inbuf(vq, sg, nents, vb, GFP_NOWAIT | __GFP_NOWARN); in virtballoon_free_page_report() 187 virtqueue_kick(vq); in virtballoon_free_page_report() 190 wait_event(vb->acked, virtqueue_get_buf(vq, &unused)); in virtballoon_free_page_report() [all …]
|
/drivers/vhost/ |
D | vhost.c | 49 #define vhost_used_event(vq) ((__virtio16 __user *)&vq->avail->ring[vq->num]) argument 50 #define vhost_avail_event(vq) ((__virtio16 __user *)&vq->used->ring[vq->num]) argument 53 static void vhost_disable_cross_endian(struct vhost_virtqueue *vq) in vhost_disable_cross_endian() argument 55 vq->user_be = !virtio_legacy_is_little_endian(); in vhost_disable_cross_endian() 58 static void vhost_enable_cross_endian_big(struct vhost_virtqueue *vq) in vhost_enable_cross_endian_big() argument 60 vq->user_be = true; in vhost_enable_cross_endian_big() 63 static void vhost_enable_cross_endian_little(struct vhost_virtqueue *vq) in vhost_enable_cross_endian_little() argument 65 vq->user_be = false; in vhost_enable_cross_endian_little() 68 static long vhost_set_vring_endian(struct vhost_virtqueue *vq, int __user *argp) in vhost_set_vring_endian() argument 72 if (vq->private_data) in vhost_set_vring_endian() [all …]
|
D | net.c | 97 struct vhost_virtqueue *vq; member 108 struct vhost_virtqueue vq; member 228 static void vhost_net_enable_zcopy(int vq) in vhost_net_enable_zcopy() argument 230 vhost_net_zcopy_mask |= 0x1 << vq; in vhost_net_enable_zcopy() 234 vhost_net_ubuf_alloc(struct vhost_virtqueue *vq, bool zcopy) in vhost_net_ubuf_alloc() argument 245 ubufs->vq = vq; in vhost_net_ubuf_alloc() 359 struct vhost_virtqueue *vq) in vhost_zerocopy_signal_used() argument 362 container_of(vq, struct vhost_net_virtqueue, vq); in vhost_zerocopy_signal_used() 367 if (vq->heads[i].len == VHOST_DMA_FAILED_LEN) in vhost_zerocopy_signal_used() 369 if (VHOST_DMA_IS_DONE(vq->heads[i].len)) { in vhost_zerocopy_signal_used() [all …]
|
D | test.c | 45 struct vhost_virtqueue *vq = &n->vqs[VHOST_TEST_VQ]; in handle_vq() local 51 mutex_lock(&vq->mutex); in handle_vq() 52 private = vhost_vq_get_backend(vq); in handle_vq() 54 mutex_unlock(&vq->mutex); in handle_vq() 58 vhost_disable_notify(&n->dev, vq); in handle_vq() 61 head = vhost_get_vq_desc(vq, vq->iov, in handle_vq() 62 ARRAY_SIZE(vq->iov), in handle_vq() 69 if (head == vq->num) { in handle_vq() 70 if (unlikely(vhost_enable_notify(&n->dev, vq))) { in handle_vq() 71 vhost_disable_notify(&n->dev, vq); in handle_vq() [all …]
|
D | scsi.c | 166 struct vhost_virtqueue vq; member 245 struct vhost_virtqueue *vq; in vhost_scsi_init_inflight() local 249 vq = &vs->vqs[i].vq; in vhost_scsi_init_inflight() 251 mutex_lock(&vq->mutex); in vhost_scsi_init_inflight() 264 mutex_unlock(&vq->mutex); in vhost_scsi_init_inflight() 269 vhost_scsi_get_inflight(struct vhost_virtqueue *vq) in vhost_scsi_get_inflight() argument 274 svq = container_of(vq, struct vhost_scsi_virtqueue, vq); in vhost_scsi_get_inflight() 330 struct vhost_scsi_virtqueue, vq); in vhost_scsi_release_cmd_res() 433 struct vhost_virtqueue *vq = &vs->vqs[VHOST_SCSI_VQ_EVT].vq; in vhost_scsi_allocate_evt() local 443 vq_err(vq, "Failed to allocate vhost_scsi_evt\n"); in vhost_scsi_allocate_evt() [all …]
|
D | vsock.c | 92 struct vhost_virtqueue *vq) in vhost_transport_do_send_pkt() argument 99 mutex_lock(&vq->mutex); in vhost_transport_do_send_pkt() 101 if (!vhost_vq_get_backend(vq)) in vhost_transport_do_send_pkt() 104 if (!vq_meta_prefetch(vq)) in vhost_transport_do_send_pkt() 108 vhost_disable_notify(&vsock->dev, vq); in vhost_transport_do_send_pkt() 122 vhost_enable_notify(&vsock->dev, vq); in vhost_transport_do_send_pkt() 131 head = vhost_get_vq_desc(vq, vq->iov, ARRAY_SIZE(vq->iov), in vhost_transport_do_send_pkt() 140 if (head == vq->num) { in vhost_transport_do_send_pkt() 148 if (unlikely(vhost_enable_notify(&vsock->dev, vq))) { in vhost_transport_do_send_pkt() 149 vhost_disable_notify(&vsock->dev, vq); in vhost_transport_do_send_pkt() [all …]
|
D | vhost.h | 145 struct vhost_virtqueue *vq; member 172 bool vhost_exceeds_weight(struct vhost_virtqueue *vq, int pkts, int total_len); 187 bool vhost_vq_access_ok(struct vhost_virtqueue *vq); 197 bool vhost_vq_is_setup(struct vhost_virtqueue *vq); 211 int vhost_log_write(struct vhost_virtqueue *vq, struct vhost_log *log, 214 int vq_meta_prefetch(struct vhost_virtqueue *vq); 216 struct vhost_msg_node *vhost_new_msg(struct vhost_virtqueue *vq, int type); 235 #define vq_err(vq, fmt, ...) do { \ argument 237 if ((vq)->error_ctx) \ 238 eventfd_signal((vq)->error_ctx, 1);\ [all …]
|
/drivers/vdpa/vdpa_sim/ |
D | vdpa_sim_blk.c | 62 struct vdpasim_virtqueue *vq) in vdpasim_blk_handle_req() argument 73 ret = vringh_getdesc_iotlb(&vq->vring, &vq->out_iov, &vq->in_iov, in vdpasim_blk_handle_req() 74 &vq->head, GFP_ATOMIC); in vdpasim_blk_handle_req() 78 if (vq->out_iov.used < 1 || vq->in_iov.used < 1) { in vdpasim_blk_handle_req() 80 vq->out_iov.used, vq->in_iov.used); in vdpasim_blk_handle_req() 84 if (vq->in_iov.iov[vq->in_iov.used - 1].iov_len < 1) { in vdpasim_blk_handle_req() 92 to_push = vringh_kiov_length(&vq->in_iov) - 1; in vdpasim_blk_handle_req() 94 to_pull = vringh_kiov_length(&vq->out_iov); in vdpasim_blk_handle_req() 96 bytes = vringh_iov_pull_iotlb(&vq->vring, &vq->out_iov, &hdr, in vdpasim_blk_handle_req() 120 bytes = vringh_iov_push_iotlb(&vq->vring, &vq->in_iov, in vdpasim_blk_handle_req() [all …]
|
D | vdpa_sim.c | 56 struct vdpasim_virtqueue *vq = in vdpasim_vq_notify() local 59 if (!vq->cb) in vdpasim_vq_notify() 62 vq->cb(vq->private); in vdpasim_vq_notify() 67 struct vdpasim_virtqueue *vq = &vdpasim->vqs[idx]; in vdpasim_queue_ready() local 68 uint16_t last_avail_idx = vq->vring.last_avail_idx; in vdpasim_queue_ready() 70 vringh_init_iotlb(&vq->vring, vdpasim->features, vq->num, false, in vdpasim_queue_ready() 71 (struct vring_desc *)(uintptr_t)vq->desc_addr, in vdpasim_queue_ready() 73 (uintptr_t)vq->driver_addr, in vdpasim_queue_ready() 75 (uintptr_t)vq->device_addr); in vdpasim_queue_ready() 77 vq->vring.last_avail_idx = last_avail_idx; in vdpasim_queue_ready() [all …]
|
/drivers/gpu/drm/virtio/ |
D | virtgpu_trace.h | 12 TP_PROTO(struct virtqueue *vq, struct virtio_gpu_ctrl_hdr *hdr), 13 TP_ARGS(vq, hdr), 16 __field(unsigned int, vq) 24 __entry->dev = vq->vdev->index; 25 __entry->vq = vq->index; 26 __entry->name = vq->name; 33 __entry->dev, __entry->vq, __entry->name, 39 TP_PROTO(struct virtqueue *vq, struct virtio_gpu_ctrl_hdr *hdr), 40 TP_ARGS(vq, hdr) 44 TP_PROTO(struct virtqueue *vq, struct virtio_gpu_ctrl_hdr *hdr), [all …]
|
/drivers/vdpa/vdpa_user/ |
D | vduse_dev.c | 229 struct vduse_virtqueue *vq, in vduse_dev_get_vq_state_packed() argument 236 msg.req.vq_state.index = vq->index; in vduse_dev_get_vq_state_packed() 255 struct vduse_virtqueue *vq, in vduse_dev_get_vq_state_split() argument 262 msg.req.vq_state.index = vq->index; in vduse_dev_get_vq_state_split() 426 struct vduse_virtqueue *vq = &dev->vqs[i]; in vduse_dev_reset() local 428 vq->ready = false; in vduse_dev_reset() 429 vq->desc_addr = 0; in vduse_dev_reset() 430 vq->driver_addr = 0; in vduse_dev_reset() 431 vq->device_addr = 0; in vduse_dev_reset() 432 vq->num = 0; in vduse_dev_reset() [all …]
|
/drivers/staging/media/sunxi/cedrus/ |
D | cedrus_video.c | 288 struct vb2_queue *vq; in cedrus_s_fmt_vid_cap() local 291 vq = v4l2_m2m_get_vq(ctx->fh.m2m_ctx, f->type); in cedrus_s_fmt_vid_cap() 292 if (vb2_is_busy(vq)) in cedrus_s_fmt_vid_cap() 308 struct vb2_queue *vq; in cedrus_s_fmt_vid_out() local 316 vq = v4l2_m2m_get_vq(ctx->fh.m2m_ctx, f->type); in cedrus_s_fmt_vid_out() 322 if (vb2_is_streaming(vq) || (vb2_is_busy(vq) && in cedrus_s_fmt_vid_out() 344 vq->subsystem_flags |= in cedrus_s_fmt_vid_out() 348 vq->subsystem_flags &= in cedrus_s_fmt_vid_out() 396 static int cedrus_queue_setup(struct vb2_queue *vq, unsigned int *nbufs, in cedrus_queue_setup() argument 400 struct cedrus_ctx *ctx = vb2_get_drv_priv(vq); in cedrus_queue_setup() [all …]
|
/drivers/i2c/busses/ |
D | i2c-virtio.c | 31 struct virtqueue *vq; member 48 static void virtio_i2c_msg_done(struct virtqueue *vq) in virtio_i2c_msg_done() argument 53 while ((req = virtqueue_get_buf(vq, &len))) in virtio_i2c_msg_done() 57 static int virtio_i2c_prepare_reqs(struct virtqueue *vq, in virtio_i2c_prepare_reqs() argument 102 if (virtqueue_add_sgs(vq, sgs, outcnt, incnt, &reqs[i], GFP_KERNEL)) { in virtio_i2c_prepare_reqs() 111 static int virtio_i2c_complete_reqs(struct virtqueue *vq, in virtio_i2c_complete_reqs() argument 139 struct virtqueue *vq = vi->vq; in virtio_i2c_xfer() local 147 count = virtio_i2c_prepare_reqs(vq, reqs, msgs, num); in virtio_i2c_xfer() 159 virtqueue_kick(vq); in virtio_i2c_xfer() 161 count = virtio_i2c_complete_reqs(vq, reqs, msgs, count); in virtio_i2c_xfer() [all …]
|
/drivers/scsi/ |
D | virtio_scsi.c | 67 struct virtqueue *vq; member 176 struct virtqueue *vq = virtscsi_vq->vq; in virtscsi_vq_done() local 180 virtqueue_disable_cb(vq); in virtscsi_vq_done() 181 while ((buf = virtqueue_get_buf(vq, &len)) != NULL) in virtscsi_vq_done() 184 if (unlikely(virtqueue_is_broken(vq))) in virtscsi_vq_done() 186 } while (!virtqueue_enable_cb(vq)); in virtscsi_vq_done() 190 static void virtscsi_req_done(struct virtqueue *vq) in virtscsi_req_done() argument 192 struct Scsi_Host *sh = virtio_scsi_host(vq->vdev); in virtscsi_req_done() 194 int index = vq->index - VIRTIO_SCSI_VQ_BASE; in virtscsi_req_done() 218 static void virtscsi_ctrl_done(struct virtqueue *vq) in virtscsi_ctrl_done() argument [all …]
|
/drivers/remoteproc/ |
D | remoteproc_virtio.c | 27 static bool rproc_virtio_notify(struct virtqueue *vq) in rproc_virtio_notify() argument 29 struct rproc_vring *rvring = vq->priv; in rproc_virtio_notify() 58 if (!rvring || !rvring->vq) in rproc_vq_interrupt() 61 return vring_interrupt(0, rvring->vq); in rproc_vq_interrupt() 67 void (*callback)(struct virtqueue *vq), in rp_find_vq() argument 76 struct virtqueue *vq; in rp_find_vq() local 108 vq = vring_new_virtqueue(id, len, rvring->align, vdev, false, ctx, in rp_find_vq() 110 if (!vq) { in rp_find_vq() 116 rvring->vq = vq; in rp_find_vq() 117 vq->priv = rvring; in rp_find_vq() [all …]
|
/drivers/net/ |
D | virtio_net.c | 125 struct virtqueue *vq; member 141 struct virtqueue *vq; member 276 static int vq2txq(struct virtqueue *vq) in vq2txq() argument 278 return (vq->index - 1) / 2; in vq2txq() 286 static int vq2rxq(struct virtqueue *vq) in vq2rxq() argument 288 return vq->index / 2; in vq2rxq() 343 struct virtqueue *vq) in virtqueue_napi_schedule() argument 346 virtqueue_disable_cb(vq); in virtqueue_napi_schedule() 352 struct virtqueue *vq, int processed) in virtqueue_napi_complete() argument 356 opaque = virtqueue_enable_cb_prepare(vq); in virtqueue_napi_complete() [all …]
|
/drivers/staging/media/imx/ |
D | imx-media-capture.c | 598 static int capture_queue_setup(struct vb2_queue *vq, in capture_queue_setup() argument 604 struct capture_priv *priv = vb2_get_drv_priv(vq); in capture_queue_setup() 608 if (vq->type != V4L2_BUF_TYPE_VIDEO_CAPTURE) in capture_queue_setup() 614 count += vq->num_buffers; in capture_queue_setup() 620 *nbuffers = (count < vq->num_buffers) ? 0 : in capture_queue_setup() 621 count - vq->num_buffers; in capture_queue_setup() 642 struct vb2_queue *vq = vb->vb2_queue; in capture_buf_prepare() local 643 struct capture_priv *priv = vb2_get_drv_priv(vq); in capture_buf_prepare() 706 static int capture_start_streaming(struct vb2_queue *vq, unsigned int count) in capture_start_streaming() argument 708 struct capture_priv *priv = vb2_get_drv_priv(vq); in capture_start_streaming() [all …]
|
/drivers/media/v4l2-core/ |
D | v4l2-mem2mem.c | 574 struct vb2_queue *vq; in v4l2_m2m_reqbufs() local 577 vq = v4l2_m2m_get_vq(m2m_ctx, reqbufs->type); in v4l2_m2m_reqbufs() 578 ret = vb2_reqbufs(vq, reqbufs); in v4l2_m2m_reqbufs() 582 vq->owner = reqbufs->count ? file->private_data : NULL; in v4l2_m2m_reqbufs() 588 static void v4l2_m2m_adjust_mem_offset(struct vb2_queue *vq, in v4l2_m2m_adjust_mem_offset() argument 592 if (buf->memory == V4L2_MEMORY_MMAP && V4L2_TYPE_IS_CAPTURE(vq->type)) { in v4l2_m2m_adjust_mem_offset() 593 if (V4L2_TYPE_IS_MULTIPLANAR(vq->type)) { in v4l2_m2m_adjust_mem_offset() 608 struct vb2_queue *vq; in v4l2_m2m_querybuf() local 611 vq = v4l2_m2m_get_vq(m2m_ctx, buf->type); in v4l2_m2m_querybuf() 612 ret = vb2_querybuf(vq, buf); in v4l2_m2m_querybuf() [all …]
|
/drivers/s390/virtio/ |
D | virtio_ccw.c | 123 struct virtqueue *vq; member 191 static void drop_airq_indicator(struct virtqueue *vq, struct airq_info *info) in drop_airq_indicator() argument 197 if (vq == (void *)airq_iv_get_ptr(info->aiv, i)) { in drop_airq_indicator() 303 drop_airq_indicator(info->vq, vcdev->airq_info); in virtio_ccw_drop_indicators() 391 static bool virtio_ccw_kvm_notify(struct virtqueue *vq) in virtio_ccw_kvm_notify() argument 393 struct virtio_ccw_vq_info *info = vq->priv; in virtio_ccw_kvm_notify() 397 vcdev = to_vc_device(info->vq->vdev); in virtio_ccw_kvm_notify() 402 vq->index, info->cookie); in virtio_ccw_kvm_notify() 424 static void virtio_ccw_del_vq(struct virtqueue *vq, struct ccw1 *ccw) in virtio_ccw_del_vq() argument 426 struct virtio_ccw_device *vcdev = to_vc_device(vq->vdev); in virtio_ccw_del_vq() [all …]
|