search for: vringh_iov_pull_kern

Displaying 20 results from an estimated 54 matches for "vringh_iov_pull_kern".

2019 Oct 24
2
[PATCH net-next] vringh: fix copy direction of vringh_iov_push_kern()
...id *src, void *dst, size_t len) return 0; } +static inline int kern_xfer(void *dst, void *src, size_t len) +{ + memcpy(dst, src, len); + return 0; +} + /** * vringh_init_kern - initialize a vringh for a kernelspace vring. * @vrh: the vringh to initialize. @@ -958,7 +964,7 @@ EXPORT_SYMBOL(vringh_iov_pull_kern); ssize_t vringh_iov_push_kern(struct vringh_kiov *wiov, const void *src, size_t len) { - return vringh_iov_xfer(wiov, (void *)src, len, xfer_kern); + return vringh_iov_xfer(wiov, (void *)src, len, kern_xfer); } EXPORT_SYMBOL(vringh_iov_push_kern); -- 2.19.1
2019 Oct 24
2
[PATCH net-next] vringh: fix copy direction of vringh_iov_push_kern()
...id *src, void *dst, size_t len) return 0; } +static inline int kern_xfer(void *dst, void *src, size_t len) +{ + memcpy(dst, src, len); + return 0; +} + /** * vringh_init_kern - initialize a vringh for a kernelspace vring. * @vrh: the vringh to initialize. @@ -958,7 +964,7 @@ EXPORT_SYMBOL(vringh_iov_pull_kern); ssize_t vringh_iov_push_kern(struct vringh_kiov *wiov, const void *src, size_t len) { - return vringh_iov_xfer(wiov, (void *)src, len, xfer_kern); + return vringh_iov_xfer(wiov, (void *)src, len, kern_xfer); } EXPORT_SYMBOL(vringh_iov_push_kern); -- 2.19.1
2019 Sep 23
2
[PATCH 5/6] vringh: fix copy direction of vringh_iov_push_kern()
...gt; +static inline int kern_xfer(void *dst, void *src, size_t len) > +{ > + memcpy(dst, src, len); > + return 0; > +} > + > /** > * vringh_init_kern - initialize a vringh for a kernelspace vring. > * @vrh: the vringh to initialize. > @@ -958,7 +964,7 @@ EXPORT_SYMBOL(vringh_iov_pull_kern); > ssize_t vringh_iov_push_kern(struct vringh_kiov *wiov, > const void *src, size_t len) > { > - return vringh_iov_xfer(wiov, (void *)src, len, xfer_kern); > + return vringh_iov_xfer(wiov, (void *)src, len, kern_xfer); > } > EXPORT_SYMBOL(vringh_iov_push_kern); &g...
2019 Sep 23
2
[PATCH 5/6] vringh: fix copy direction of vringh_iov_push_kern()
...gt; +static inline int kern_xfer(void *dst, void *src, size_t len) > +{ > + memcpy(dst, src, len); > + return 0; > +} > + > /** > * vringh_init_kern - initialize a vringh for a kernelspace vring. > * @vrh: the vringh to initialize. > @@ -958,7 +964,7 @@ EXPORT_SYMBOL(vringh_iov_pull_kern); > ssize_t vringh_iov_push_kern(struct vringh_kiov *wiov, > const void *src, size_t len) > { > - return vringh_iov_xfer(wiov, (void *)src, len, xfer_kern); > + return vringh_iov_xfer(wiov, (void *)src, len, kern_xfer); > } > EXPORT_SYMBOL(vringh_iov_push_kern); &g...
2019 Sep 23
0
[PATCH 5/6] vringh: fix copy direction of vringh_iov_push_kern()
...id *src, void *dst, size_t len) return 0; } +static inline int kern_xfer(void *dst, void *src, size_t len) +{ + memcpy(dst, src, len); + return 0; +} + /** * vringh_init_kern - initialize a vringh for a kernelspace vring. * @vrh: the vringh to initialize. @@ -958,7 +964,7 @@ EXPORT_SYMBOL(vringh_iov_pull_kern); ssize_t vringh_iov_push_kern(struct vringh_kiov *wiov, const void *src, size_t len) { - return vringh_iov_xfer(wiov, (void *)src, len, xfer_kern); + return vringh_iov_xfer(wiov, (void *)src, len, kern_xfer); } EXPORT_SYMBOL(vringh_iov_push_kern); -- 2.19.1
2019 Sep 23
0
[PATCH 5/6] vringh: fix copy direction of vringh_iov_push_kern()
...oid *src, size_t len) > > +{ > > + memcpy(dst, src, len); > > + return 0; > > +} > > + > > /** > > * vringh_init_kern - initialize a vringh for a kernelspace vring. > > * @vrh: the vringh to initialize. > > @@ -958,7 +964,7 @@ EXPORT_SYMBOL(vringh_iov_pull_kern); > > ssize_t vringh_iov_push_kern(struct vringh_kiov *wiov, > > const void *src, size_t len) > > { > > - return vringh_iov_xfer(wiov, (void *)src, len, xfer_kern); > > + return vringh_iov_xfer(wiov, (void *)src, len, kern_xfer); > > } > > EXPO...
2019 Oct 27
0
[PATCH net-next] vringh: fix copy direction of vringh_iov_push_kern()
...gt; +static inline int kern_xfer(void *dst, void *src, size_t len) > +{ > + memcpy(dst, src, len); > + return 0; > +} > + > /** > * vringh_init_kern - initialize a vringh for a kernelspace vring. > * @vrh: the vringh to initialize. > @@ -958,7 +964,7 @@ EXPORT_SYMBOL(vringh_iov_pull_kern); > ssize_t vringh_iov_push_kern(struct vringh_kiov *wiov, > const void *src, size_t len) > { > - return vringh_iov_xfer(wiov, (void *)src, len, xfer_kern); > + return vringh_iov_xfer(wiov, (void *)src, len, kern_xfer); > } > EXPORT_SYMBOL(vringh_iov_push_kern); &g...
2013 Aug 02
1
[PATCH 3/5] Intel MIC Host Driver Changes for Virtio Devices.
...ntually DMA) via a custom MIC API and then publishing the descriptor via vringh_complete_kern(..). Are there any plans of enhancing VRINGH to allow overriding the xfer mechanism in vringh_iov_xfer(..)? This will allow drivers with custom xfer routines to reuse APIs like vringh_iov_push_kern(..) and vringh_iov_pull_kern(..) as well. That said, the existing VRINGH infrastructure is generic enough for our use case as is today. We will post a rev1 of the patch series using VRINGH after some more validation which should automatically address most of your other feedback. Thanks for the review! > > diff --git a/...
2013 Aug 02
1
[PATCH 3/5] Intel MIC Host Driver Changes for Virtio Devices.
...ntually DMA) via a custom MIC API and then publishing the descriptor via vringh_complete_kern(..). Are there any plans of enhancing VRINGH to allow overriding the xfer mechanism in vringh_iov_xfer(..)? This will allow drivers with custom xfer routines to reuse APIs like vringh_iov_push_kern(..) and vringh_iov_pull_kern(..) as well. That said, the existing VRINGH infrastructure is generic enough for our use case as is today. We will post a rev1 of the patch series using VRINGH after some more validation which should automatically address most of your other feedback. Thanks for the review! > > diff --git a/...
2019 Sep 24
1
[PATCH 5/6] vringh: fix copy direction of vringh_iov_push_kern()
...> > + memcpy(dst, src, len); > > > + return 0; > > > +} > > > + > > > /** > > > * vringh_init_kern - initialize a vringh for a kernelspace vring. > > > * @vrh: the vringh to initialize. > > > @@ -958,7 +964,7 @@ EXPORT_SYMBOL(vringh_iov_pull_kern); > > > ssize_t vringh_iov_push_kern(struct vringh_kiov *wiov, > > > const void *src, size_t len) > > > { > > > - return vringh_iov_xfer(wiov, (void *)src, len, xfer_kern); > > > + return vringh_iov_xfer(wiov, (void *)src, len, kern_xfer); &gt...
2020 Apr 02
0
[vhost:vhost 22/22] drivers/vdpa/vdpa_sim/vdpa_sim.c:94:8: error: implicit declaration of function 'vringh_init_iotlb'; did you mean 'vringh_init_kern'?
...-declaration] 157 | vringh_complete_iotlb(&txq->vring, txq->head, 0); | ^~~~~~~~~~~~~~~~~~~~~ | vringh_complete_kern >> drivers/vdpa/vdpa_sim/vdpa_sim.c:162:11: error: implicit declaration of function 'vringh_iov_pull_iotlb'; did you mean 'vringh_iov_pull_kern'? [-Werror=implicit-function-declaration] 162 | read = vringh_iov_pull_iotlb(&txq->vring, &txq->iov, | ^~~~~~~~~~~~~~~~~~~~~ | vringh_iov_pull_kern >> drivers/vdpa/vdpa_sim/vdpa_sim.c:168:12: error: implicit declaration of functi...
2013 Jan 17
8
[PATCH 1/6] virtio_host: host-side implementation of virtio rings.
..., getu16_kern, &vrh->last_avail_idx); + if (err < 0) + return err; + + /* Empty... */ + if (err == vrh->vring.num) + return 0; + + *head = err; + err = __vringh_iov(vrh, *head, riov, wiov, noop_getrange, + gfp, getdesc_kern); + if (err) + return err; + + return 1; +} + +/** + * vringh_iov_pull_kern - copy bytes from vring_iov. + * @riov: the riov as passed to vringh_getdesc_kern() (updated as we consume) + * @dst: the place to copy. + * @len: the maximum length to copy. + * + * Returns the bytes copied <= len or a negative errno. + */ +ssize_t vringh_iov_pull_kern(struct vringh_iov *riov,...
2013 Jan 17
8
[PATCH 1/6] virtio_host: host-side implementation of virtio rings.
..., getu16_kern, &vrh->last_avail_idx); + if (err < 0) + return err; + + /* Empty... */ + if (err == vrh->vring.num) + return 0; + + *head = err; + err = __vringh_iov(vrh, *head, riov, wiov, noop_getrange, + gfp, getdesc_kern); + if (err) + return err; + + return 1; +} + +/** + * vringh_iov_pull_kern - copy bytes from vring_iov. + * @riov: the riov as passed to vringh_getdesc_kern() (updated as we consume) + * @dst: the place to copy. + * @len: the maximum length to copy. + * + * Returns the bytes copied <= len or a negative errno. + */ +ssize_t vringh_iov_pull_kern(struct vringh_iov *riov,...
2019 Sep 10
1
[RFC PATCH 4/4] docs: Sample driver to demonstrate how to implement virtio-mdev framework
...t;vring, NULL, &rxq->iov, > + &rxq->head, GFP_KERNEL); GFP_KERNEL under a spin_lock will cause deadlocks. > + if (err <= 0) { > + vringh_complete_kern(&txq->vring, txq->head, 0); > + break; > + } > + > + while (true) { > + read = vringh_iov_pull_kern(&txq->iov, mvnet->buffer, > + PAGE_SIZE); > + if (read <= 0) > + break; > + > + write = vringh_iov_push_kern(&rxq->iov, mvnet->buffer, > + read); > + if (write <= 0) > + break; > + > + total_write += write; &gt...
2019 Nov 05
0
[PATCH V8 6/6] docs: sample driver to demonstrate how to implement virtio-mdev framework
...gt;head, GFP_ATOMIC); + if (err <= 0) + break; + + err = vringh_getdesc_kern(&rxq->vring, NULL, &rxq->iov, + &rxq->head, GFP_ATOMIC); + if (err <= 0) { + vringh_complete_kern(&txq->vring, txq->head, 0); + break; + } + + while (true) { + read = vringh_iov_pull_kern(&txq->iov, mvnet->buffer, + PAGE_SIZE); + if (read <= 0) + break; + + write = vringh_iov_push_kern(&rxq->iov, mvnet->buffer, + read); + if (write <= 0) + break; + + total_write += write; + } + + /* Make sure data is wrote before advancing...
2019 Sep 10
0
[RFC PATCH 4/4] docs: Sample driver to demonstrate how to implement virtio-mdev framework
...gt;head, GFP_KERNEL); + if (err <= 0) + break; + + err = vringh_getdesc_kern(&rxq->vring, NULL, &rxq->iov, + &rxq->head, GFP_KERNEL); + if (err <= 0) { + vringh_complete_kern(&txq->vring, txq->head, 0); + break; + } + + while (true) { + read = vringh_iov_pull_kern(&txq->iov, mvnet->buffer, + PAGE_SIZE); + if (read <= 0) + break; + + write = vringh_iov_push_kern(&rxq->iov, mvnet->buffer, + read); + if (write <= 0) + break; + + total_write += write; + } + + /* Make sure data is wrote before advancing...
2019 Oct 30
0
[PATCH V6 6/6] docs: sample driver to demonstrate how to implement virtio-mdev framework
...gt;head, GFP_ATOMIC); + if (err <= 0) + break; + + err = vringh_getdesc_kern(&rxq->vring, NULL, &rxq->iov, + &rxq->head, GFP_ATOMIC); + if (err <= 0) { + vringh_complete_kern(&txq->vring, txq->head, 0); + break; + } + + while (true) { + read = vringh_iov_pull_kern(&txq->iov, mvnet->buffer, + PAGE_SIZE); + if (read <= 0) + break; + + write = vringh_iov_push_kern(&rxq->iov, mvnet->buffer, + read); + if (write <= 0) + break; + + total_write += write; + } + + /* Make sure data is wrote before advancing...
2013 Feb 18
9
[PATCH 0/5] vringh
This introduces vringh, which are generic accessors for virtio rings (host side). There's a host-side implementation in vhost, but it assumes that the rings are in userspace, and is tied to the vhost implementation. I have patches to adapt it to use vringh, but I'm pushing this in the next merge window for Sjur, who has CAIF patches which need it. This also includes a test program in
2013 Feb 18
9
[PATCH 0/5] vringh
This introduces vringh, which are generic accessors for virtio rings (host side). There's a host-side implementation in vhost, but it assumes that the rings are in userspace, and is tied to the vhost implementation. I have patches to adapt it to use vringh, but I'm pushing this in the next merge window for Sjur, who has CAIF patches which need it. This also includes a test program in
2019 Nov 07
0
[PATCH V11 6/6] docs: sample driver to demonstrate how to implement virtio-mdev framework
...gt;head, GFP_ATOMIC); + if (err <= 0) + break; + + err = vringh_getdesc_kern(&rxq->vring, NULL, &rxq->iov, + &rxq->head, GFP_ATOMIC); + if (err <= 0) { + vringh_complete_kern(&txq->vring, txq->head, 0); + break; + } + + while (true) { + read = vringh_iov_pull_kern(&txq->iov, mvnet->buffer, + PAGE_SIZE); + if (read <= 0) + break; + + write = vringh_iov_push_kern(&rxq->iov, mvnet->buffer, + read); + if (write <= 0) + break; + + total_write += write; + } + + /* Make sure data is wrote before advancing...