Lines Matching refs:vdpa

50 	struct vdpa_device *vdpa;  member
109 if (asid >= v->vdpa->nas) in vhost_vdpa_alloc_as()
153 const struct vdpa_config_ops *ops = v->vdpa->config; in handle_vq_kick()
155 ops->kick_vq(v->vdpa, vq - v->vqs); in handle_vq_kick()
183 const struct vdpa_config_ops *ops = v->vdpa->config; in vhost_vdpa_setup_vq_irq()
184 struct vdpa_device *vdpa = v->vdpa; in vhost_vdpa_setup_vq_irq() local
190 irq = ops->get_vq_irq(vdpa, qid); in vhost_vdpa_setup_vq_irq()
215 struct vdpa_device *vdpa = v->vdpa; in vhost_vdpa_reset() local
219 return vdpa_reset(vdpa); in vhost_vdpa_reset()
224 struct vdpa_device *vdpa = v->vdpa; in vhost_vdpa_get_device_id() local
225 const struct vdpa_config_ops *ops = vdpa->config; in vhost_vdpa_get_device_id()
228 device_id = ops->get_device_id(vdpa); in vhost_vdpa_get_device_id()
238 struct vdpa_device *vdpa = v->vdpa; in vhost_vdpa_get_status() local
239 const struct vdpa_config_ops *ops = vdpa->config; in vhost_vdpa_get_status()
242 status = ops->get_status(vdpa); in vhost_vdpa_get_status()
252 struct vdpa_device *vdpa = v->vdpa; in vhost_vdpa_set_status() local
253 const struct vdpa_config_ops *ops = vdpa->config; in vhost_vdpa_set_status()
262 status_old = ops->get_status(vdpa); in vhost_vdpa_set_status()
276 ret = vdpa_reset(vdpa); in vhost_vdpa_set_status()
280 vdpa_set_status(vdpa, status); in vhost_vdpa_set_status()
292 struct vdpa_device *vdpa = v->vdpa; in vhost_vdpa_config_validate() local
293 size_t size = vdpa->config->get_config_size(vdpa); in vhost_vdpa_config_validate()
307 struct vdpa_device *vdpa = v->vdpa; in vhost_vdpa_get_config() local
320 vdpa_get_config(vdpa, config.off, buf, config.len); in vhost_vdpa_get_config()
334 struct vdpa_device *vdpa = v->vdpa; in vhost_vdpa_set_config() local
348 vdpa_set_config(vdpa, config.off, buf, config.len); in vhost_vdpa_set_config()
356 struct vdpa_device *vdpa = v->vdpa; in vhost_vdpa_can_suspend() local
357 const struct vdpa_config_ops *ops = vdpa->config; in vhost_vdpa_can_suspend()
364 struct vdpa_device *vdpa = v->vdpa; in vhost_vdpa_can_resume() local
365 const struct vdpa_config_ops *ops = vdpa->config; in vhost_vdpa_can_resume()
372 struct vdpa_device *vdpa = v->vdpa; in vhost_vdpa_get_features() local
373 const struct vdpa_config_ops *ops = vdpa->config; in vhost_vdpa_get_features()
376 features = ops->get_device_features(vdpa); in vhost_vdpa_get_features()
386 struct vdpa_device *vdpa = v->vdpa; in vhost_vdpa_set_features() local
387 const struct vdpa_config_ops *ops = vdpa->config; in vhost_vdpa_set_features()
394 if (ops->get_status(vdpa) & VIRTIO_CONFIG_S_FEATURES_OK) in vhost_vdpa_set_features()
400 if (vdpa_set_features(vdpa, features)) in vhost_vdpa_set_features()
408 struct vdpa_device *vdpa = v->vdpa; in vhost_vdpa_get_vring_num() local
409 const struct vdpa_config_ops *ops = vdpa->config; in vhost_vdpa_get_vring_num()
412 num = ops->get_vq_num_max(vdpa); in vhost_vdpa_get_vring_num()
452 v->vdpa->config->set_config_cb(v->vdpa, &cb); in vhost_vdpa_set_config_call()
471 struct vdpa_device *vdpa = v->vdpa; in vhost_vdpa_get_config_size() local
472 const struct vdpa_config_ops *ops = vdpa->config; in vhost_vdpa_get_config_size()
475 size = ops->get_config_size(vdpa); in vhost_vdpa_get_config_size()
485 struct vdpa_device *vdpa = v->vdpa; in vhost_vdpa_get_vqs_count() local
487 if (copy_to_user(argp, &vdpa->nvqs, sizeof(vdpa->nvqs))) in vhost_vdpa_get_vqs_count()
500 struct vdpa_device *vdpa = v->vdpa; in vhost_vdpa_suspend() local
501 const struct vdpa_config_ops *ops = vdpa->config; in vhost_vdpa_suspend()
506 return ops->suspend(vdpa); in vhost_vdpa_suspend()
515 struct vdpa_device *vdpa = v->vdpa; in vhost_vdpa_resume() local
516 const struct vdpa_config_ops *ops = vdpa->config; in vhost_vdpa_resume()
521 return ops->resume(vdpa); in vhost_vdpa_resume()
527 struct vdpa_device *vdpa = v->vdpa; in vhost_vdpa_vring_ioctl() local
528 const struct vdpa_config_ops *ops = vdpa->config; in vhost_vdpa_vring_ioctl()
550 ops->set_vq_ready(vdpa, idx, s.num); in vhost_vdpa_vring_ioctl()
556 s.num = ops->get_vq_group(vdpa, idx); in vhost_vdpa_vring_ioctl()
557 if (s.num >= vdpa->ngroups) in vhost_vdpa_vring_ioctl()
565 if (s.num >= vdpa->nas) in vhost_vdpa_vring_ioctl()
569 return ops->set_group_asid(vdpa, idx, s.num); in vhost_vdpa_vring_ioctl()
571 r = ops->get_vq_state(v->vdpa, idx, &vq_state); in vhost_vdpa_vring_ioctl()
585 if (ops->set_vq_address(vdpa, idx, in vhost_vdpa_vring_ioctl()
594 if (ops->set_vq_state(vdpa, idx, &vq_state)) in vhost_vdpa_vring_ioctl()
606 ops->set_vq_cb(vdpa, idx, &cb); in vhost_vdpa_vring_ioctl()
611 ops->set_vq_num(vdpa, idx, vq->num); in vhost_vdpa_vring_ioctl()
673 if (copy_to_user(argp, &v->vdpa->ngroups, in vhost_vdpa_unlocked_ioctl()
674 sizeof(v->vdpa->ngroups))) in vhost_vdpa_unlocked_ioctl()
678 if (copy_to_user(argp, &v->vdpa->nas, sizeof(v->vdpa->nas))) in vhost_vdpa_unlocked_ioctl()
725 struct vdpa_device *vdpa = v->vdpa; in vhost_vdpa_general_unmap() local
726 const struct vdpa_config_ops *ops = vdpa->config; in vhost_vdpa_general_unmap()
728 ops->dma_unmap(vdpa, asid, map->start, map->size); in vhost_vdpa_general_unmap()
776 struct vdpa_device *vdpa = v->vdpa; in vhost_vdpa_iotlb_unmap() local
778 if (vdpa->use_va) in vhost_vdpa_iotlb_unmap()
810 struct vdpa_device *vdpa = v->vdpa; in vhost_vdpa_map() local
811 const struct vdpa_config_ops *ops = vdpa->config; in vhost_vdpa_map()
821 r = ops->dma_map(vdpa, asid, iova, size, pa, perm, opaque); in vhost_vdpa_map()
824 r = ops->set_map(vdpa, asid, iotlb); in vhost_vdpa_map()
834 if (!vdpa->use_va) in vhost_vdpa_map()
844 struct vdpa_device *vdpa = v->vdpa; in vhost_vdpa_unmap() local
845 const struct vdpa_config_ops *ops = vdpa->config; in vhost_vdpa_unmap()
852 ops->set_map(vdpa, asid, iotlb); in vhost_vdpa_unmap()
1041 struct vdpa_device *vdpa = v->vdpa; in vhost_vdpa_process_iotlb_update() local
1052 if (vdpa->use_va) in vhost_vdpa_process_iotlb_update()
1064 struct vdpa_device *vdpa = v->vdpa; in vhost_vdpa_process_iotlb_msg() local
1065 const struct vdpa_config_ops *ops = vdpa->config; in vhost_vdpa_process_iotlb_msg()
1113 ops->set_map(vdpa, asid, iotlb); in vhost_vdpa_process_iotlb_msg()
1140 struct vdpa_device *vdpa = v->vdpa; in vhost_vdpa_alloc_domain() local
1141 const struct vdpa_config_ops *ops = vdpa->config; in vhost_vdpa_alloc_domain()
1142 struct device *dma_dev = vdpa_get_dma_dev(vdpa); in vhost_vdpa_alloc_domain()
1177 struct vdpa_device *vdpa = v->vdpa; in vhost_vdpa_free_domain() local
1178 struct device *dma_dev = vdpa_get_dma_dev(vdpa); in vhost_vdpa_free_domain()
1191 struct vdpa_device *vdpa = v->vdpa; in vhost_vdpa_set_iova_range() local
1192 const struct vdpa_config_ops *ops = vdpa->config; in vhost_vdpa_set_iova_range()
1195 *range = ops->get_iova_range(vdpa); in vhost_vdpa_set_iova_range()
1210 for (asid = 0; asid < v->vdpa->nas; asid++) { in vhost_vdpa_cleanup()
1303 struct vdpa_device *vdpa = v->vdpa; in vhost_vdpa_fault() local
1304 const struct vdpa_config_ops *ops = vdpa->config; in vhost_vdpa_fault()
1309 notify = ops->get_vq_notification(vdpa, index); in vhost_vdpa_fault()
1327 struct vdpa_device *vdpa = v->vdpa; in vhost_vdpa_mmap() local
1328 const struct vdpa_config_ops *ops = vdpa->config; in vhost_vdpa_mmap()
1347 notify = ops->get_vq_notification(vdpa, index); in vhost_vdpa_mmap()
1381 static int vhost_vdpa_probe(struct vdpa_device *vdpa) in vhost_vdpa_probe() argument
1383 const struct vdpa_config_ops *ops = vdpa->config; in vhost_vdpa_probe()
1392 (vdpa->ngroups > 1 || vdpa->nas > 1)) in vhost_vdpa_probe()
1408 v->vdpa = vdpa; in vhost_vdpa_probe()
1409 v->nvqs = vdpa->nvqs; in vhost_vdpa_probe()
1410 v->virtio_id = ops->get_device_id(vdpa); in vhost_vdpa_probe()
1414 v->dev.parent = &vdpa->dev; in vhost_vdpa_probe()
1435 vdpa_set_drvdata(vdpa, v); in vhost_vdpa_probe()
1448 static void vhost_vdpa_remove(struct vdpa_device *vdpa) in vhost_vdpa_remove() argument
1450 struct vhost_vdpa *v = vdpa_get_drvdata(vdpa); in vhost_vdpa_remove()