Displaying 20 results from an estimated 142 matches for "virtqueue_pol".
Did you mean:
virtqueue_poll
2013 Jul 08
3
[PATCH 1/2] virtio: support unlocked queue poll
...s "false" if there are pending
- * buffers in the queue, to detect a possible race between the driver
- * checking for more work, and enabling callbacks.
+ * This re-enables callbacks; it returns current queue state
+ * in an opaque unsigned value. This value should be later tested by
+ * virtqueue_poll, to detect a possible race between the driver checking for
+ * more work, and enabling callbacks.
*
* Caller must ensure we don't call this with other virtqueue
* operations at the same time (except where noted).
*/
-bool virtqueue_enable_cb(struct virtqueue *_vq)
+unsigned virtqueue_e...
2013 Jul 08
3
[PATCH 1/2] virtio: support unlocked queue poll
...s "false" if there are pending
- * buffers in the queue, to detect a possible race between the driver
- * checking for more work, and enabling callbacks.
+ * This re-enables callbacks; it returns current queue state
+ * in an opaque unsigned value. This value should be later tested by
+ * virtqueue_poll, to detect a possible race between the driver checking for
+ * more work, and enabling callbacks.
*
* Caller must ensure we don't call this with other virtqueue
* operations at the same time (except where noted).
*/
-bool virtqueue_enable_cb(struct virtqueue *_vq)
+unsigned virtqueue_e...
2020 Aug 04
0
[PATCH -next v3] virtio_ring: Avoid loop when vq is broken in virtqueue_poll
...net_poll will reschedule napi to
> receive packet, it will lead cpu usage(si) to 100%.
>
> call trace as below:
> virtnet_poll
> virtnet_receive
> virtqueue_get_buf_ctx
> virtqueue_get_buf_ctx_packed
> virtqueue_get_buf_ctx_split
> virtqueue_napi_complete
> virtqueue_poll //return true
> virtqueue_napi_schedule //it will reschedule napi
>
> to fix this, return false if vq is broken in virtqueue_poll.
>
> Signed-off-by: Mao Wenan <wenan.mao at linux.alibaba.com>
> Acked-by: Michael S. Tsirkin <mst at redhat.com>
> ---
>...
2020 Aug 20
0
[PATCH AUTOSEL 5.8 21/27] virtio_ring: Avoid loop when vq is broken in virtqueue_poll
...queue_get_buf_ctx_split
will return NULL, so virtnet_poll will reschedule napi to
receive packet, it will lead cpu usage(si) to 100%.
call trace as below:
virtnet_poll
virtnet_receive
virtqueue_get_buf_ctx
virtqueue_get_buf_ctx_packed
virtqueue_get_buf_ctx_split
virtqueue_napi_complete
virtqueue_poll //return true
virtqueue_napi_schedule //it will reschedule napi
to fix this, return false if vq is broken in virtqueue_poll.
Signed-off-by: Mao Wenan <wenan.mao at linux.alibaba.com>
Acked-by: Michael S. Tsirkin <mst at redhat.com>
Link: https://lore.kernel.org/r/15963542...
2020 Aug 20
0
[PATCH AUTOSEL 5.7 19/24] virtio_ring: Avoid loop when vq is broken in virtqueue_poll
...queue_get_buf_ctx_split
will return NULL, so virtnet_poll will reschedule napi to
receive packet, it will lead cpu usage(si) to 100%.
call trace as below:
virtnet_poll
virtnet_receive
virtqueue_get_buf_ctx
virtqueue_get_buf_ctx_packed
virtqueue_get_buf_ctx_split
virtqueue_napi_complete
virtqueue_poll //return true
virtqueue_napi_schedule //it will reschedule napi
to fix this, return false if vq is broken in virtqueue_poll.
Signed-off-by: Mao Wenan <wenan.mao at linux.alibaba.com>
Acked-by: Michael S. Tsirkin <mst at redhat.com>
Link: https://lore.kernel.org/r/15963542...
2020 Aug 20
0
[PATCH AUTOSEL 5.4 17/22] virtio_ring: Avoid loop when vq is broken in virtqueue_poll
...queue_get_buf_ctx_split
will return NULL, so virtnet_poll will reschedule napi to
receive packet, it will lead cpu usage(si) to 100%.
call trace as below:
virtnet_poll
virtnet_receive
virtqueue_get_buf_ctx
virtqueue_get_buf_ctx_packed
virtqueue_get_buf_ctx_split
virtqueue_napi_complete
virtqueue_poll //return true
virtqueue_napi_schedule //it will reschedule napi
to fix this, return false if vq is broken in virtqueue_poll.
Signed-off-by: Mao Wenan <wenan.mao at linux.alibaba.com>
Acked-by: Michael S. Tsirkin <mst at redhat.com>
Link: https://lore.kernel.org/r/15963542...
2020 Aug 20
0
[PATCH AUTOSEL 4.19 14/18] virtio_ring: Avoid loop when vq is broken in virtqueue_poll
...queue_get_buf_ctx_split
will return NULL, so virtnet_poll will reschedule napi to
receive packet, it will lead cpu usage(si) to 100%.
call trace as below:
virtnet_poll
virtnet_receive
virtqueue_get_buf_ctx
virtqueue_get_buf_ctx_packed
virtqueue_get_buf_ctx_split
virtqueue_napi_complete
virtqueue_poll //return true
virtqueue_napi_schedule //it will reschedule napi
to fix this, return false if vq is broken in virtqueue_poll.
Signed-off-by: Mao Wenan <wenan.mao at linux.alibaba.com>
Acked-by: Michael S. Tsirkin <mst at redhat.com>
Link: https://lore.kernel.org/r/15963542...
2020 Aug 20
0
[PATCH AUTOSEL 4.14 11/13] virtio_ring: Avoid loop when vq is broken in virtqueue_poll
...queue_get_buf_ctx_split
will return NULL, so virtnet_poll will reschedule napi to
receive packet, it will lead cpu usage(si) to 100%.
call trace as below:
virtnet_poll
virtnet_receive
virtqueue_get_buf_ctx
virtqueue_get_buf_ctx_packed
virtqueue_get_buf_ctx_split
virtqueue_napi_complete
virtqueue_poll //return true
virtqueue_napi_schedule //it will reschedule napi
to fix this, return false if vq is broken in virtqueue_poll.
Signed-off-by: Mao Wenan <wenan.mao at linux.alibaba.com>
Acked-by: Michael S. Tsirkin <mst at redhat.com>
Link: https://lore.kernel.org/r/15963542...
2020 Aug 20
0
[PATCH AUTOSEL 4.9 09/11] virtio_ring: Avoid loop when vq is broken in virtqueue_poll
...queue_get_buf_ctx_split
will return NULL, so virtnet_poll will reschedule napi to
receive packet, it will lead cpu usage(si) to 100%.
call trace as below:
virtnet_poll
virtnet_receive
virtqueue_get_buf_ctx
virtqueue_get_buf_ctx_packed
virtqueue_get_buf_ctx_split
virtqueue_napi_complete
virtqueue_poll //return true
virtqueue_napi_schedule //it will reschedule napi
to fix this, return false if vq is broken in virtqueue_poll.
Signed-off-by: Mao Wenan <wenan.mao at linux.alibaba.com>
Acked-by: Michael S. Tsirkin <mst at redhat.com>
Link: https://lore.kernel.org/r/15963542...
2020 Aug 20
0
[PATCH AUTOSEL 4.4 08/10] virtio_ring: Avoid loop when vq is broken in virtqueue_poll
...queue_get_buf_ctx_split
will return NULL, so virtnet_poll will reschedule napi to
receive packet, it will lead cpu usage(si) to 100%.
call trace as below:
virtnet_poll
virtnet_receive
virtqueue_get_buf_ctx
virtqueue_get_buf_ctx_packed
virtqueue_get_buf_ctx_split
virtqueue_napi_complete
virtqueue_poll //return true
virtqueue_napi_schedule //it will reschedule napi
to fix this, return false if vq is broken in virtqueue_poll.
Signed-off-by: Mao Wenan <wenan.mao at linux.alibaba.com>
Acked-by: Michael S. Tsirkin <mst at redhat.com>
Link: https://lore.kernel.org/r/15963542...
2013 Jul 09
0
[PATCH v2 1/2] virtio: support unlocked queue poll
...s "false" if there are pending
- * buffers in the queue, to detect a possible race between the driver
- * checking for more work, and enabling callbacks.
+ * This re-enables callbacks; it returns current queue state
+ * in an opaque unsigned value. This value should be later tested by
+ * virtqueue_poll, to detect a possible race between the driver checking for
+ * more work, and enabling callbacks.
*
* Caller must ensure we don't call this with other virtqueue
* operations at the same time (except where noted).
*/
-bool virtqueue_enable_cb(struct virtqueue *_vq)
+unsigned virtqueue_e...
2013 Jul 09
0
[PATCH v2 1/2] virtio: support unlocked queue poll
...s "false" if there are pending
- * buffers in the queue, to detect a possible race between the driver
- * checking for more work, and enabling callbacks.
+ * This re-enables callbacks; it returns current queue state
+ * in an opaque unsigned value. This value should be later tested by
+ * virtqueue_poll, to detect a possible race between the driver checking for
+ * more work, and enabling callbacks.
*
* Caller must ensure we don't call this with other virtqueue
* operations at the same time (except where noted).
*/
-bool virtqueue_enable_cb(struct virtqueue *_vq)
+unsigned virtqueue_e...
2013 Jul 08
4
[PATCH 2/2] virtio_net: fix race in RX VQ processing
...o_mb().
However, we must call napi_complete to clear NAPI_STATE_SCHED before
polling the virtqueue for used buffers, otherwise napi_schedule_prep in
a callback will fail, causing us to lose RX events.
To fix, call virtqueue_enable_cb_prepare with NAPI_STATE_SCHED
set (under napi lock), later call virtqueue_poll with
NAPI_STATE_SCHED clear (outside the lock).
Reported-by: Jason Wang <jasowang at redhat.com>
Signed-off-by: Michael S. Tsirkin <mst at redhat.com>
---
drivers/net/virtio_net.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/virtio_net.c b/drivers...
2013 Jul 08
4
[PATCH 2/2] virtio_net: fix race in RX VQ processing
...o_mb().
However, we must call napi_complete to clear NAPI_STATE_SCHED before
polling the virtqueue for used buffers, otherwise napi_schedule_prep in
a callback will fail, causing us to lose RX events.
To fix, call virtqueue_enable_cb_prepare with NAPI_STATE_SCHED
set (under napi lock), later call virtqueue_poll with
NAPI_STATE_SCHED clear (outside the lock).
Reported-by: Jason Wang <jasowang at redhat.com>
Signed-off-by: Michael S. Tsirkin <mst at redhat.com>
---
drivers/net/virtio_net.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/virtio_net.c b/drivers...
2013 Jul 27
1
Merge of "virtio_net: fix race in RX VQ processing" for linux-3.2.48
On Fri, 2013-07-12 at 23:13 +0200, Wolfram Gloger wrote:
> Hi,
>
> Today I merged M. Tsirkin's patch v2 "virtio_net: fix race in RX VQ
> processing":
>
> http://lkml.indiana.edu/hypermail/linux/kernel/1307.1/00503.html
>
> into 3.2.48 and lightly tested the result (vhost-net, virtio-disk
> and 9pfs using virtio).
This sounds like it could be suitable
2013 Jul 27
1
Merge of "virtio_net: fix race in RX VQ processing" for linux-3.2.48
On Fri, 2013-07-12 at 23:13 +0200, Wolfram Gloger wrote:
> Hi,
>
> Today I merged M. Tsirkin's patch v2 "virtio_net: fix race in RX VQ
> processing":
>
> http://lkml.indiana.edu/hypermail/linux/kernel/1307.1/00503.html
>
> into 3.2.48 and lightly tested the result (vhost-net, virtio-disk
> and 9pfs using virtio).
This sounds like it could be suitable
2020 Aug 02
0
[PATCH -next v2] virtio_net: Avoid loop in virtnet_poll
...et_poll will reschedule napi to
> receive packet, it will lead cpu usage(si) to 100%.
>
> call trace as below:
> virtnet_poll
> virtnet_receive
> virtqueue_get_buf_ctx
> virtqueue_get_buf_ctx_packed
> virtqueue_get_buf_ctx_split
> virtqueue_napi_complete
> virtqueue_poll //return true
> virtqueue_napi_schedule //it will reschedule napi
>
> To fix this, return false if vq is broken in virtqueue_poll.
>
> Signed-off-by: Mao Wenan <wenan.mao at linux.alibaba.com>
Looks good:
Acked-by: Michael S. Tsirkin <mst at redhat.com>
&...
2020 Aug 02
0
[PATCH -next v2] virtio_net: Avoid loop in virtnet_poll
...et_poll will reschedule napi to
> receive packet, it will lead cpu usage(si) to 100%.
>
> call trace as below:
> virtnet_poll
> virtnet_receive
> virtqueue_get_buf_ctx
> virtqueue_get_buf_ctx_packed
> virtqueue_get_buf_ctx_split
> virtqueue_napi_complete
> virtqueue_poll //return true
> virtqueue_napi_schedule //it will reschedule napi
>
> To fix this, return false if vq is broken in virtqueue_poll.
>
> Signed-off-by: Mao Wenan <wenan.mao at linux.alibaba.com>
> ---
> v1->v2: fix it in virtqueue_poll suggested by Michae...
2017 Dec 07
2
[PATCH net-next] virtio_net: Disable interrupts if napi_complete_done rescheduled napi
...ex 19a985e..c0db48d 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -261,9 +261,12 @@ static void virtqueue_napi_complete(struct napi_struct *napi,
int opaque;
opaque = virtqueue_enable_cb_prepare(vq);
- if (napi_complete_done(napi, processed) &&
- unlikely(virtqueue_poll(vq, opaque)))
- virtqueue_napi_schedule(napi, vq);
+ if (napi_complete_done(napi, processed)) {
+ if (unlikely(virtqueue_poll(vq, opaque)))
+ virtqueue_napi_schedule(napi, vq);
+ } else {
+ virtqueue_disable_cb(vq);
+ }
}
static void skb_xmit_done(struct virtqueue *vq)
--
1.8.3.1
2017 Dec 07
2
[PATCH net-next] virtio_net: Disable interrupts if napi_complete_done rescheduled napi
...ex 19a985e..c0db48d 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -261,9 +261,12 @@ static void virtqueue_napi_complete(struct napi_struct *napi,
int opaque;
opaque = virtqueue_enable_cb_prepare(vq);
- if (napi_complete_done(napi, processed) &&
- unlikely(virtqueue_poll(vq, opaque)))
- virtqueue_napi_schedule(napi, vq);
+ if (napi_complete_done(napi, processed)) {
+ if (unlikely(virtqueue_poll(vq, opaque)))
+ virtqueue_napi_schedule(napi, vq);
+ } else {
+ virtqueue_disable_cb(vq);
+ }
}
static void skb_xmit_done(struct virtqueue *vq)
--
1.8.3.1