search for: more_used

Displaying 20 results from an estimated 156 matches for "more_used".

2015 Dec 17
2
[PATCH] virtio: use smp_load_acquire/smp_store_release
...;idx, + cpu_to_virtio16(_vq->vdev, vq->avail_idx_shadow)); vq->num_added++; pr_debug("Added buffer head %i to %p\n", head, vq); @@ -453,9 +453,10 @@ static void detach_buf(struct vring_virtqueue *vq, unsigned int head) vq->vq.num_free++; } -static inline bool more_used(const struct vring_virtqueue *vq) +static inline +bool more_used(const struct vring_virtqueue *vq, __virtio16 used_idx) { - return vq->last_used_idx != virtio16_to_cpu(vq->vq.vdev, vq->vring.used->idx); + return vq->last_used_idx != virtio16_to_cpu(vq->vq.vdev, used_idx); } /...
2015 Dec 17
2
[PATCH] virtio: use smp_load_acquire/smp_store_release
...;idx, + cpu_to_virtio16(_vq->vdev, vq->avail_idx_shadow)); vq->num_added++; pr_debug("Added buffer head %i to %p\n", head, vq); @@ -453,9 +453,10 @@ static void detach_buf(struct vring_virtqueue *vq, unsigned int head) vq->vq.num_free++; } -static inline bool more_used(const struct vring_virtqueue *vq) +static inline +bool more_used(const struct vring_virtqueue *vq, __virtio16 used_idx) { - return vq->last_used_idx != virtio16_to_cpu(vq->vq.vdev, vq->vring.used->idx); + return vq->last_used_idx != virtio16_to_cpu(vq->vq.vdev, used_idx); } /...
2023 Apr 13
1
[PATCH net-next V2 0/2] virtio-net: don't busy poll for cvq command
...anges since V1: > - use RTNL to synchronize rx mode worker > - use completion for simplicity > - don't try to harden CVQ command > > Changes since RFC: > > - switch to use BAD_RING in virtio_break_device() > - check virtqueue_is_broken() after being woken up > - use more_used() instead of virtqueue_get_buf() to allow caller to > get buffers afterwards > - break the virtio-net device when timeout > - get buffer manually since the virtio core check more_used() instead > > Jason Wang (2): > virtio-net: convert rx mode setting to use workqueue...
2008 Jan 27
1
[PATCH] virtio_net tx performance fix
...: When VRING_USED_F_NO_NOTIFY is set, the host does not kick the guest when packets were transmitted, as a result the guest runs out of tx buffers sometimes. This is fine but the problem lies when add_buf fails, it called notify and the host sends all the pending tx pkts. When enable_cb was called, more_used(vq) returned false so eventually the skb was dropped. Moving notify from add_buf to enable_cb fixes this flow problem. The tx performance boosted from 220Mbps to 850Mbps. Signed-off-by: Dor Laor <dor.laor@qumranet.com> --- drivers/virtio/virtio_ring.c | 3 +-- 1 files changed, 1 inserti...
2008 Jan 27
1
[PATCH] virtio_net tx performance fix
...: When VRING_USED_F_NO_NOTIFY is set, the host does not kick the guest when packets were transmitted, as a result the guest runs out of tx buffers sometimes. This is fine but the problem lies when add_buf fails, it called notify and the host sends all the pending tx pkts. When enable_cb was called, more_used(vq) returned false so eventually the skb was dropped. Moving notify from add_buf to enable_cb fixes this flow problem. The tx performance boosted from 220Mbps to 850Mbps. Signed-off-by: Dor Laor <dor.laor@qumranet.com> --- drivers/virtio/virtio_ring.c | 3 +-- 1 files changed, 1 inserti...
2023 Apr 13
3
[PATCH net-next V2 0/2] virtio-net: don't busy poll for cvq command
...eneral workqueue. Please review. Thanks Changes since V1: - use RTNL to synchronize rx mode worker - use completion for simplicity - don't try to harden CVQ command Changes since RFC: - switch to use BAD_RING in virtio_break_device() - check virtqueue_is_broken() after being woken up - use more_used() instead of virtqueue_get_buf() to allow caller to get buffers afterwards - break the virtio-net device when timeout - get buffer manually since the virtio core check more_used() instead Jason Wang (2): virtio-net: convert rx mode setting to use workqueue virtio-net: sleep instead of bu...
2015 Jan 04
2
[RFC PATCH 0/3] Sharing MSIX irq for tx/rx queue pairs
...imply ignored. For devices that does not use channel, it can >> simply pass NULL or zero to virito core. >> >> With the patch, 1 MSIX irq were saved for each TX/RX queue pair. >> >> Please review. > How does this sharing affect performance? > Patch 3 only checks more_used() for tx ring which in fact reduces the effect of event index and may introduce more tx interrupts. After fixing this issue, tested with 1 vcpu and 1 queue. No obvious changes in performance were noticed. Thanks
2015 Jan 04
2
[RFC PATCH 0/3] Sharing MSIX irq for tx/rx queue pairs
...imply ignored. For devices that does not use channel, it can >> simply pass NULL or zero to virito core. >> >> With the patch, 1 MSIX irq were saved for each TX/RX queue pair. >> >> Please review. > How does this sharing affect performance? > Patch 3 only checks more_used() for tx ring which in fact reduces the effect of event index and may introduce more tx interrupts. After fixing this issue, tested with 1 vcpu and 1 queue. No obvious changes in performance were noticed. Thanks
2022 Dec 26
4
[PATCH 0/4] virtio-net: don't busy poll for cvq command
...ffects: 1) infinite poll for buggy devices 2) bad interaction with scheduler So this series tries to use sleep + timeout instead of busy polling. Please review. Thanks Changes since RFC: - switch to use BAD_RING in virtio_break_device() - check virtqueue_is_broken() after being woken up - use more_used() instead of virtqueue_get_buf() to allow caller to get buffers afterwards - break the virtio-net device when timeout - get buffer manually since the virtio core check more_used() instead Jason Wang (4): virtio-net: convert rx mode setting to use workqueue virtio_ring: switch to use BAD_RING...
2016 Nov 14
1
[PATCH] virtio_ring: fix description of virtqueue_get_buf
...-- drivers/virtio/virtio_ring.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c index 489bfc6..8a0d6a9 100644 --- a/drivers/virtio/virtio_ring.c +++ b/drivers/virtio/virtio_ring.c @@ -649,7 +649,7 @@ static inline bool more_used(const struct vring_virtqueue *vq) * @vq: the struct virtqueue we're talking about. * @len: the length written into the buffer * - * If the driver wrote data into the buffer, @len will be set to the + * If the device wrote data into the buffer, @len will be set to the * amount written....
2018 Apr 13
0
[RFC v2] virtio: support packed ring
On Sun, Apr 01, 2018 at 10:12:16PM +0800, Tiwei Bie wrote: > +static inline bool more_used(const struct vring_virtqueue *vq) > +{ > + return vq->packed ? more_used_packed(vq) : more_used_split(vq); > +} > + > +void *virtqueue_get_buf_ctx_split(struct virtqueue *_vq, unsigned int *len, > + void **ctx) > +{ > + struct vring_virtqueue *vq = to_vvq(_vq); >...
2016 Nov 14
1
[PATCH] virtio_ring: fix description of virtqueue_get_buf
...-- drivers/virtio/virtio_ring.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c index 489bfc6..8a0d6a9 100644 --- a/drivers/virtio/virtio_ring.c +++ b/drivers/virtio/virtio_ring.c @@ -649,7 +649,7 @@ static inline bool more_used(const struct vring_virtqueue *vq) * @vq: the struct virtqueue we're talking about. * @len: the length written into the buffer * - * If the driver wrote data into the buffer, @len will be set to the + * If the device wrote data into the buffer, @len will be set to the * amount written....
2013 Jul 08
3
[PATCH 1/2] virtio: support unlocked queue poll
.... + * + * Returns "true" if there are pending used buffers in the queue. + * + * This does not need to be serialized. + */ +bool virtqueue_poll(struct virtqueue *_vq, unsigned last_used_idx) +{ + struct vring_virtqueue *vq = to_vvq(_vq); + virtio_mb(vq->weak_barriers); - if (unlikely(more_used(vq))) { - END_USE(vq); - return false; - } + return (u16)last_used_idx != vq->vring.used->idx; +} +EXPORT_SYMBOL_GPL(virtqueue_poll); - END_USE(vq); - return true; +/** + * virtqueue_enable_cb - restart callbacks after disable_cb. + * @vq: the struct virtqueue we're talking about. + *...
2013 Jul 08
3
[PATCH 1/2] virtio: support unlocked queue poll
.... + * + * Returns "true" if there are pending used buffers in the queue. + * + * This does not need to be serialized. + */ +bool virtqueue_poll(struct virtqueue *_vq, unsigned last_used_idx) +{ + struct vring_virtqueue *vq = to_vvq(_vq); + virtio_mb(vq->weak_barriers); - if (unlikely(more_used(vq))) { - END_USE(vq); - return false; - } + return (u16)last_used_idx != vq->vring.used->idx; +} +EXPORT_SYMBOL_GPL(virtqueue_poll); - END_USE(vq); - return true; +/** + * virtqueue_enable_cb - restart callbacks after disable_cb. + * @vq: the struct virtqueue we're talking about. + *...
2023 May 24
2
[PATCH V3 net-next 0/2] virtio-net: don't busy poll for cvq command
...n't use interrupt but cond_resched() Changes since V1: - use RTNL to synchronize rx mode worker - use completion for simplicity - don't try to harden CVQ command Changes since RFC: - switch to use BAD_RING in virtio_break_device() - check virtqueue_is_broken() after being woken up - use more_used() instead of virtqueue_get_buf() to allow caller to get buffers afterwards - break the virtio-net device when timeout - get buffer manually since the virtio core check more_used() instead Jason Wang (2): virtio-net: convert rx mode setting to use workqueue virtio-net: add cond_resched()...
2023 Apr 13
1
[PATCH net-next V2 2/2] virtio-net: sleep instead of busy waiting for cvq command
...son Wang <jasowang at redhat.com> > --- > Changes since V1: > - use completion for simplicity > - don't try to harden the CVQ command which requires more thought > Changes since RFC: > - break the device when timeout > - get buffer manually since the virtio core check more_used() instead > --- > drivers/net/virtio_net.c | 21 ++++++++++++++------- > 1 file changed, 14 insertions(+), 7 deletions(-) > > diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c > index 2e56bbf86894..d3eb8fd6c9dc 100644 > --- a/drivers/net/virtio_net.c > +++ b/...
2023 Jul 20
2
[PATCH net-next v4 0/2] virtio-net: don't busy poll for cvq command
...n't use interrupt but cond_resched() Changes since V1: - use RTNL to synchronize rx mode worker - use completion for simplicity - don't try to harden CVQ command Changes since RFC: - switch to use BAD_RING in virtio_break_device() - check virtqueue_is_broken() after being woken up - use more_used() instead of virtqueue_get_buf() to allow caller to get buffers afterwards - break the virtio-net device when timeout - get buffer manually since the virtio core check more_used() instead Jason Wang (2): virtio-net: convert rx mode setting to use workqueue virtio-net: add cond_resched() to t...
2023 Apr 14
1
[PATCH net-next V2 2/2] virtio-net: sleep instead of busy waiting for cvq command
...> > > --- > > Changes since V1: > > - use completion for simplicity > > - don't try to harden the CVQ command which requires more thought > > Changes since RFC: > > - break the device when timeout > > - get buffer manually since the virtio core check more_used() instead > > --- > > drivers/net/virtio_net.c | 21 ++++++++++++++------- > > 1 file changed, 14 insertions(+), 7 deletions(-) > > > > diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c > > index 2e56bbf86894..d3eb8fd6c9dc 100644 > > --- a/d...
2018 Apr 01
8
[RFC v2] virtio: support packed ring
...desc); j++) - vring_unmap_one(vq, &indir_desc[j]); + vring_unmap_one_split(vq, &indir_desc[j]); kfree(indir_desc); vq->desc_state[head].indir_desc = NULL; @@ -675,11 +995,207 @@ static void detach_buf(struct vring_virtqueue *vq, unsigned int head, } } -static inline bool more_used(const struct vring_virtqueue *vq) +static int detach_buf_packed(struct vring_virtqueue *vq, unsigned int head, + void **ctx) +{ + struct vring_packed_desc *desc; + unsigned int i, j; + + /* Clear data ptr. */ + vq->desc_state[head].data = NULL; + + i = head; + + for (j = 0; j < vq-&gt...
2018 Apr 01
8
[RFC v2] virtio: support packed ring
...desc); j++) - vring_unmap_one(vq, &indir_desc[j]); + vring_unmap_one_split(vq, &indir_desc[j]); kfree(indir_desc); vq->desc_state[head].indir_desc = NULL; @@ -675,11 +995,207 @@ static void detach_buf(struct vring_virtqueue *vq, unsigned int head, } } -static inline bool more_used(const struct vring_virtqueue *vq) +static int detach_buf_packed(struct vring_virtqueue *vq, unsigned int head, + void **ctx) +{ + struct vring_packed_desc *desc; + unsigned int i, j; + + /* Clear data ptr. */ + vq->desc_state[head].data = NULL; + + i = head; + + for (j = 0; j < vq-&gt...