Displaying 20 results from an estimated 57 matches for "premap".
Did you mean:
remap
2023 Jun 22
1
[PATCH vhost v10 10/10] virtio_net: support dma premapped
On Fri, Jun 02, 2023 at 05:22:06PM +0800, Xuan Zhuo wrote:
> Introduce the module param "experiment_premapped" to enable the function
> that the virtio-net do dma mapping.
>
> If that is true, the vq of virtio-net is under the premapped mode.
> It just handle the sg with dma_address. And the driver must get the dma
> address of the buffer to unmap after get the buffer from virtio co...
2023 Jun 02
12
[PATCH vhost v10 00/10] virtio core prepares for AF_XDP
...evices.
2. I tried to let xsk support callballs to get phy address from virtio-net
driver as the dma address. But the maintainers of xsk may want to use dma-buf
to replace the DMA APIs. I think that may be a larger effort. We will wait
too long.
So rethinking this, firstly, we can support premapped-dma only for devices with
VIRTIO_F_ACCESS_PLATFORM. In the case of af-xdp, if the users want to use it,
they have to update the device to support VIRTIO_F_RING_RESET, and they can also
enable the device's VIRTIO_F_ACCESS_PLATFORM feature.
Thanks for the help from Christoph.
===============...
2023 Jun 02
12
[PATCH vhost v10 00/10] virtio core prepares for AF_XDP
...evices.
2. I tried to let xsk support callballs to get phy address from virtio-net
driver as the dma address. But the maintainers of xsk may want to use dma-buf
to replace the DMA APIs. I think that may be a larger effort. We will wait
too long.
So rethinking this, firstly, we can support premapped-dma only for devices with
VIRTIO_F_ACCESS_PLATFORM. In the case of af-xdp, if the users want to use it,
they have to update the device to support VIRTIO_F_RING_RESET, and they can also
enable the device's VIRTIO_F_ACCESS_PLATFORM feature.
Thanks for the help from Christoph.
===============...
2023 Feb 20
1
[PATCH vhost 04/10] 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 premapped;
>
> Better with a comment.
>
> Not native speaker, but "dma_addr" might be better?
>
> > };
> >
> > struct vring_desc_state_packed {
> > @@ -440,7 +441,7 @@ static void vring_unmap_one_split_indirect(const struct vring_virtqueue *vq,
> >...
2023 May 17
12
[PATCH vhost v9 00/12] virtio core prepares for AF_XDP
...evices.
2. I tried to let xsk support callballs to get phy address from virtio-net
driver as the dma address. But the maintainers of xsk may want to use dma-buf
to replace the DMA APIs. I think that may be a larger effort. We will wait
too long.
So rethinking this, firstly, we can support premapped-dma only for devices with
VIRTIO_F_ACCESS_PLATFORM. In the case of af-xdp, if the users want to use it,
they have to update the device to support VIRTIO_F_RING_RESET, and they can also
enable the device's VIRTIO_F_ACCESS_PLATFORM feature.
Thanks for the help from Christoph.
===============...
2023 May 17
2
[PATCH vhost v9 04/12] virtio_ring: virtqueue_add() support premapped
virtuque_add() adds parameter premapped.
Signed-off-by: Xuan Zhuo <xuanzhuo at linux.alibaba.com>
---
drivers/virtio/virtio_ring.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c
index 1ffab1eb40c0..e2fc50c05bec 100644
--- a/drivers/virtio...
2023 Jul 10
10
[PATCH vhost v11 00/10] virtio core prepares for AF_XDP
...evices.
2. I tried to let xsk support callballs to get phy address from virtio-net
driver as the dma address. But the maintainers of xsk may want to use dma-buf
to replace the DMA APIs. I think that may be a larger effort. We will wait
too long.
So rethinking this, firstly, we can support premapped-dma only for devices with
VIRTIO_F_ACCESS_PLATFORM. In the case of af-xdp, if the users want to use it,
they have to update the device to support VIRTIO_F_RING_RESET, and they can also
enable the device's VIRTIO_F_ACCESS_PLATFORM feature.
Thanks for the help from Christoph.
===============...
2023 Feb 14
11
[PATCH vhost 00/10] virtio core prepares for AF_XDP
...33% | 1192064
recv by sockperf: 100% | 68% | 100% | 692288
recv by xsk: 100% | 33% | 43% | 771670
Before achieving the function of Virtio-Net, we also have to let virtio core
support these features:
1. virtio core support premapped
2. virtio core support reset per-queue
3. introduce DMA APIs to virtio core
Please review.
Thanks.
Xuan Zhuo (10):
virtio_ring: split: refactor virtqueue_add_split() for premapped
virtio_ring: packed: separate prepare code from
virtuque_add_indirect_packed()
virtio_ring: packed: ref...
2023 May 23
1
[PATCH vhost v9 04/12] virtio_ring: virtqueue_add() support premapped
On Wed, May 17, 2023 at 10:22:41AM +0800, Xuan Zhuo wrote:
> virtuque_add() adds parameter premapped.
Well, I can see that. But why?
2023 May 23
1
[PATCH vhost v9 04/12] virtio_ring: virtqueue_add() support premapped
On Mon, May 22, 2023 at 11:03:26PM -0700, Christoph Hellwig wrote:
> On Wed, May 17, 2023 at 10:22:41AM +0800, Xuan Zhuo wrote:
> > virtuque_add() adds parameter premapped.
>
> Well, I can see that. But why?
Assuming it's intentional, it should say something along the lines of
"The parameter is unused for now, and all callers just pass false.
It will be used by a follow-up patch".
It's not a bad way to split patches, this way actual lo...
2023 Aug 10
12
[PATCH vhost v13 00/12] virtio core prepares for AF_XDP
...evices.
2. I tried to let xsk support callballs to get phy address from virtio-net
driver as the dma address. But the maintainers of xsk may want to use dma-buf
to replace the DMA APIs. I think that may be a larger effort. We will wait
too long.
So rethinking this, firstly, we can support premapped-dma only for devices with
VIRTIO_F_ACCESS_PLATFORM. In the case of af-xdp, if the users want to use it,
they have to update the device to support VIRTIO_F_RING_RESET, and they can also
enable the device's VIRTIO_F_ACCESS_PLATFORM feature.
Thanks for the help from Christoph.
## For AF_XDP...
2023 Aug 10
12
[PATCH vhost v13 00/12] virtio core prepares for AF_XDP
...evices.
2. I tried to let xsk support callballs to get phy address from virtio-net
driver as the dma address. But the maintainers of xsk may want to use dma-buf
to replace the DMA APIs. I think that may be a larger effort. We will wait
too long.
So rethinking this, firstly, we can support premapped-dma only for devices with
VIRTIO_F_ACCESS_PLATFORM. In the case of af-xdp, if the users want to use it,
they have to update the device to support VIRTIO_F_RING_RESET, and they can also
enable the device's VIRTIO_F_ACCESS_PLATFORM feature.
Thanks for the help from Christoph.
## For AF_XDP...
2023 Feb 20
1
[PATCH vhost 08/10] virtio_ring: introduce dma sync api for virtio
...ing internal logic like
> virtio_dma_need_sync() over hiding it in
> virtio_dma_sync_single_range_for_cpu() and
> virtio_dma_sync_single_range_for_device()?
Sorry, I didn't understand it.
Thanks.
>
> Thanks
>
>
> >
> > These APIs can be used together with the premapped mechanism to sync the
> > DMA address.
> >
> > Signed-off-by: Xuan Zhuo <xuanzhuo at linux.alibaba.com>
> > ---
> > drivers/virtio/virtio_ring.c | 70 ++++++++++++++++++++++++++++++++++++
> > include/linux/virtio.h | 8 +++++
> > 2 files ch...
2023 Feb 21
2
[PATCH vhost 07/10] virtio_ring: add api virtio_dma_map() for advance dma
...tio device
> > > + * @page: the page of the memory to DMA
> > > + * @offset: the offset of the memory inside page
> > > + * @length: memory length
> > > + * @dir: DMA direction
> > > + *
> > > + * This API is only for pre-mapped buffers, for non premapped buffers virtio
> > > + * core handles DMA API internally.
> > > + *
> > > + * Returns the DMA addr. DMA_MAPPING_ERROR means error.
> > > + */
> > > +dma_addr_t virtio_dma_map_page(struct device *dev, struct page *page, size_t offset,
> > > +...
2023 Feb 21
2
[PATCH vhost 07/10] virtio_ring: add api virtio_dma_map() for advance dma
...tio device
> > > + * @page: the page of the memory to DMA
> > > + * @offset: the offset of the memory inside page
> > > + * @length: memory length
> > > + * @dir: DMA direction
> > > + *
> > > + * This API is only for pre-mapped buffers, for non premapped buffers virtio
> > > + * core handles DMA API internally.
> > > + *
> > > + * Returns the DMA addr. DMA_MAPPING_ERROR means error.
> > > + */
> > > +dma_addr_t virtio_dma_map_page(struct device *dev, struct page *page, size_t offset,
> > > +...
2023 Feb 20
1
[PATCH vhost 07/10] virtio_ring: add api virtio_dma_map() for advance dma
...device
> > + * @dev: virtio device
> > + * @page: the page of the memory to DMA
> > + * @offset: the offset of the memory inside page
> > + * @length: memory length
> > + * @dir: DMA direction
> > + *
> > + * This API is only for pre-mapped buffers, for non premapped buffers virtio
> > + * core handles DMA API internally.
> > + *
> > + * Returns the DMA addr. DMA_MAPPING_ERROR means error.
> > + */
> > +dma_addr_t virtio_dma_map_page(struct device *dev, struct page *page, size_t offset,
> > + u...
2023 Jun 22
1
[PATCH vhost v10 05/10] virtio_ring: split-detach: support return dma info to driver
On Fri, Jun 02, 2023 at 05:22:01PM +0800, Xuan Zhuo wrote:
> Under the premapped mode, the driver needs to unmap the DMA address
> after receiving the buffer. The virtio core records the DMA address,
> so the driver needs a way to get the dma info from the virtio core.
>
> A straightforward approach is to pass an array to the virtio core when
> calling virtqu...
2023 Mar 02
1
[PATCH vhost v1 01/12] virtio_ring: split: refactor virtqueue_add_split() for premapped
...rations.
The first function includes all codes that may fail before the DMA
operation. The subsequent part is used as the second function.
In this way, we can perform DMA operations in the middle of the two
functions. If the first function fails, we do not need to perform DMA
operations. If it is premapped, we can pass the DMA operation.
Signed-off-by: Xuan Zhuo <xuanzhuo at linux.alibaba.com>
---
drivers/virtio/virtio_ring.c | 131 +++++++++++++++++++++++------------
1 file changed, 88 insertions(+), 43 deletions(-)
diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c...
2023 May 26
1
[PATCH] virtio_ring: validate used buffer length
...o_le64(addr);
desc[i].len = cpu_to_le32(sg->length);
i++;
+ if (n >= out_sgs)
+ buflen += sg->length;
}
}
@@ -1379,6 +1429,10 @@ static int virtqueue_add_indirect_packed(struct vring_virtqueue *vq,
vq->packed.desc_state[id].last = id;
vq->packed.desc_state[id].premapped = premapped;
+ /* Store in buffer length if necessary */
+ if (vq->packed.buflen)
+ vq->packed.buflen[id] = buflen;
+
vq->num_added += 1;
pr_debug("Added buffer head %i to %p\n", head, vq);
@@ -1416,6 +1470,7 @@ static inline int virtqueue_add_packed(struct virtqueue...
2023 Mar 02
1
[PATCH vhost 07/10] virtio_ring: add api virtio_dma_map() for advance dma
...he memory to DMA
> > > > > + * @offset: the offset of the memory inside page
> > > > > + * @length: memory length
> > > > > + * @dir: DMA direction
> > > > > + *
> > > > > + * This API is only for pre-mapped buffers, for non premapped buffers virtio
> > > > > + * core handles DMA API internally.
> > > > > + *
> > > > > + * Returns the DMA addr. DMA_MAPPING_ERROR means error.
> > > > > + */
> > > > > +dma_addr_t virtio_dma_map_page(struct device *dev, s...