search for: vring_unmap_on

Displaying 20 results from an estimated 98 matches for "vring_unmap_on".

Did you mean: vring_unmap_one
2015 Oct 30
1
[PATCH v4 2/6] virtio_ring: Support DMA APIs
...offset, sg->length, + direction); +} + +static dma_addr_t vring_map_single(const struct vring_virtqueue *vq, + void *cpu_addr, size_t size, + enum dma_data_direction direction) +{ + return dma_map_single(vring_dma_dev(vq), + cpu_addr, size, direction); +} + +static void vring_unmap_one(const struct vring_virtqueue *vq, + struct vring_desc *desc) +{ + u16 flags = virtio16_to_cpu(vq->vq.vdev, desc->flags); + + if (flags & VRING_DESC_F_INDIRECT) { + dma_unmap_single(vring_dma_dev(vq), + virtio64_to_cpu(vq->vq.vdev, desc->addr), + virtio32_to_cpu(vq-&g...
2015 Oct 30
1
[PATCH v4 2/6] virtio_ring: Support DMA APIs
...SC_F_INDIRECT)) >> - kfree(phys_to_virt(virtio64_to_cpu(vq->vq.vdev, vq->vring.desc[i].addr))); >> - >> - while (vq->vring.desc[i].flags & cpu_to_virtio16(vq->vq.vdev, VRING_DESC_F_NEXT)) { >> + while (vq->vring.desc[i].flags & nextflag) { >> + vring_unmap_one(vq, &vq->vring.desc[i]); >> i = virtio16_to_cpu(vq->vq.vdev, vq->vring.desc[i].next); >> vq->vq.num_free++; >> } >> >> + vring_unmap_one(vq, &vq->vring.desc[i]); >> vq->vring.desc[i].next = cpu_to_virtio16(vq->vq.vdev, vq-&...
2015 Oct 30
1
[PATCH v4 2/6] virtio_ring: Support DMA APIs
...SC_F_INDIRECT)) >> - kfree(phys_to_virt(virtio64_to_cpu(vq->vq.vdev, vq->vring.desc[i].addr))); >> - >> - while (vq->vring.desc[i].flags & cpu_to_virtio16(vq->vq.vdev, VRING_DESC_F_NEXT)) { >> + while (vq->vring.desc[i].flags & nextflag) { >> + vring_unmap_one(vq, &vq->vring.desc[i]); >> i = virtio16_to_cpu(vq->vq.vdev, vq->vring.desc[i].next); >> vq->vq.num_free++; >> } >> >> + vring_unmap_one(vq, &vq->vring.desc[i]); >> vq->vring.desc[i].next = cpu_to_virtio16(vq->vq.vdev, vq-&...
2015 Oct 30
0
[PATCH v4 2/6] virtio_ring: Support DMA APIs
...gt;vq.vdev, VRING_DESC_F_INDIRECT)) > - kfree(phys_to_virt(virtio64_to_cpu(vq->vq.vdev, vq->vring.desc[i].addr))); > - > - while (vq->vring.desc[i].flags & cpu_to_virtio16(vq->vq.vdev, VRING_DESC_F_NEXT)) { > + while (vq->vring.desc[i].flags & nextflag) { > + vring_unmap_one(vq, &vq->vring.desc[i]); > i = virtio16_to_cpu(vq->vq.vdev, vq->vring.desc[i].next); > vq->vq.num_free++; > } > > + vring_unmap_one(vq, &vq->vring.desc[i]); > vq->vring.desc[i].next = cpu_to_virtio16(vq->vq.vdev, vq->free_head); > v...
2018 Mar 16
2
[PATCH RFC 2/2] virtio_ring: support packed ring
...y other side. FIXME: commonalize hcalls! */ >>> bool (*notify)(struct virtqueue *vq); >>> @@ -201,26 +218,37 @@ static dma_addr_t vring_map_single(const struct vring_virtqueue *vq, >>> cpu_addr, size, direction); >>> } >>> -static void vring_unmap_one(const struct vring_virtqueue *vq, >>> - struct vring_desc *desc) >>> +static void vring_unmap_one(const struct vring_virtqueue *vq, void *_desc) >>> { >> Let's split the helpers to packed/split version like other helpers? >> (Consider the caller...
2018 Mar 16
2
[PATCH RFC 2/2] virtio_ring: support packed ring
...y other side. FIXME: commonalize hcalls! */ >>> bool (*notify)(struct virtqueue *vq); >>> @@ -201,26 +218,37 @@ static dma_addr_t vring_map_single(const struct vring_virtqueue *vq, >>> cpu_addr, size, direction); >>> } >>> -static void vring_unmap_one(const struct vring_virtqueue *vq, >>> - struct vring_desc *desc) >>> +static void vring_unmap_one(const struct vring_virtqueue *vq, void *_desc) >>> { >> Let's split the helpers to packed/split version like other helpers? >> (Consider the caller...
2016 Feb 03
0
[PATCH v7 5/9] virtio_ring: Support DMA APIs
...struct vring_virtqueue *vq, + void *cpu_addr, size_t size, + enum dma_data_direction direction) +{ + if (!vring_use_dma_api(vq->vq.vdev)) + return (dma_addr_t)virt_to_phys(cpu_addr); + + return dma_map_single(vring_dma_dev(vq), + cpu_addr, size, direction); +} + +static void vring_unmap_one(const struct vring_virtqueue *vq, + struct vring_desc *desc) +{ + u16 flags; + + if (!vring_use_dma_api(vq->vq.vdev)) + return; + + flags = virtio16_to_cpu(vq->vq.vdev, desc->flags); + + if (flags & VRING_DESC_F_INDIRECT) { + dma_unmap_single(vring_dma_dev(vq), + virtio64_...
2016 Feb 03
1
[PATCH v7 5/9] virtio_ring: Support DMA APIs
..., size_t size, > + enum dma_data_direction direction) > +{ > + if (!vring_use_dma_api(vq->vq.vdev)) > + return (dma_addr_t)virt_to_phys(cpu_addr); > + > + return dma_map_single(vring_dma_dev(vq), > + cpu_addr, size, direction); > +} > + > +static void vring_unmap_one(const struct vring_virtqueue *vq, > + struct vring_desc *desc) > +{ > + u16 flags; > + > + if (!vring_use_dma_api(vq->vq.vdev)) > + return; > + > + flags = virtio16_to_cpu(vq->vq.vdev, desc->flags); > + > + if (flags & VRING_DESC_F_INDIRECT) { >...
2016 Feb 03
1
[PATCH v7 5/9] virtio_ring: Support DMA APIs
..., size_t size, > + enum dma_data_direction direction) > +{ > + if (!vring_use_dma_api(vq->vq.vdev)) > + return (dma_addr_t)virt_to_phys(cpu_addr); > + > + return dma_map_single(vring_dma_dev(vq), > + cpu_addr, size, direction); > +} > + > +static void vring_unmap_one(const struct vring_virtqueue *vq, > + struct vring_desc *desc) > +{ > + u16 flags; > + > + if (!vring_use_dma_api(vq->vq.vdev)) > + return; > + > + flags = virtio16_to_cpu(vq->vq.vdev, desc->flags); > + > + if (flags & VRING_DESC_F_INDIRECT) { >...
2018 Mar 16
0
[PATCH RFC 2/2] virtio_ring: support packed ring
...+++++++++++++++++++++++++++++++++------ > > > > include/linux/virtio_ring.h | 8 +- > > > > 2 files changed, 618 insertions(+), 89 deletions(-) [...] > > > > cpu_addr, size, direction); > > > > } > > > > -static void vring_unmap_one(const struct vring_virtqueue *vq, > > > > - struct vring_desc *desc) > > > > +static void vring_unmap_one(const struct vring_virtqueue *vq, void *_desc) > > > > { > > > Let's split the helpers to packed/split version like other helpers? &gt...
2016 Nov 22
2
[PATCH 2/2] virtio_ring: fix complaint by sparse
...rs/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c > index 489bfc6..d2863c3 100644 > --- a/drivers/virtio/virtio_ring.c > +++ b/drivers/virtio/virtio_ring.c > @@ -420,7 +420,7 @@ static inline int virtqueue_add(struct virtqueue *_vq, > if (i == err_idx) > break; > vring_unmap_one(vq, &desc[i]); > - i = vq->vring.desc[i].next; > + i = virtio16_to_cpu(_vq->vdev, vq->vring.desc[i].next); > } > > vq->vq.num_free += total_sg; > @@ -601,7 +601,7 @@ bool virtqueue_kick(struct virtqueue *vq) > static void detach_buf(struct vring_virtqu...
2016 Nov 22
2
[PATCH 2/2] virtio_ring: fix complaint by sparse
...rs/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c > index 489bfc6..d2863c3 100644 > --- a/drivers/virtio/virtio_ring.c > +++ b/drivers/virtio/virtio_ring.c > @@ -420,7 +420,7 @@ static inline int virtqueue_add(struct virtqueue *_vq, > if (i == err_idx) > break; > vring_unmap_one(vq, &desc[i]); > - i = vq->vring.desc[i].next; > + i = virtio16_to_cpu(_vq->vdev, vq->vring.desc[i].next); > } > > vq->vq.num_free += total_sg; > @@ -601,7 +601,7 @@ bool virtqueue_kick(struct virtqueue *vq) > static void detach_buf(struct vring_virtqu...
2017 Feb 08
0
FW: Question about /patch/9251925/
...->vp_try_to_find_vqs() ->vp_setup_vq() ->setup_vq() *TX:* start_xmit() ->free_old_xmit_skbs() { ...... virtqueue_get_buf() ->detach_buf() { ...... vring_unmap_one(vq, &vq->vring.desc[i]) ...... } ...... } ->xmit_skb() virtqueue_add_outbuf() ->virtqueue_add() { ...... dma_addr_t addr = vring_map_one_sg(vq, sg, DMA_TO_DEVICE...
2017 Feb 08
0
FW: Question about /patch/9251925/
...->vp_try_to_find_vqs() ->vp_setup_vq() ->setup_vq() *TX:* start_xmit() ->free_old_xmit_skbs() { ...... virtqueue_get_buf() ->detach_buf() { ...... vring_unmap_one(vq, &vq->vring.desc[i]) ...... } ...... } ->xmit_skb() virtqueue_add_outbuf() ->virtqueue_add() { ...... dma_addr_t addr = vring_map_one_sg(vq, sg, DMA_TO_DEVICE...
2018 Mar 16
2
[PATCH RFC 2/2] virtio_ring: support packed ring
...+++++++++++++++++++------ >>>>> include/linux/virtio_ring.h | 8 +- >>>>> 2 files changed, 618 insertions(+), 89 deletions(-) > [...] >>>>> cpu_addr, size, direction); >>>>> } >>>>> -static void vring_unmap_one(const struct vring_virtqueue *vq, >>>>> - struct vring_desc *desc) >>>>> +static void vring_unmap_one(const struct vring_virtqueue *vq, void *_desc) >>>>> { >>>> Let's split the helpers to packed/split version like other helper...
2018 Mar 16
2
[PATCH RFC 2/2] virtio_ring: support packed ring
...+++++++++++++++++++------ >>>>> include/linux/virtio_ring.h | 8 +- >>>>> 2 files changed, 618 insertions(+), 89 deletions(-) > [...] >>>>> cpu_addr, size, direction); >>>>> } >>>>> -static void vring_unmap_one(const struct vring_virtqueue *vq, >>>>> - struct vring_desc *desc) >>>>> +static void vring_unmap_one(const struct vring_virtqueue *vq, void *_desc) >>>>> { >>>> Let's split the helpers to packed/split version like other helper...
2018 Mar 16
0
[PATCH RFC 2/2] virtio_ring: support packed ring
...> include/linux/virtio_ring.h | 8 +- > > > > > > 2 files changed, 618 insertions(+), 89 deletions(-) > > [...] > > > > > > cpu_addr, size, direction); > > > > > > } > > > > > > -static void vring_unmap_one(const struct vring_virtqueue *vq, > > > > > > - struct vring_desc *desc) > > > > > > +static void vring_unmap_one(const struct vring_virtqueue *vq, void *_desc) > > > > > > { > > > > > Let's split the helpers to pac...
2018 Mar 16
2
[PATCH RFC 2/2] virtio_ring: support packed ring
...}; > > /* How to notify other side. FIXME: commonalize hcalls! */ > bool (*notify)(struct virtqueue *vq); > @@ -201,26 +218,37 @@ static dma_addr_t vring_map_single(const struct vring_virtqueue *vq, > cpu_addr, size, direction); > } > > -static void vring_unmap_one(const struct vring_virtqueue *vq, > - struct vring_desc *desc) > +static void vring_unmap_one(const struct vring_virtqueue *vq, void *_desc) > { Let's split the helpers to packed/split version like other helpers? (Consider the caller has already known the type of vq). >...
2018 Mar 16
2
[PATCH RFC 2/2] virtio_ring: support packed ring
...}; > > /* How to notify other side. FIXME: commonalize hcalls! */ > bool (*notify)(struct virtqueue *vq); > @@ -201,26 +218,37 @@ static dma_addr_t vring_map_single(const struct vring_virtqueue *vq, > cpu_addr, size, direction); > } > > -static void vring_unmap_one(const struct vring_virtqueue *vq, > - struct vring_desc *desc) > +static void vring_unmap_one(const struct vring_virtqueue *vq, void *_desc) > { Let's split the helpers to packed/split version like other helpers? (Consider the caller has already known the type of vq). >...
2018 May 22
0
[RFC v5 2/5] virtio_ring: support creating packed ring
...; +} + /* * Modern virtio devices have feature bits to specify whether they need a * quirk and bypass the IOMMU. If not there, just use the DMA API. @@ -201,8 +246,17 @@ static dma_addr_t vring_map_single(const struct vring_virtqueue *vq, cpu_addr, size, direction); } -static void vring_unmap_one(const struct vring_virtqueue *vq, - struct vring_desc *desc) +static int vring_mapping_error(const struct vring_virtqueue *vq, + dma_addr_t addr) +{ + if (!vring_use_dma_api(vq->vq.vdev)) + return 0; + + return dma_mapping_error(vring_dma_dev(vq), addr); +} + +static void vring_...