search for: dma_map

Displaying 20 results from an estimated 109 matches for "dma_map".

2023 Mar 07
2
[PATCH vhost v1 03/12] virtio_ring: split: introduce virtqueue_add_split_premapped()
...a/drivers/virtio/virtio_ring.c > +++ b/drivers/virtio/virtio_ring.c > @@ -70,6 +70,7 @@ > struct vring_desc_state_split { > void *data; /* Data for callback. */ > struct vring_desc *indir_desc; /* Indirect descriptor, if any. */ > + bool dma_map; /* Addr is mapped by virtio core or not. */ This will stress the cache, can we pack the boolean into indir_desc? > }; > > struct vring_desc_state_packed { > @@ -440,7 +441,7 @@ static void vring_unmap_one_split_indirect(const struct vring_virtqueue *vq, > } &g...
2023 Mar 07
1
[PATCH vhost v1 03/12] virtio_ring: split: introduce virtqueue_add_split_premapped()
...> > +++ b/drivers/virtio/virtio_ring.c > > @@ -70,6 +70,7 @@ > > struct vring_desc_state_split { > > void *data; /* Data for callback. */ > > struct vring_desc *indir_desc; /* Indirect descriptor, if any. */ > > + bool dma_map; /* Addr is mapped by virtio core or not. */ > > This will stress the cache, can we pack the boolean into indir_desc? Rethink about this, I think we cannot pack this into indir_desc. Because we may save ctx to indir_desc. We can save this info to vring_desc_extra.addr, nu...
2023 Mar 02
12
[PATCH vhost v1 00/12] virtio core prepares for AF_XDP
XDP socket(AF_XDP) is an excellent bypass kernel network framework. The zero copy feature of xsk (XDP socket) needs to be supported by the driver. The performance of zero copy is very good. ENV: Qemu with vhost. vhost cpu | Guest APP CPU |Guest Softirq CPU | PPS -----------------------------|---------------|------------------|------------ xmit by sockperf: 90% | 100%
2023 Aug 16
1
[PATCH RFC 1/4] vdpa: introduce .reset_map operation callback
...r engineering for this issue. More below. > > * @set_map: Set device memory mapping (optional) > * Needed for device that using device > * specific DMA translation (on-chip IOMMU) > : > : > * @dma_map: Map an area of PA to IOVA (optional) > * Needed for device that using device > * specific DMA translation (on-chip IOMMU) > * and preferring incremental map. > : > : >...
2023 Aug 21
0
[PATCH RFC 1/4] vdpa: introduce .reset_map operation callback
...Set device memory mapping (optional) >>>> * Needed for device that using device >>>> * specific DMA translation (on-chip IOMMU) >>>> : >>>> : >>>> * @dma_map: Map an area of PA to IOVA (optional) >>>> * Needed for device that using device >>>> * specific DMA translation (on-chip IOMMU) >>>> * and prefe...
2020 Aug 05
1
[PATCH 3/4] vdpa: get_iova_range() is mandatory for device specific DMA translation
...4 insertions(+) > > diff --git a/drivers/vdpa/vdpa.c b/drivers/vdpa/vdpa.c > index de211ef3738c..ab7af978ef70 100644 > --- a/drivers/vdpa/vdpa.c > +++ b/drivers/vdpa/vdpa.c > @@ -82,6 +82,10 @@ struct vdpa_device *__vdpa_alloc_device(struct device *parent, > if (!!config->dma_map != !!config->dma_unmap) > goto err; > > + if ((config->dma_map || config->set_map) && > + !config->get_iova_range) > + goto err; > + > err = -ENOMEM; > vdev = kzalloc(size, GFP_KERNEL); > if (!vdev) What about devices using an IOMMU fo...
2020 Jun 28
2
[PATCH RFC 4/5] vhost-vdpa: support IOTLB batching hints
...nfig_ops *ops = vdpa->config; > > ops->set_status(vdpa, 0); > + v->in_batch = 0; > } > > static long vhost_vdpa_get_device_id(struct vhost_vdpa *v, u8 __user *argp) > @@ -540,9 +544,10 @@ static int vhost_vdpa_map(struct vhost_vdpa *v, > > if (ops->dma_map) > r = ops->dma_map(vdpa, iova, size, pa, perm); > - else if (ops->set_map) > - r = ops->set_map(vdpa, dev->iotlb); > - else > + else if (ops->set_map) { > + if (!v->in_batch) > + r = ops->set_map(vdpa, dev->iotlb); > + } else > r = iommu...
2020 Jun 28
2
[PATCH RFC 4/5] vhost-vdpa: support IOTLB batching hints
...nfig_ops *ops = vdpa->config; > > ops->set_status(vdpa, 0); > + v->in_batch = 0; > } > > static long vhost_vdpa_get_device_id(struct vhost_vdpa *v, u8 __user *argp) > @@ -540,9 +544,10 @@ static int vhost_vdpa_map(struct vhost_vdpa *v, > > if (ops->dma_map) > r = ops->dma_map(vdpa, iova, size, pa, perm); > - else if (ops->set_map) > - r = ops->set_map(vdpa, dev->iotlb); > - else > + else if (ops->set_map) { > + if (!v->in_batch) > + r = ops->set_map(vdpa, dev->iotlb); > + } else > r = iommu...
2015 Dec 14
3
[Xen-devel] [PATCH RFC 0/3] Xen on Virtio
...io). > > The problem is that Linux virtio drivers use virt_to_phys to get the > > guest pseudo-physical addresses to pass to the backend, which doesn't > > work as expected on Xen. > > > > Switching the virtio drivers to the dma APIs (dma_alloc_coherent, > > dma_map/unmap_single and dma_map/unmap_sg) would solve the problem, as > > Xen support in Linux provides an implementation of the dma API which > > takes care of the additional address conversions. However using the dma > > API would increase the complexity of the non-Xen case too. We wou...
2015 Dec 14
3
[Xen-devel] [PATCH RFC 0/3] Xen on Virtio
...io). > > The problem is that Linux virtio drivers use virt_to_phys to get the > > guest pseudo-physical addresses to pass to the backend, which doesn't > > work as expected on Xen. > > > > Switching the virtio drivers to the dma APIs (dma_alloc_coherent, > > dma_map/unmap_single and dma_map/unmap_sg) would solve the problem, as > > Xen support in Linux provides an implementation of the dma API which > > takes care of the additional address conversions. However using the dma > > API would increase the complexity of the non-Xen case too. We wou...
2015 Dec 07
6
[PATCH RFC 0/3] Xen on Virtio
...de a virtual machine with virtio devices (nested virt scenario). The problem is that Linux virtio drivers use virt_to_phys to get the guest pseudo-physical addresses to pass to the backend, which doesn't work as expected on Xen. Switching the virtio drivers to the dma APIs (dma_alloc_coherent, dma_map/unmap_single and dma_map/unmap_sg) would solve the problem, as Xen support in Linux provides an implementation of the dma API which takes care of the additional address conversions. However using the dma API would increase the complexity of the non-Xen case too. We would also need to keep track of...
2015 Dec 07
6
[PATCH RFC 0/3] Xen on Virtio
...de a virtual machine with virtio devices (nested virt scenario). The problem is that Linux virtio drivers use virt_to_phys to get the guest pseudo-physical addresses to pass to the backend, which doesn't work as expected on Xen. Switching the virtio drivers to the dma APIs (dma_alloc_coherent, dma_map/unmap_single and dma_map/unmap_sg) would solve the problem, as Xen support in Linux provides an implementation of the dma API which takes care of the additional address conversions. However using the dma API would increase the complexity of the non-Xen case too. We would also need to keep track of...
2020 Jun 18
6
[PATCH RFC 0/5] support batched IOTLB updating in vhost-vdpa
Hi all: This series tries to support batched IOTLB updating vhost-vdpa. Currently vhost-vdpa accepts userspace mapping via IOTLB API, and it can only forward one mapping to IOMMU or device through IOMMU API or dma_map(). Though set_map() is deisgend to have the capability to pass an rbtree based mapping to vDPA device, it's still be called at least once for each VHOST_IOTLB_UPDATE or VHOST_IOTLB_INVALIDATE. This is because vhost-vdpa doesn't know the userspace start or stop then updating. So this patch...
2020 Jun 29
1
[PATCH RFC 4/5] vhost-vdpa: support IOTLB batching hints
...> ops->set_status(vdpa, 0); > > > + v->in_batch = 0; > > > } > > > static long vhost_vdpa_get_device_id(struct vhost_vdpa *v, u8 __user *argp) > > > @@ -540,9 +544,10 @@ static int vhost_vdpa_map(struct vhost_vdpa *v, > > > if (ops->dma_map) > > > r = ops->dma_map(vdpa, iova, size, pa, perm); > > > - else if (ops->set_map) > > > - r = ops->set_map(vdpa, dev->iotlb); > > > - else > > > + else if (ops->set_map) { > > > + if (!v->in_batch) > > > + r...
2020 Jul 01
5
[PATCH 0/5]
Hi all: This series tries to support batched IOTLB updating vhost-vdpa. Currently vhost-vdpa accepts userspace mapping via IOTLB API, and it can only forward one mapping to IOMMU or device through IOMMU API or dma_map(). Though set_map() is designed to have the capability to pass an rbtree based mapping to vDPA device, it's still be called at least once for each VHOST_IOTLB_UPDATE or VHOST_IOTLB_INVALIDATE. This is because vhost-vdpa doesn't know the userspace start or stop then updating. So this patch...
2015 Dec 15
2
[Xen-devel] [PATCH RFC 0/3] Xen on Virtio
...tio drivers use virt_to_phys to get the > >> > guest pseudo-physical addresses to pass to the backend, which doesn't > >> > work as expected on Xen. > >> > > >> > Switching the virtio drivers to the dma APIs (dma_alloc_coherent, > >> > dma_map/unmap_single and dma_map/unmap_sg) would solve the problem, as > >> > Xen support in Linux provides an implementation of the dma API which > >> > takes care of the additional address conversions. However using the dma > >> > API would increase the complexity of t...
2015 Dec 15
2
[Xen-devel] [PATCH RFC 0/3] Xen on Virtio
...tio drivers use virt_to_phys to get the > >> > guest pseudo-physical addresses to pass to the backend, which doesn't > >> > work as expected on Xen. > >> > > >> > Switching the virtio drivers to the dma APIs (dma_alloc_coherent, > >> > dma_map/unmap_single and dma_map/unmap_sg) would solve the problem, as > >> > Xen support in Linux provides an implementation of the dma API which > >> > takes care of the additional address conversions. However using the dma > >> > API would increase the complexity of t...
2020 Jun 18
0
[PATCH RFC 4/5] vhost-vdpa: support IOTLB batching hints
...(struct vhost_vdpa *v) const struct vdpa_config_ops *ops = vdpa->config; ops->set_status(vdpa, 0); + v->in_batch = 0; } static long vhost_vdpa_get_device_id(struct vhost_vdpa *v, u8 __user *argp) @@ -540,9 +544,10 @@ static int vhost_vdpa_map(struct vhost_vdpa *v, if (ops->dma_map) r = ops->dma_map(vdpa, iova, size, pa, perm); - else if (ops->set_map) - r = ops->set_map(vdpa, dev->iotlb); - else + else if (ops->set_map) { + if (!v->in_batch) + r = ops->set_map(vdpa, dev->iotlb); + } else r = iommu_map(v->domain, iova, pa, size,...
2020 Jun 29
0
[PATCH RFC 4/5] vhost-vdpa: support IOTLB batching hints
...>> ops->set_status(vdpa, 0); >> + v->in_batch = 0; >> } >> >> static long vhost_vdpa_get_device_id(struct vhost_vdpa *v, u8 __user *argp) >> @@ -540,9 +544,10 @@ static int vhost_vdpa_map(struct vhost_vdpa *v, >> >> if (ops->dma_map) >> r = ops->dma_map(vdpa, iova, size, pa, perm); >> - else if (ops->set_map) >> - r = ops->set_map(vdpa, dev->iotlb); >> - else >> + else if (ops->set_map) { >> + if (!v->in_batch) >> + r = ops->set_map(vdpa, dev->iotlb); &g...
2015 Dec 15
1
[Xen-devel] [PATCH RFC 0/3] Xen on Virtio
...tio drivers use virt_to_phys to get the > >> > guest pseudo-physical addresses to pass to the backend, which doesn't > >> > work as expected on Xen. > >> > > >> > Switching the virtio drivers to the dma APIs (dma_alloc_coherent, > >> > dma_map/unmap_single and dma_map/unmap_sg) would solve the problem, as > >> > Xen support in Linux provides an implementation of the dma API which > >> > takes care of the additional address conversions. However using the dma > >> > API would increase the complexity of t...