Lines Matching full:vdpa

21 #include <linux/vdpa.h>
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()
121 struct vdpa_device *vdpa = v->vdpa; in vhost_vdpa_reset() local
123 vdpa_reset(vdpa); in vhost_vdpa_reset()
129 struct vdpa_device *vdpa = v->vdpa; in vhost_vdpa_get_device_id() local
130 const struct vdpa_config_ops *ops = vdpa->config; in vhost_vdpa_get_device_id()
133 device_id = ops->get_device_id(vdpa); in vhost_vdpa_get_device_id()
143 struct vdpa_device *vdpa = v->vdpa; in vhost_vdpa_get_status() local
144 const struct vdpa_config_ops *ops = vdpa->config; in vhost_vdpa_get_status()
147 status = ops->get_status(vdpa); in vhost_vdpa_get_status()
157 struct vdpa_device *vdpa = v->vdpa; in vhost_vdpa_set_status() local
158 const struct vdpa_config_ops *ops = vdpa->config; in vhost_vdpa_set_status()
166 status_old = ops->get_status(vdpa); in vhost_vdpa_set_status()
172 if (status != 0 && (ops->get_status(vdpa) & ~status) != 0) in vhost_vdpa_set_status()
175 ops->set_status(vdpa, status); in vhost_vdpa_set_status()
211 struct vdpa_device *vdpa = v->vdpa; in vhost_vdpa_get_config() local
224 vdpa_get_config(vdpa, config.off, buf, config.len); in vhost_vdpa_get_config()
238 struct vdpa_device *vdpa = v->vdpa; in vhost_vdpa_set_config() local
239 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()
326 cb.private = v->vdpa; in vhost_vdpa_set_config_call()
339 v->vdpa->config->set_config_cb(v->vdpa, &cb); in vhost_vdpa_set_config_call()
359 struct vdpa_device *vdpa = v->vdpa; in vhost_vdpa_vring_ioctl() local
360 const struct vdpa_config_ops *ops = vdpa->config; in vhost_vdpa_vring_ioctl()
382 ops->set_vq_ready(vdpa, idx, s.num); in vhost_vdpa_vring_ioctl()
385 r = ops->get_vq_state(v->vdpa, idx, &vq_state); in vhost_vdpa_vring_ioctl()
399 if (ops->set_vq_address(vdpa, idx, in vhost_vdpa_vring_ioctl()
408 if (ops->set_vq_state(vdpa, idx, &vq_state)) in vhost_vdpa_vring_ioctl()
420 ops->set_vq_cb(vdpa, idx, &cb); in vhost_vdpa_vring_ioctl()
425 ops->set_vq_num(vdpa, idx, vq->num); in vhost_vdpa_vring_ioctl()
561 struct vdpa_device *vdpa = v->vdpa; in vhost_vdpa_map() local
562 const struct vdpa_config_ops *ops = vdpa->config; in vhost_vdpa_map()
571 r = ops->dma_map(vdpa, iova, size, pa, perm); in vhost_vdpa_map()
574 r = ops->set_map(vdpa, dev->iotlb); in vhost_vdpa_map()
591 struct vdpa_device *vdpa = v->vdpa; in vhost_vdpa_unmap() local
592 const struct vdpa_config_ops *ops = vdpa->config; in vhost_vdpa_unmap()
597 ops->dma_unmap(vdpa, iova, size); in vhost_vdpa_unmap()
600 ops->set_map(vdpa, dev->iotlb); in vhost_vdpa_unmap()
742 struct vdpa_device *vdpa = v->vdpa; in vhost_vdpa_process_iotlb_msg() local
743 const struct vdpa_config_ops *ops = vdpa->config; in vhost_vdpa_process_iotlb_msg()
762 ops->set_map(vdpa, dev->iotlb); in vhost_vdpa_process_iotlb_msg()
785 struct vdpa_device *vdpa = v->vdpa; in vhost_vdpa_alloc_domain() local
786 const struct vdpa_config_ops *ops = vdpa->config; in vhost_vdpa_alloc_domain()
787 struct device *dma_dev = vdpa_get_dma_dev(vdpa); in vhost_vdpa_alloc_domain()
819 struct vdpa_device *vdpa = v->vdpa; in vhost_vdpa_free_domain() local
820 struct device *dma_dev = vdpa_get_dma_dev(vdpa); in vhost_vdpa_free_domain()
834 struct vdpa_device *vdpa = v->vdpa; in vhost_vdpa_set_iova_range() local
835 const struct vdpa_config_ops *ops = vdpa->config; in vhost_vdpa_set_iova_range()
838 *range = ops->get_iova_range(vdpa); in vhost_vdpa_set_iova_range()
944 struct vdpa_device *vdpa = v->vdpa; in vhost_vdpa_fault() local
945 const struct vdpa_config_ops *ops = vdpa->config; in vhost_vdpa_fault()
950 notify = ops->get_vq_notification(vdpa, index); in vhost_vdpa_fault()
968 struct vdpa_device *vdpa = v->vdpa; in vhost_vdpa_mmap() local
969 const struct vdpa_config_ops *ops = vdpa->config; in vhost_vdpa_mmap()
988 notify = ops->get_vq_notification(vdpa, index); in vhost_vdpa_mmap()
1021 static int vhost_vdpa_probe(struct vdpa_device *vdpa) in vhost_vdpa_probe() argument
1023 const struct vdpa_config_ops *ops = vdpa->config; in vhost_vdpa_probe()
1029 if (ops->get_device_id(vdpa) != VIRTIO_ID_NET) in vhost_vdpa_probe()
1045 v->vdpa = vdpa; in vhost_vdpa_probe()
1046 v->nvqs = vdpa->nvqs; in vhost_vdpa_probe()
1047 v->virtio_id = ops->get_device_id(vdpa); in vhost_vdpa_probe()
1051 v->dev.parent = &vdpa->dev; in vhost_vdpa_probe()
1060 r = dev_set_name(&v->dev, "vhost-vdpa-%u", minor); in vhost_vdpa_probe()
1072 vdpa_set_drvdata(vdpa, v); in vhost_vdpa_probe()
1081 static void vhost_vdpa_remove(struct vdpa_device *vdpa) in vhost_vdpa_remove() argument
1083 struct vhost_vdpa *v = vdpa_get_drvdata(vdpa); in vhost_vdpa_remove()
1111 "vhost-vdpa"); in vhost_vdpa_init()
1138 MODULE_DESCRIPTION("vDPA-based vhost backend for virtio");