Lines Matching refs:vdpa
41 struct vdpa_device *vdpa; member
62 const struct vdpa_config_ops *ops = v->vdpa->config; in handle_vq_kick()
64 ops->kick_vq(v->vdpa, vq - v->vqs); in handle_vq_kick()
92 const struct vdpa_config_ops *ops = v->vdpa->config; in vhost_vdpa_setup_vq_irq()
93 struct vdpa_device *vdpa = v->vdpa; in vhost_vdpa_setup_vq_irq() local
99 irq = ops->get_vq_irq(vdpa, qid); in vhost_vdpa_setup_vq_irq()
124 struct vdpa_device *vdpa = v->vdpa; in vhost_vdpa_reset() local
128 return vdpa_reset(vdpa); in vhost_vdpa_reset()
133 struct vdpa_device *vdpa = v->vdpa; in vhost_vdpa_get_device_id() local
134 const struct vdpa_config_ops *ops = vdpa->config; in vhost_vdpa_get_device_id()
137 device_id = ops->get_device_id(vdpa); in vhost_vdpa_get_device_id()
147 struct vdpa_device *vdpa = v->vdpa; in vhost_vdpa_get_status() local
148 const struct vdpa_config_ops *ops = vdpa->config; in vhost_vdpa_get_status()
151 status = ops->get_status(vdpa); in vhost_vdpa_get_status()
161 struct vdpa_device *vdpa = v->vdpa; in vhost_vdpa_set_status() local
162 const struct vdpa_config_ops *ops = vdpa->config; in vhost_vdpa_set_status()
170 status_old = ops->get_status(vdpa); in vhost_vdpa_set_status()
176 if (status != 0 && (ops->get_status(vdpa) & ~status) != 0) in vhost_vdpa_set_status()
184 ret = ops->reset(vdpa); in vhost_vdpa_set_status()
188 ops->set_status(vdpa, status); in vhost_vdpa_set_status()
200 struct vdpa_device *vdpa = v->vdpa; in vhost_vdpa_config_validate() local
201 long size = vdpa->config->get_config_size(vdpa); in vhost_vdpa_config_validate()
215 struct vdpa_device *vdpa = v->vdpa; in vhost_vdpa_get_config() local
228 vdpa_get_config(vdpa, config.off, buf, config.len); in vhost_vdpa_get_config()
242 struct vdpa_device *vdpa = v->vdpa; in vhost_vdpa_set_config() local
243 const struct vdpa_config_ops *ops = vdpa->config; in vhost_vdpa_set_config()
257 ops->set_config(vdpa, config.off, buf, config.len); in vhost_vdpa_set_config()
265 struct vdpa_device *vdpa = v->vdpa; in vhost_vdpa_get_features() local
266 const struct vdpa_config_ops *ops = vdpa->config; in vhost_vdpa_get_features()
269 features = ops->get_features(vdpa); in vhost_vdpa_get_features()
279 struct vdpa_device *vdpa = v->vdpa; in vhost_vdpa_set_features() local
280 const struct vdpa_config_ops *ops = vdpa->config; in vhost_vdpa_set_features()
287 if (ops->get_status(vdpa) & VIRTIO_CONFIG_S_FEATURES_OK) in vhost_vdpa_set_features()
293 if (vdpa_set_features(vdpa, features)) in vhost_vdpa_set_features()
301 struct vdpa_device *vdpa = v->vdpa; in vhost_vdpa_get_vring_num() local
302 const struct vdpa_config_ops *ops = vdpa->config; in vhost_vdpa_get_vring_num()
305 num = ops->get_vq_num_max(vdpa); in vhost_vdpa_get_vring_num()
345 v->vdpa->config->set_config_cb(v->vdpa, &cb); in vhost_vdpa_set_config_call()
365 struct vdpa_device *vdpa = v->vdpa; in vhost_vdpa_vring_ioctl() local
366 const struct vdpa_config_ops *ops = vdpa->config; in vhost_vdpa_vring_ioctl()
388 ops->set_vq_ready(vdpa, idx, s.num); in vhost_vdpa_vring_ioctl()
391 r = ops->get_vq_state(v->vdpa, idx, &vq_state); in vhost_vdpa_vring_ioctl()
412 if (ops->set_vq_address(vdpa, idx, in vhost_vdpa_vring_ioctl()
428 r = ops->set_vq_state(vdpa, idx, &vq_state); in vhost_vdpa_vring_ioctl()
439 ops->set_vq_cb(vdpa, idx, &cb); in vhost_vdpa_vring_ioctl()
444 ops->set_vq_num(vdpa, idx, vq->num); in vhost_vdpa_vring_ioctl()
562 struct vdpa_device *vdpa = v->vdpa; in vhost_vdpa_iotlb_unmap() local
564 if (vdpa->use_va) in vhost_vdpa_iotlb_unmap()
605 struct vdpa_device *vdpa = v->vdpa; in vhost_vdpa_map() local
606 const struct vdpa_config_ops *ops = vdpa->config; in vhost_vdpa_map()
615 r = ops->dma_map(vdpa, iova, size, pa, perm, opaque); in vhost_vdpa_map()
618 r = ops->set_map(vdpa, dev->iotlb); in vhost_vdpa_map()
628 if (!vdpa->use_va) in vhost_vdpa_map()
637 struct vdpa_device *vdpa = v->vdpa; in vhost_vdpa_unmap() local
638 const struct vdpa_config_ops *ops = vdpa->config; in vhost_vdpa_unmap()
643 ops->dma_unmap(vdpa, iova, size); in vhost_vdpa_unmap()
646 ops->set_map(vdpa, dev->iotlb); in vhost_vdpa_unmap()
830 struct vdpa_device *vdpa = v->vdpa; in vhost_vdpa_process_iotlb_update() local
842 if (vdpa->use_va) in vhost_vdpa_process_iotlb_update()
854 struct vdpa_device *vdpa = v->vdpa; in vhost_vdpa_process_iotlb_msg() local
855 const struct vdpa_config_ops *ops = vdpa->config; in vhost_vdpa_process_iotlb_msg()
876 ops->set_map(vdpa, dev->iotlb); in vhost_vdpa_process_iotlb_msg()
901 struct vdpa_device *vdpa = v->vdpa; in vhost_vdpa_alloc_domain() local
902 const struct vdpa_config_ops *ops = vdpa->config; in vhost_vdpa_alloc_domain()
903 struct device *dma_dev = vdpa_get_dma_dev(vdpa); in vhost_vdpa_alloc_domain()
935 struct vdpa_device *vdpa = v->vdpa; in vhost_vdpa_free_domain() local
936 struct device *dma_dev = vdpa_get_dma_dev(vdpa); in vhost_vdpa_free_domain()
949 struct vdpa_device *vdpa = v->vdpa; in vhost_vdpa_set_iova_range() local
950 const struct vdpa_config_ops *ops = vdpa->config; in vhost_vdpa_set_iova_range()
953 *range = ops->get_iova_range(vdpa); in vhost_vdpa_set_iova_range()
1054 struct vdpa_device *vdpa = v->vdpa; in vhost_vdpa_fault() local
1055 const struct vdpa_config_ops *ops = vdpa->config; in vhost_vdpa_fault()
1060 notify = ops->get_vq_notification(vdpa, index); in vhost_vdpa_fault()
1078 struct vdpa_device *vdpa = v->vdpa; in vhost_vdpa_mmap() local
1079 const struct vdpa_config_ops *ops = vdpa->config; in vhost_vdpa_mmap()
1098 notify = ops->get_vq_notification(vdpa, index); in vhost_vdpa_mmap()
1132 static int vhost_vdpa_probe(struct vdpa_device *vdpa) in vhost_vdpa_probe() argument
1134 const struct vdpa_config_ops *ops = vdpa->config; in vhost_vdpa_probe()
1152 v->vdpa = vdpa; in vhost_vdpa_probe()
1153 v->nvqs = vdpa->nvqs; in vhost_vdpa_probe()
1154 v->virtio_id = ops->get_device_id(vdpa); in vhost_vdpa_probe()
1158 v->dev.parent = &vdpa->dev; in vhost_vdpa_probe()
1179 vdpa_set_drvdata(vdpa, v); in vhost_vdpa_probe()
1188 static void vhost_vdpa_remove(struct vdpa_device *vdpa) in vhost_vdpa_remove() argument
1190 struct vhost_vdpa *v = vdpa_get_drvdata(vdpa); in vhost_vdpa_remove()