Displaying 20 results from an estimated 222 matches for "virtqueue_is_broken".
2013 Oct 22
9
[PATCH RFC 0/7] virtio: avoid various hang situations during hot-unplug
Hi,
this patch-set tries to solve various hang situations when virtio devices
(network or block) are hot-unplugged from a KVM guest.
On System z there exists no handshake mechanism between host and guest
when a device is hot-unplugged. The device is removed and no further I/O
is possible.
The guest is notified about the hard removal with a CRW machine check.
As per architecture, the host must
2013 Oct 22
9
[PATCH RFC 0/7] virtio: avoid various hang situations during hot-unplug
Hi,
this patch-set tries to solve various hang situations when virtio devices
(network or block) are hot-unplugged from a KVM guest.
On System z there exists no handshake mechanism between host and guest
when a device is hot-unplugged. The device is removed and no further I/O
is possible.
The guest is notified about the hard removal with a CRW machine check.
As per architecture, the host must
2023 Mar 15
2
[PATCH v2 3/3] virtio_ring: Use const to annotate read-only pointer params
...struct vring_virtqueue *vq = to_vvq(_vq);
+ const struct vring_virtqueue *vq = to_vvq(_vq);
return vq->packed_ring ? vq->packed.vring.num : vq->split.vring.num;
}
@@ -2819,9 +2819,9 @@ void __virtqueue_unbreak(struct virtqueue *_vq)
}
EXPORT_SYMBOL_GPL(__virtqueue_unbreak);
-bool virtqueue_is_broken(struct virtqueue *_vq)
+bool virtqueue_is_broken(const struct virtqueue *_vq)
{
- struct vring_virtqueue *vq = to_vvq(_vq);
+ const struct vring_virtqueue *vq = to_vvq(_vq);
return READ_ONCE(vq->broken);
}
@@ -2868,9 +2868,9 @@ void __virtio_unbreak_device(struct virtio_device *dev)
}
EX...
2013 Oct 24
12
[PATCH V2 RFC 0/9] virtio: fix hang(loop) after hot-unplug vlan
...epending on the result of the host notification operation. If the host
kick failed the current virtqueue is now flagged as 'broken'.
Patches [3,4] add code to verify host kicks by testing the return value of
virtqueue_kick() in order to avoid potential loops.
Patch [5] adds a new function virtqueue_is_broken(). This function should be
used to verify the state of a virtqueue when a previous virtqueue_get_buf()
returned a NULL pointer.
Patch [6,7,8,9] add virtqueue_is_broken() calls to handle potential errors
when a virtqueue_bet_buf() doesn't deliver any more buffers.
Heinz Graalfs (9):
virtio_...
2013 Oct 24
12
[PATCH V2 RFC 0/9] virtio: fix hang(loop) after hot-unplug vlan
...epending on the result of the host notification operation. If the host
kick failed the current virtqueue is now flagged as 'broken'.
Patches [3,4] add code to verify host kicks by testing the return value of
virtqueue_kick() in order to avoid potential loops.
Patch [5] adds a new function virtqueue_is_broken(). This function should be
used to verify the state of a virtqueue when a previous virtqueue_get_buf()
returned a NULL pointer.
Patch [6,7,8,9] add virtqueue_is_broken() calls to handle potential errors
when a virtqueue_bet_buf() doesn't deliver any more buffers.
Heinz Graalfs (9):
virtio_...
2013 Oct 22
0
[PATCH RFC 1/7] virtio_ring: add new functions virtqueue{_set_broken()/_is_broken()}
This patch adds 2 new functions:
virtqueue_set_broken(): to be called when a virtqueue kick operation fails.
virtqueue_is_broken(): can be called to query the virtqueue state after a host
was kicked.
Signed-off-by: Heinz Graalfs <graalfs at linux.vnet.ibm.com>
---
drivers/virtio/virtio_ring.c | 16 ++++++++++++++++
include/linux/virtio.h | 4 ++++
2 files changed, 20 insertions(+)
diff --git a/drivers/virtio/...
2023 Jul 20
1
[PATCH net-next v4 2/2] virtio-net: add cond_resched() to the command waiting loop
...4,10 @@ static bool virtnet_send_command(struct virtnet_info *vi, u8 class, u8 cmd,
> > * into the hypervisor, so the request should be handled immediately.
> > */
> > while (!virtqueue_get_buf(vi->cvq, &tmp) &&
> > - !virtqueue_is_broken(vi->cvq))
> > + !virtqueue_is_broken(vi->cvq)) {
> > + cond_resched();
> > cpu_relax();
> > + }
> >
> > return vi->ctrl->status == VIRTIO_NET_OK;
> > }
> > --
> > 2.39.3
&...
2023 Jul 21
1
[PATCH net-next v4 2/2] virtio-net: add cond_resched() to the command waiting loop
...bool virtnet_send_command(struct virtnet_info *vi, u8 class, u8 cmd,
>>> * into the hypervisor, so the request should be handled immediately.
>>> */
>>> while (!virtqueue_get_buf(vi->cvq, &tmp) &&
>>> - !virtqueue_is_broken(vi->cvq))
>>> + !virtqueue_is_broken(vi->cvq)) {
>>> + cond_resched();
>>> cpu_relax();
>>> + }
>>>
>>> return vi->ctrl->status == VIRTIO_NET_OK;
>>> }
>>...
2023 Jul 21
1
[PATCH net-next v4 2/2] virtio-net: add cond_resched() to the command waiting loop
...ruct virtnet_info *vi, u8 class, u8 cmd,
> > > > * into the hypervisor, so the request should be handled immediately.
> > > > */
> > > > while (!virtqueue_get_buf(vi->cvq, &tmp) &&
> > > > - !virtqueue_is_broken(vi->cvq))
> > > > + !virtqueue_is_broken(vi->cvq)) {
> > > > + cond_resched();
> > > > cpu_relax();
> > > > + }
> > > >
> > > > return vi->ctrl->status =...
2023 Mar 07
3
[PATCH 0/3] virtio_ring: Clean up code for virtio ring and pci
This patch series performs a clean up of the code in virtio_ring and
virtio_pci, modifying it to conform with the Linux kernel coding style
guidance [1]. The modifications ensure the code easy to read and
understand. This small series does few short cleanups in the code.
Patch-1 Remove unnecessary num zero check, which performs in power_of_2.
Patch-2 Avoid using inline for small functions.
2022 Dec 26
4
[PATCH 0/4] virtio-net: don't busy poll for cvq command
...vq command which turns out to have
several side effects:
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 workqueu...
2023 Jul 21
1
[PATCH net-next v4 2/2] virtio-net: add cond_resched() to the command waiting loop
...rtnet_info *vi, u8 class, u8 cmd,
>>>>> * into the hypervisor, so the request should be handled immediately.
>>>>> */
>>>>> while (!virtqueue_get_buf(vi->cvq, &tmp) &&
>>>>> - !virtqueue_is_broken(vi->cvq))
>>>>> + !virtqueue_is_broken(vi->cvq)) {
>>>>> + cond_resched();
>>>>> cpu_relax();
>>>>> + }
>>>>>
>>>>> return vi->ctrl->s...
2023 Jul 21
1
[PATCH net-next v4 2/2] virtio-net: add cond_resched() to the command waiting loop
...t; > > > > > * into the hypervisor, so the request should be handled immediately.
> > > > > > */
> > > > > > while (!virtqueue_get_buf(vi->cvq, &tmp) &&
> > > > > > - !virtqueue_is_broken(vi->cvq))
> > > > > > + !virtqueue_is_broken(vi->cvq)) {
> > > > > > + cond_resched();
> > > > > > cpu_relax();
> > > > > > + }
> > > > > >
> >...
2023 Mar 10
0
[PATCH v2 3/3] virtio_ring: Use const to annotate read-only pointer params
...struct vring_virtqueue *vq = to_vvq(_vq);
+ const struct vring_virtqueue *vq = to_vvq(_vq);
return vq->packed_ring ? vq->packed.vring.num : vq->split.vring.num;
}
@@ -2819,9 +2819,9 @@ void __virtqueue_unbreak(struct virtqueue *_vq)
}
EXPORT_SYMBOL_GPL(__virtqueue_unbreak);
-bool virtqueue_is_broken(struct virtqueue *_vq)
+bool virtqueue_is_broken(const struct virtqueue *_vq)
{
- struct vring_virtqueue *vq = to_vvq(_vq);
+ const struct vring_virtqueue *vq = to_vvq(_vq);
return READ_ONCE(vq->broken);
}
@@ -2868,9 +2868,9 @@ void __virtio_unbreak_device(struct virtio_device *dev)
}
EX...
2014 Oct 06
2
[PATCH v2 03/15] virtio-pci: move freeze/restore to virtio core
...---------------------------------------
> 3 files changed, 61 insertions(+), 53 deletions(-)
>
> diff --git a/include/linux/virtio.h b/include/linux/virtio.h
> index 3c19bd3..8df7ba8 100644
> --- a/include/linux/virtio.h
> +++ b/include/linux/virtio.h
> @@ -78,6 +78,7 @@ bool virtqueue_is_broken(struct virtqueue *vq);
> /**
> * virtio_device - representation of a device using virtio
> * @index: unique position on the virtio bus
> + * @failed: saved value for CONFIG_S_FAILED bit (for restore)
Have you considered s/failed/saved_failed/ ?
> * @dev: underlying device.
&...
2014 Oct 06
2
[PATCH v2 03/15] virtio-pci: move freeze/restore to virtio core
...---------------------------------------
> 3 files changed, 61 insertions(+), 53 deletions(-)
>
> diff --git a/include/linux/virtio.h b/include/linux/virtio.h
> index 3c19bd3..8df7ba8 100644
> --- a/include/linux/virtio.h
> +++ b/include/linux/virtio.h
> @@ -78,6 +78,7 @@ bool virtqueue_is_broken(struct virtqueue *vq);
> /**
> * virtio_device - representation of a device using virtio
> * @index: unique position on the virtio bus
> + * @failed: saved value for CONFIG_S_FAILED bit (for restore)
Have you considered s/failed/saved_failed/ ?
> * @dev: underlying device.
&...
2017 Jun 20
2
[PATCH v11 6/6] virtio-balloon: VIRTIO_BALLOON_F_CMD_VQ
...(!virtqueue_indirect_desc_table_add(vq, desc, *num)) {
> virtqueue_kick(vq);
> - wait_event(vb->acked, virtqueue_get_buf(vq, &len));
> - vb->balloon_page_chunk.chunk_num = 0;
> + if (busy_wait)
> + while (!virtqueue_get_buf(vq, &len) &&
> + !virtqueue_is_broken(vq))
> + cpu_relax();
> + else
> + wait_event(vb->acked, virtqueue_get_buf(vq, &len));
This is something I didn't previously notice.
As you always keep a single buffer in flight, you do not
really need indirect at all. Just add all descriptors
in the ring directly, then...
2017 Jun 20
2
[PATCH v11 6/6] virtio-balloon: VIRTIO_BALLOON_F_CMD_VQ
...(!virtqueue_indirect_desc_table_add(vq, desc, *num)) {
> virtqueue_kick(vq);
> - wait_event(vb->acked, virtqueue_get_buf(vq, &len));
> - vb->balloon_page_chunk.chunk_num = 0;
> + if (busy_wait)
> + while (!virtqueue_get_buf(vq, &len) &&
> + !virtqueue_is_broken(vq))
> + cpu_relax();
> + else
> + wait_event(vb->acked, virtqueue_get_buf(vq, &len));
This is something I didn't previously notice.
As you always keep a single buffer in flight, you do not
really need indirect at all. Just add all descriptors
in the ring directly, then...
2023 May 24
2
[PATCH V3 net-next 0/2] virtio-net: don't busy poll for cvq command
...Please review.
Thanks
Changes since V2:
- Don'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 work...
2014 Oct 13
1
[PATCH v4 04/25] virtio: defer config changed notifications
...vers/virtio/virtio.c | 57 +++++++++++++++++++++++++++++++++++++++++--------
2 files changed, 54 insertions(+), 9 deletions(-)
diff --git a/include/linux/virtio.h b/include/linux/virtio.h
index 8df7ba8..5636b11 100644
--- a/include/linux/virtio.h
+++ b/include/linux/virtio.h
@@ -79,6 +79,9 @@ bool virtqueue_is_broken(struct virtqueue *vq);
* virtio_device - representation of a device using virtio
* @index: unique position on the virtio bus
* @failed: saved value for CONFIG_S_FAILED bit (for restore)
+ * @config_enabled: configuration change reporting enabled
+ * @config_changed: configuration change repor...