search for: used_flag

Displaying 20 results from an estimated 225 matches for "used_flag".

Did you mean: used_flags
2011 Jun 16
1
[PATCH] vhost: set dirty log when updating flags of used ring
We need to set log when updating flags of used ring, otherwise they may be missed after migration. A helper was introduced to write used_flags back to guest memory and update the log if necessary. Signed-off-by: Jason Wang <jasowang at redhat.com> --- drivers/vhost/vhost.c | 26 ++++++++++++++++++++++---- drivers/vhost/vhost.h | 2 ++ 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/drivers/vhost/vhost.c b/dri...
2011 Jun 16
1
[PATCH] vhost: set dirty log when updating flags of used ring
We need to set log when updating flags of used ring, otherwise they may be missed after migration. A helper was introduced to write used_flags back to guest memory and update the log if necessary. Signed-off-by: Jason Wang <jasowang at redhat.com> --- drivers/vhost/vhost.c | 26 ++++++++++++++++++++++---- drivers/vhost/vhost.h | 2 ++ 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/drivers/vhost/vhost.c b/dri...
2018 May 30
2
[RFC V5 PATCH 8/8] vhost: event suppression for packed ring
...> + if (vhost_has_feature(vq, VIRTIO_F_RING_PACKED)) > + return vq_iotlb_prefetch_packed(vq); > + else > + return vq_iotlb_prefetch_split(vq); > +} > EXPORT_SYMBOL_GPL(vq_iotlb_prefetch); > > /* Can we log writes? */ > @@ -1730,6 +1759,50 @@ static int vhost_update_used_flags(struct vhost_virtqueue *vq) > return 0; > } > > +static int vhost_update_device_flags(struct vhost_virtqueue *vq, > + __virtio16 device_flags) > +{ > + void __user *flags; > + > + if (vhost_put_user(vq, device_flags, &vq->device_event->flags, >...
2018 May 30
2
[RFC V5 PATCH 8/8] vhost: event suppression for packed ring
...> + if (vhost_has_feature(vq, VIRTIO_F_RING_PACKED)) > + return vq_iotlb_prefetch_packed(vq); > + else > + return vq_iotlb_prefetch_split(vq); > +} > EXPORT_SYMBOL_GPL(vq_iotlb_prefetch); > > /* Can we log writes? */ > @@ -1730,6 +1759,50 @@ static int vhost_update_used_flags(struct vhost_virtqueue *vq) > return 0; > } > > +static int vhost_update_device_flags(struct vhost_virtqueue *vq, > + __virtio16 device_flags) > +{ > + void __user *flags; > + > + if (vhost_put_user(vq, device_flags, &vq->device_event->flags, >...
2011 Jun 21
1
[PATCH 1/2] vhost: init used ring after backend was set
...ers/vhost/vhost.c @@ -578,15 +578,14 @@ static long vhost_set_memory(struct vhost_dev *d, struct vhost_memory __user *m) return 0; } -static int init_used(struct vhost_virtqueue *vq, - struct vring_used __user *used) +int init_used(struct vhost_virtqueue *vq) { - int r = put_user(vq->used_flags, &used->flags); + int r = put_user(vq->used_flags, &vq->used->flags); if (r) return r; vq->signalled_used_valid = false; - return get_user(vq->last_used_idx, &used->idx); + return get_user(vq->last_used_idx, &vq->used->idx); } static long...
2011 Jun 21
1
[PATCH 1/2] vhost: init used ring after backend was set
...ers/vhost/vhost.c @@ -578,15 +578,14 @@ static long vhost_set_memory(struct vhost_dev *d, struct vhost_memory __user *m) return 0; } -static int init_used(struct vhost_virtqueue *vq, - struct vring_used __user *used) +int init_used(struct vhost_virtqueue *vq) { - int r = put_user(vq->used_flags, &used->flags); + int r = put_user(vq->used_flags, &vq->used->flags); if (r) return r; vq->signalled_used_valid = false; - return get_user(vq->last_used_idx, &used->idx); + return get_user(vq->last_used_idx, &vq->used->idx); } static long...
2018 Mar 30
1
[RFC PATCH V2 8/8] vhost: event suppression for packed ring
...t; void vhost_signal(struct vhost_dev *dev, struct vhost_virtqueue *vq) > { > @@ -2789,7 +2911,17 @@ static bool vhost_enable_notify_packed(struct vhost_dev *dev, > __virtio16 flags; > int ret; > > - /* FIXME: disable notification through device area */ > + if (!(vq->used_flags & VRING_USED_F_NO_NOTIFY)) > + return false; > + vq->used_flags &= ~VRING_USED_F_NO_NOTIFY; > + > + flags = cpu_to_vhost16(vq, RING_EVENT_FLAGS_ENABLE); > + ret = vhost_update_device_flags(vq, flags); > + if (ret) { > + vq_err(vq, "Failed to enable notificati...
2018 May 31
0
[RFC V5 PATCH 8/8] vhost: event suppression for packed ring
...>> { >> struct vring_desc_packed *d = vq->desc_packed + vq->avail_idx; >> - __virtio16 flags; >> + __virtio16 flags = RING_EVENT_FLAGS_ENABLE; >> int ret; >> >> - /* FIXME: disable notification through device area */ >> + if (!(vq->used_flags & VRING_USED_F_NO_NOTIFY)) >> + return false; >> + vq->used_flags &= ~VRING_USED_F_NO_NOTIFY; > 'used_flags' was originally designed for 1.0, why should we pay attetion to it here? > > Wei It was used to recored whether or not we've disabled notificati...
2018 May 16
0
[RFC V4 PATCH 8/8] vhost: event suppression for packed ring
...e *vq) +{ + if (!vq->iotlb) + return 1; + + if (vhost_has_feature(vq, VIRTIO_F_RING_PACKED)) + return vq_iotlb_prefetch_packed(vq); + else + return vq_iotlb_prefetch_split(vq); +} EXPORT_SYMBOL_GPL(vq_iotlb_prefetch); /* Can we log writes? */ @@ -1724,6 +1753,29 @@ static int vhost_update_used_flags(struct vhost_virtqueue *vq) return 0; } +static int vhost_update_device_flags(struct vhost_virtqueue *vq, + __virtio16 device_flags) +{ + void __user *flags; + + if (vhost_put_user(vq, cpu_to_vhost16(vq, device_flags), + &vq->device_event->flags, + VHOST_ADDR_USED)...
2018 Mar 26
0
[RFC PATCH V2 8/8] vhost: event suppression for packed ring
...e *vq) +{ + if (!vq->iotlb) + return 1; + + if (vhost_has_feature(vq, VIRTIO_F_RING_PACKED)) + return vq_iotlb_prefetch_packed(vq); + else + return vq_iotlb_prefetch_split(vq); +} EXPORT_SYMBOL_GPL(vq_iotlb_prefetch); /* Can we log writes? */ @@ -1756,6 +1785,29 @@ static int vhost_update_used_flags(struct vhost_virtqueue *vq) return 0; } +static int vhost_update_device_flags(struct vhost_virtqueue *vq, + __virtio16 device_flags) +{ + void __user *flags; + + if (vhost_put_user(vq, cpu_to_vhost16(vq, device_flags), + &vq->device_event->desc_event_flags, + VHOST...
2018 Jul 03
0
[PATCH net-next 8/8] vhost: event suppression for packed ring
...e *vq) +{ + if (!vq->iotlb) + return 1; + + if (vhost_has_feature(vq, VIRTIO_F_RING_PACKED)) + return vq_iotlb_prefetch_packed(vq); + else + return vq_iotlb_prefetch_split(vq); +} EXPORT_SYMBOL_GPL(vq_iotlb_prefetch); /* Can we log writes? */ @@ -1771,6 +1800,50 @@ static int vhost_update_used_flags(struct vhost_virtqueue *vq) return 0; } +static int vhost_update_device_flags(struct vhost_virtqueue *vq, + __virtio16 device_flags) +{ + void __user *flags; + + if (vhost_put_user(vq, device_flags, &vq->device_event->flags, + VHOST_ADDR_USED) < 0) + return -EFAULT;...
2018 May 29
0
[RFC V5 PATCH 8/8] vhost: event suppression for packed ring
...e *vq) +{ + if (!vq->iotlb) + return 1; + + if (vhost_has_feature(vq, VIRTIO_F_RING_PACKED)) + return vq_iotlb_prefetch_packed(vq); + else + return vq_iotlb_prefetch_split(vq); +} EXPORT_SYMBOL_GPL(vq_iotlb_prefetch); /* Can we log writes? */ @@ -1730,6 +1759,50 @@ static int vhost_update_used_flags(struct vhost_virtqueue *vq) return 0; } +static int vhost_update_device_flags(struct vhost_virtqueue *vq, + __virtio16 device_flags) +{ + void __user *flags; + + if (vhost_put_user(vq, device_flags, &vq->device_event->flags, + VHOST_ADDR_USED) < 0) + return -EFAULT;...
2012 Apr 10
3
[PATCH 0/2] adding tracepoints to vhost
To help in vhost analyzing, the following series adding basic tracepoints to vhost. Operations of both virtqueues and vhost works were traced in current implementation, net code were untouched. A top-like satistics displaying script were introduced to help the troubleshooting. TODO: - net specific tracepoints? --- Jason Wang (2): vhost: basic tracepoints tools: virtio: add a
2012 Apr 10
3
[PATCH 0/2] adding tracepoints to vhost
To help in vhost analyzing, the following series adding basic tracepoints to vhost. Operations of both virtqueues and vhost works were traced in current implementation, net code were untouched. A top-like satistics displaying script were introduced to help the troubleshooting. TODO: - net specific tracepoints? --- Jason Wang (2): vhost: basic tracepoints tools: virtio: add a
2014 Jun 05
2
[PATCH 1/2] vhost: move acked_features to VQs
...IDX)) { + if (!vhost_has_feature(vq, VIRTIO_RING_F_EVENT_IDX)) { __u16 flags; if (__get_user(flags, &vq->avail->flags)) { vq_err(vq, "Failed to get flags"); @@ -1499,7 +1500,7 @@ bool vhost_enable_notify(struct vhost_dev *dev, struct vhost_virtqueue *vq) if (!(vq->used_flags & VRING_USED_F_NO_NOTIFY)) return false; vq->used_flags &= ~VRING_USED_F_NO_NOTIFY; - if (!vhost_has_feature(dev, VIRTIO_RING_F_EVENT_IDX)) { + if (!vhost_has_feature(vq, VIRTIO_RING_F_EVENT_IDX)) { r = vhost_update_used_flags(vq); if (r) { vq_err(vq, "Failed to enab...
2014 Jun 05
2
[PATCH 1/2] vhost: move acked_features to VQs
...IDX)) { + if (!vhost_has_feature(vq, VIRTIO_RING_F_EVENT_IDX)) { __u16 flags; if (__get_user(flags, &vq->avail->flags)) { vq_err(vq, "Failed to get flags"); @@ -1499,7 +1500,7 @@ bool vhost_enable_notify(struct vhost_dev *dev, struct vhost_virtqueue *vq) if (!(vq->used_flags & VRING_USED_F_NO_NOTIFY)) return false; vq->used_flags &= ~VRING_USED_F_NO_NOTIFY; - if (!vhost_has_feature(dev, VIRTIO_RING_F_EVENT_IDX)) { + if (!vhost_has_feature(vq, VIRTIO_RING_F_EVENT_IDX)) { r = vhost_update_used_flags(vq); if (r) { vq_err(vq, "Failed to enab...
2014 Aug 10
0
[PATCH] vhost: Add polling mode
...ed. > + */ > +static void vhost_vq_enable_vqpoll(struct vhost_virtqueue *vq) > +{ > + if (vq->vqpoll.enabled) > + return; /* already enabled, nothing to do */ > + if (!vq->handle_kick) > + return; /* polling will be a waste of time if no callback! */ > + if (!(vq->used_flags & VRING_USED_F_NO_NOTIFY)) { > + /* vq has guest notifications enabled. Disable them, > + and instead add vq to the polling list */ > + vhost_disable_notify(vq->dev, vq); > + list_add_tail(&vq->vqpoll.link, &vq->dev->vqpoll_list); > + } > + vq->v...
2014 Aug 20
0
[PATCH] vhost: Add polling mode
...ed. > + */ > +static void vhost_vq_enable_vqpoll(struct vhost_virtqueue *vq) > +{ > + if (vq->vqpoll.enabled) > + return; /* already enabled, nothing to do */ > + if (!vq->handle_kick) > + return; /* polling will be a waste of time if no callback! */ > + if (!(vq->used_flags & VRING_USED_F_NO_NOTIFY)) { > + /* vq has guest notifications enabled. Disable them, > + and instead add vq to the polling list */ Pls fix up multiline comment to match coding style. > + vhost_disable_notify(vq->dev, vq); > + list_add_tail(&vq->vqpoll.link, &amp...
2014 Aug 10
7
[PATCH] vhost: Add polling mode
...st_vq_enable_vqpoll() can be + * reclaimed. + */ +static void vhost_vq_enable_vqpoll(struct vhost_virtqueue *vq) +{ + if (vq->vqpoll.enabled) + return; /* already enabled, nothing to do */ + if (!vq->handle_kick) + return; /* polling will be a waste of time if no callback! */ + if (!(vq->used_flags & VRING_USED_F_NO_NOTIFY)) { + /* vq has guest notifications enabled. Disable them, + and instead add vq to the polling list */ + vhost_disable_notify(vq->dev, vq); + list_add_tail(&vq->vqpoll.link, &vq->dev->vqpoll_list); + } + vq->vqpoll.jiffies_last_kick = jiff...
2014 Aug 10
7
[PATCH] vhost: Add polling mode
...st_vq_enable_vqpoll() can be + * reclaimed. + */ +static void vhost_vq_enable_vqpoll(struct vhost_virtqueue *vq) +{ + if (vq->vqpoll.enabled) + return; /* already enabled, nothing to do */ + if (!vq->handle_kick) + return; /* polling will be a waste of time if no callback! */ + if (!(vq->used_flags & VRING_USED_F_NO_NOTIFY)) { + /* vq has guest notifications enabled. Disable them, + and instead add vq to the polling list */ + vhost_disable_notify(vq->dev, vq); + list_add_tail(&vq->vqpoll.link, &vq->dev->vqpoll_list); + } + vq->vqpoll.jiffies_last_kick = jiff...