search for: vhost_add_used_n

Displaying 20 results from an estimated 182 matches for "vhost_add_used_n".

Did you mean: vhost_add_used
2013 Aug 16
1
[PATCH 3/6] vhost: switch to use vhost_add_used_n()
On Fri, Aug 16, 2013 at 01:16:27PM +0800, Jason Wang wrote: > Let vhost_add_used() to use vhost_add_used_n() to reduce the code duplication. > > Signed-off-by: Jason Wang <jasowang at redhat.com> Does compiler inline it then? Reason I ask, last time I checked put_user inside vhost_add_used was much cheaper than copy_to_user inside vhost_add_used_n, so I wouldn't be surprised if this hu...
2013 Aug 16
1
[PATCH 3/6] vhost: switch to use vhost_add_used_n()
On Fri, Aug 16, 2013 at 01:16:27PM +0800, Jason Wang wrote: > Let vhost_add_used() to use vhost_add_used_n() to reduce the code duplication. > > Signed-off-by: Jason Wang <jasowang at redhat.com> Does compiler inline it then? Reason I ask, last time I checked put_user inside vhost_add_used was much cheaper than copy_to_user inside vhost_add_used_n, so I wouldn't be surprised if this hu...
2013 Aug 16
0
[PATCH 3/6] vhost: switch to use vhost_add_used_n()
Let vhost_add_used() to use vhost_add_used_n() to reduce the code duplication. Signed-off-by: Jason Wang <jasowang at redhat.com> --- drivers/vhost/vhost.c | 43 ++----------------------------------------- 1 files changed, 2 insertions(+), 41 deletions(-) diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c index e58cf00..c47...
2018 Dec 12
0
[PATCH net V2 1/4] vhost: make sure used idx is seen before log in vhost_add_used_n()
...-off-by: Jason Wang <jasowang at redhat.com> --- drivers/vhost/vhost.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c index 6b98d8e3a5bf..5915f240275a 100644 --- a/drivers/vhost/vhost.c +++ b/drivers/vhost/vhost.c @@ -2220,6 +2220,8 @@ int vhost_add_used_n(struct vhost_virtqueue *vq, struct vring_used_elem *heads, return -EFAULT; } if (unlikely(vq->log_used)) { + /* Make sure used idx is seen before log. */ + smp_wmb(); /* Log used index update. */ log_write(vq->log_base, vq->log_addr + offsetof(struct vring_used, idx),...
2020 Jun 07
0
[PATCH RFC v5 13/13] vhost: drop head based APIs
...rd_vq_desc(struct vhost_virtqueue *vq, int n) { vq->last_avail_idx -= n; } -EXPORT_SYMBOL_GPL(vhost_discard_vq_desc); /* This function returns a value > 0 if a descriptor was found, or 0 if none were found. * A negative code is returned on error. */ @@ -2464,8 +2464,7 @@ static int __vhost_add_used_n(struct vhost_virtqueue *vq, return 0; } -/* After we've used one of their buffers, we tell them about it. We'll then - * want to notify the guest, using eventfd. */ +static int vhost_add_used_n(struct vhost_virtqueue *vq, struct vring_used_elem *heads, unsigned count) { @@ -...
2014 Jul 01
0
[PATCH RFC 2/2] vhost: support urgent descriptors
...unsigned int *out_num, unsigned int *in_num, struct vhost_log *log, unsigned int *log_num); void vhost_discard_vq_desc(struct vhost_virtqueue *, int n); int vhost_init_used(struct vhost_virtqueue *); -int vhost_add_used(struct vhost_virtqueue *, unsigned int head, int len); -int vhost_add_used_n(struct vhost_virtqueue *, struct vring_used_elem *heads, - unsigned count); -void vhost_add_used_and_signal(struct vhost_dev *, struct vhost_virtqueue *, +int vhost_add_used(struct vhost_virtqueue *, bool urgent, + unsigned int head, int len); +int vhost_add_used_n(struct vhost_virtqueue...
2014 Jul 01
5
[PATCH RFC 1/2] virtio: support for urgent descriptors
Below should be useful for some experiments Jason is doing. I thought I'd send it out for early review/feedback. Compiled-only at this point. event idx feature allows us to defer interrupts until a specific # of descriptors were used. Sometimes it might be useful to get an interrupt after a specific descriptor, regardless. This adds a descriptor flag for this, and an API to create an urgent
2014 Jul 01
5
[PATCH RFC 1/2] virtio: support for urgent descriptors
Below should be useful for some experiments Jason is doing. I thought I'd send it out for early review/feedback. Compiled-only at this point. event idx feature allows us to defer interrupts until a specific # of descriptors were used. Sometimes it might be useful to get an interrupt after a specific descriptor, regardless. This adds a descriptor flag for this, and an API to create an urgent
2014 Sep 19
2
[PATCH RFC 2/2] vhost: support urgent descriptors
...vhost/vhost.c | 23 ++++++++++++++++------- > 5 files changed, 68 insertions(+), 32 deletions(-) > > diff --git a/drivers/vhost/vhost.h b/drivers/vhost/vhost.h > index 3eda654..61ca542 100644 > --- a/drivers/vhost/vhost.h > +++ b/drivers/vhost/vhost.h [...] > EXPORT_SYMBOL_GPL(vhost_add_used_n); > @@ -1433,12 +1439,13 @@ static bool vhost_notify(struct vhost_dev *dev, struct vhost_virtqueue *vq) > unlikely(vq->avail_idx == vq->last_avail_idx)) > return true; > > - if (!vhost_has_feature(vq, VIRTIO_RING_F_EVENT_IDX)) { > + if (vq->urgent || !vhost_has...
2014 Sep 19
2
[PATCH RFC 2/2] vhost: support urgent descriptors
...vhost/vhost.c | 23 ++++++++++++++++------- > 5 files changed, 68 insertions(+), 32 deletions(-) > > diff --git a/drivers/vhost/vhost.h b/drivers/vhost/vhost.h > index 3eda654..61ca542 100644 > --- a/drivers/vhost/vhost.h > +++ b/drivers/vhost/vhost.h [...] > EXPORT_SYMBOL_GPL(vhost_add_used_n); > @@ -1433,12 +1439,13 @@ static bool vhost_notify(struct vhost_dev *dev, struct vhost_virtqueue *vq) > unlikely(vq->avail_idx == vq->last_avail_idx)) > return true; > > - if (!vhost_has_feature(vq, VIRTIO_RING_F_EVENT_IDX)) { > + if (vq->urgent || !vhost_has...
2014 Nov 30
3
[PATCH v7 31/46] vhost: virtio 1.0 endian-ness support
...discard_vq_desc); * want to notify the guest, using eventfd. */ int vhost_add_used(struct vhost_virtqueue *vq, unsigned int head, int len) { - struct vring_used_elem heads = { head, len }; + struct vring_used_elem heads = { + cpu_to_vhost32(vq, head), + cpu_to_vhost32(vq, len) + }; return vhost_add_used_n(vq, &heads, 1); } @@ -1404,7 +1422,7 @@ int vhost_add_used_n(struct vhost_virtqueue *vq, struct vring_used_elem *heads, /* Make sure buffer is written before we update index. */ smp_wmb(); - if (put_user(vq->last_used_idx, &vq->used->idx)) { + if (__put_user(cpu_to_vhost16(v...
2014 Nov 30
3
[PATCH v7 31/46] vhost: virtio 1.0 endian-ness support
...discard_vq_desc); * want to notify the guest, using eventfd. */ int vhost_add_used(struct vhost_virtqueue *vq, unsigned int head, int len) { - struct vring_used_elem heads = { head, len }; + struct vring_used_elem heads = { + cpu_to_vhost32(vq, head), + cpu_to_vhost32(vq, len) + }; return vhost_add_used_n(vq, &heads, 1); } @@ -1404,7 +1422,7 @@ int vhost_add_used_n(struct vhost_virtqueue *vq, struct vring_used_elem *heads, /* Make sure buffer is written before we update index. */ smp_wmb(); - if (put_user(vq->last_used_idx, &vq->used->idx)) { + if (__put_user(cpu_to_vhost16(v...
2018 Dec 13
4
[PATCH v2 2/5] VSOCK: support fill data to mergeable rx buffer in host
...s approach jumps into making interface changes for > optimizations too quickly. For example, what prevents us > from taking a big buffer, prepending each chunk > with the header and writing it out without > host/guest interface changes? > > This should allow optimizations such as vhost_add_used_n > batching. > > I realize a header in each packet does have a cost, > but it also has advantages such as improved robustness, > I'd like to see more of an apples to apples comparison > of the performance gain from skipping them. > > Hi Michael, I don't fully und...
2018 Dec 13
4
[PATCH v2 2/5] VSOCK: support fill data to mergeable rx buffer in host
...s approach jumps into making interface changes for > optimizations too quickly. For example, what prevents us > from taking a big buffer, prepending each chunk > with the header and writing it out without > host/guest interface changes? > > This should allow optimizations such as vhost_add_used_n > batching. > > I realize a header in each packet does have a cost, > but it also has advantages such as improved robustness, > I'd like to see more of an apples to apples comparison > of the performance gain from skipping them. > > Hi Michael, I don't fully und...
2013 Aug 16
10
[PATCH 0/6] vhost code cleanup and minor enhancement
Hi all: This series tries to unify and simplify vhost codes especially for zerocopy. Plase review. Thanks Jason Wang (6): vhost_net: make vhost_zerocopy_signal_used() returns void vhost_net: use vhost_add_used_and_signal_n() in vhost_zerocopy_signal_used() vhost: switch to use vhost_add_used_n() vhost_net: determine whether or not to use zerocopy at one time vhost_net: poll vhost queue after marking DMA is done vhost_net: remove the max pending check drivers/vhost/net.c | 86 +++++++++++++++++++----------------------------- drivers/vhost/vhost.c | 43 +----------------------...
2013 Aug 16
10
[PATCH 0/6] vhost code cleanup and minor enhancement
Hi all: This series tries to unify and simplify vhost codes especially for zerocopy. Plase review. Thanks Jason Wang (6): vhost_net: make vhost_zerocopy_signal_used() returns void vhost_net: use vhost_add_used_and_signal_n() in vhost_zerocopy_signal_used() vhost: switch to use vhost_add_used_n() vhost_net: determine whether or not to use zerocopy at one time vhost_net: poll vhost queue after marking DMA is done vhost_net: remove the max pending check drivers/vhost/net.c | 86 +++++++++++++++++++----------------------------- drivers/vhost/vhost.c | 43 +----------------------...
2013 Jul 07
2
[PATCH v2 03/11] vhost: Make vhost a separate module
...> @@ -1343,6 +1367,7 @@ int vhost_add_used(struct vhost_virtqueue *vq, unsigned int head, int len) > > > vq->signalled_used_valid = false; > > > return 0; > > > } > > > +EXPORT_SYMBOL_GPL(vhost_add_used); > > > > > > static int __vhost_add_used_n(struct vhost_virtqueue *vq, > > > struct vring_used_elem *heads, > > > @@ -1412,6 +1437,7 @@ int vhost_add_used_n(struct vhost_virtqueue *vq, struct vring_used_elem *heads, > > > } > > > return r; > > > } > > > +EXPORT_SYMBOL_GPL(vh...
2013 Jul 07
2
[PATCH v2 03/11] vhost: Make vhost a separate module
...> @@ -1343,6 +1367,7 @@ int vhost_add_used(struct vhost_virtqueue *vq, unsigned int head, int len) > > > vq->signalled_used_valid = false; > > > return 0; > > > } > > > +EXPORT_SYMBOL_GPL(vhost_add_used); > > > > > > static int __vhost_add_used_n(struct vhost_virtqueue *vq, > > > struct vring_used_elem *heads, > > > @@ -1412,6 +1437,7 @@ int vhost_add_used_n(struct vhost_virtqueue *vq, struct vring_used_elem *heads, > > > } > > > return r; > > > } > > > +EXPORT_SYMBOL_GPL(vh...
2017 Sep 27
2
[PATCH net-next RFC 3/5] vhost: introduce vhost_add_used_idx()
...> + sizeof(vq->used->idx)); > > > + if (vq->log_ctx) > > > + eventfd_signal(vq->log_ctx, 1); > > > + } > > > + return 0; > > > +} > > > +EXPORT_SYMBOL_GPL(vhost_add_used_idx); > > > + > > > static int __vhost_add_used_n(struct vhost_virtqueue *vq, > > > struct vring_used_elem *heads, > > > unsigned count) > > > diff --git a/drivers/vhost/vhost.h b/drivers/vhost/vhost.h > > > index 16c2cb6..5dd6c05 100644 > > > --- a/drivers/vhost/vhost.h > > >...
2017 Sep 27
2
[PATCH net-next RFC 3/5] vhost: introduce vhost_add_used_idx()
...> + sizeof(vq->used->idx)); > > > + if (vq->log_ctx) > > > + eventfd_signal(vq->log_ctx, 1); > > > + } > > > + return 0; > > > +} > > > +EXPORT_SYMBOL_GPL(vhost_add_used_idx); > > > + > > > static int __vhost_add_used_n(struct vhost_virtqueue *vq, > > > struct vring_used_elem *heads, > > > unsigned count) > > > diff --git a/drivers/vhost/vhost.h b/drivers/vhost/vhost.h > > > index 16c2cb6..5dd6c05 100644 > > > --- a/drivers/vhost/vhost.h > > >...