Lines Matching refs:vdpa
22 #include <linux/vdpa.h>
50 struct vdpa_device *vdpa;
109 if (asid >= v->vdpa->nas)
153 const struct vdpa_config_ops *ops = v->vdpa->config;
155 ops->kick_vq(v->vdpa, vq - v->vqs);
183 const struct vdpa_config_ops *ops = v->vdpa->config;
184 struct vdpa_device *vdpa = v->vdpa;
190 irq = ops->get_vq_irq(vdpa, qid);
215 struct vdpa_device *vdpa = v->vdpa;
219 return vdpa_reset(vdpa);
224 struct vdpa_device *vdpa = v->vdpa;
225 const struct vdpa_config_ops *ops = vdpa->config;
227 if (!vdpa->use_va || !ops->bind_mm)
230 return ops->bind_mm(vdpa, v->vdev.mm);
235 struct vdpa_device *vdpa = v->vdpa;
236 const struct vdpa_config_ops *ops = vdpa->config;
238 if (!vdpa->use_va || !ops->unbind_mm)
241 ops->unbind_mm(vdpa);
246 struct vdpa_device *vdpa = v->vdpa;
247 const struct vdpa_config_ops *ops = vdpa->config;
250 device_id = ops->get_device_id(vdpa);
260 struct vdpa_device *vdpa = v->vdpa;
261 const struct vdpa_config_ops *ops = vdpa->config;
264 status = ops->get_status(vdpa);
274 struct vdpa_device *vdpa = v->vdpa;
275 const struct vdpa_config_ops *ops = vdpa->config;
284 status_old = ops->get_status(vdpa);
298 ret = vdpa_reset(vdpa);
302 vdpa_set_status(vdpa, status);
314 struct vdpa_device *vdpa = v->vdpa;
315 size_t size = vdpa->config->get_config_size(vdpa);
329 struct vdpa_device *vdpa = v->vdpa;
342 vdpa_get_config(vdpa, config.off, buf, config.len);
356 struct vdpa_device *vdpa = v->vdpa;
370 vdpa_set_config(vdpa, config.off, buf, config.len);
378 struct vdpa_device *vdpa = v->vdpa;
379 const struct vdpa_config_ops *ops = vdpa->config;
386 struct vdpa_device *vdpa = v->vdpa;
387 const struct vdpa_config_ops *ops = vdpa->config;
394 struct vdpa_device *vdpa = v->vdpa;
395 const struct vdpa_config_ops *ops = vdpa->config;
398 features = ops->get_device_features(vdpa);
408 struct vdpa_device *vdpa = v->vdpa;
409 const struct vdpa_config_ops *ops = vdpa->config;
414 return ops->get_backend_features(vdpa);
419 struct vdpa_device *vdpa = v->vdpa;
420 const struct vdpa_config_ops *ops = vdpa->config;
430 if (ops->get_status(vdpa) & VIRTIO_CONFIG_S_FEATURES_OK)
436 if (vdpa_set_features(vdpa, features))
440 actual_features = ops->get_driver_features(vdpa);
454 struct vdpa_device *vdpa = v->vdpa;
455 const struct vdpa_config_ops *ops = vdpa->config;
458 num = ops->get_vq_num_max(vdpa);
498 v->vdpa->config->set_config_cb(v->vdpa, &cb);
517 struct vdpa_device *vdpa = v->vdpa;
518 const struct vdpa_config_ops *ops = vdpa->config;
521 size = ops->get_config_size(vdpa);
531 struct vdpa_device *vdpa = v->vdpa;
533 if (copy_to_user(argp, &vdpa->nvqs, sizeof(vdpa->nvqs)))
546 struct vdpa_device *vdpa = v->vdpa;
547 const struct vdpa_config_ops *ops = vdpa->config;
552 return ops->suspend(vdpa);
561 struct vdpa_device *vdpa = v->vdpa;
562 const struct vdpa_config_ops *ops = vdpa->config;
567 return ops->resume(vdpa);
573 struct vdpa_device *vdpa = v->vdpa;
574 const struct vdpa_config_ops *ops = vdpa->config;
596 ops->set_vq_ready(vdpa, idx, s.num);
602 s.num = ops->get_vq_group(vdpa, idx);
603 if (s.num >= vdpa->ngroups)
611 if (s.num >= vdpa->nas)
615 return ops->set_group_asid(vdpa, idx, s.num);
617 r = ops->get_vq_state(v->vdpa, idx, &vq_state);
638 if (ops->set_vq_address(vdpa, idx,
654 r = ops->set_vq_state(vdpa, idx, &vq_state);
667 ops->set_vq_cb(vdpa, idx, &cb);
672 ops->set_vq_num(vdpa, idx, vq->num);
735 if (copy_to_user(argp, &v->vdpa->ngroups,
736 sizeof(v->vdpa->ngroups)))
740 if (copy_to_user(argp, &v->vdpa->nas, sizeof(v->vdpa->nas)))
799 struct vdpa_device *vdpa = v->vdpa;
800 const struct vdpa_config_ops *ops = vdpa->config;
802 ops->dma_unmap(vdpa, asid, map->start, map->size);
850 struct vdpa_device *vdpa = v->vdpa;
852 if (vdpa->use_va)
884 struct vdpa_device *vdpa = v->vdpa;
885 const struct vdpa_config_ops *ops = vdpa->config;
895 r = ops->dma_map(vdpa, asid, iova, size, pa, perm, opaque);
898 r = ops->set_map(vdpa, asid, iotlb);
908 if (!vdpa->use_va)
918 struct vdpa_device *vdpa = v->vdpa;
919 const struct vdpa_config_ops *ops = vdpa->config;
926 ops->set_map(vdpa, asid, iotlb);
1111 struct vdpa_device *vdpa = v->vdpa;
1122 if (vdpa->use_va)
1134 struct vdpa_device *vdpa = v->vdpa;
1135 const struct vdpa_config_ops *ops = vdpa->config;
1183 ops->set_map(vdpa, asid, iotlb);
1208 struct vdpa_device *vdpa = v->vdpa;
1209 const struct vdpa_config_ops *ops = vdpa->config;
1210 struct device *dma_dev = vdpa_get_dma_dev(vdpa);
1246 struct vdpa_device *vdpa = v->vdpa;
1247 struct device *dma_dev = vdpa_get_dma_dev(vdpa);
1260 struct vdpa_device *vdpa = v->vdpa;
1261 const struct vdpa_config_ops *ops = vdpa->config;
1264 *range = ops->get_iova_range(vdpa);
1279 for (asid = 0; asid < v->vdpa->nas; asid++) {
1373 struct vdpa_device *vdpa = v->vdpa;
1374 const struct vdpa_config_ops *ops = vdpa->config;
1379 notify = ops->get_vq_notification(vdpa, index);
1397 struct vdpa_device *vdpa = v->vdpa;
1398 const struct vdpa_config_ops *ops = vdpa->config;
1417 notify = ops->get_vq_notification(vdpa, index);
1451 static int vhost_vdpa_probe(struct vdpa_device *vdpa)
1453 const struct vdpa_config_ops *ops = vdpa->config;
1462 (vdpa->ngroups > 1 || vdpa->nas > 1))
1478 v->vdpa = vdpa;
1479 v->nvqs = vdpa->nvqs;
1480 v->virtio_id = ops->get_device_id(vdpa);
1484 v->dev.parent = &vdpa->dev;
1493 r = dev_set_name(&v->dev, "vhost-vdpa-%u", minor);
1505 vdpa_set_drvdata(vdpa, v);
1517 static void vhost_vdpa_remove(struct vdpa_device *vdpa)
1519 struct vhost_vdpa *v = vdpa_get_drvdata(vdpa);
1547 "vhost-vdpa");