search for: start_us

Displaying 20 results from an estimated 292 matches for "start_us".

Did you mean: start_use
2015 Feb 06
1
[PATCH] virtio: Avoid possible kernel panic if DEBUG is enabled.
>From 11fd997d724f520ca628615e7ffbfd7901c40b62 Mon Sep 17 00:00:00 2001 From: Tetsuo Handa <penguin-kernel at I-love.SAKURA.ne.jp> Date: Fri, 6 Feb 2015 13:28:38 +0900 Subject: [PATCH] virtio: Avoid possible kernel panic if DEBUG is enabled. The virtqueue_add() calls START_USE() upon entry. The virtqueue_kick() is called if vq->num_added == (1 << 16) - 1 before calling END_USE(). The virtqueue_kick_prepare() called via virtqueue_kick() calls START_USE() upon entry, and will call panic() if DEBUG is enabled. Move this virtqueue_kick() call to after END_USE() cal...
2015 Feb 06
1
[PATCH] virtio: Avoid possible kernel panic if DEBUG is enabled.
>From 11fd997d724f520ca628615e7ffbfd7901c40b62 Mon Sep 17 00:00:00 2001 From: Tetsuo Handa <penguin-kernel at I-love.SAKURA.ne.jp> Date: Fri, 6 Feb 2015 13:28:38 +0900 Subject: [PATCH] virtio: Avoid possible kernel panic if DEBUG is enabled. The virtqueue_add() calls START_USE() upon entry. The virtqueue_kick() is called if vq->num_added == (1 << 16) - 1 before calling END_USE(). The virtqueue_kick_prepare() called via virtqueue_kick() calls START_USE() upon entry, and will call panic() if DEBUG is enabled. Move this virtqueue_kick() call to after END_USE() cal...
2018 May 16
2
[RFC v4 4/5] virtio_ring: add event idx support in packed ring
...needs_kick; > } > @@ -1098,7 +1111,7 @@ static void *virtqueue_get_buf_ctx_packed(struct virtqueue *_vq, > void **ctx) > { > struct vring_virtqueue *vq = to_vvq(_vq); > - u16 last_used, id; > + u16 wrap_counter, last_used, id; > void *ret; > > START_USE(vq); > @@ -1138,6 +1151,19 @@ static void *virtqueue_get_buf_ctx_packed(struct virtqueue *_vq, > ret = vq->desc_state[id].data; > detach_buf_packed(vq, last_used, id, ctx); > > + wrap_counter = vq->wrap_counter; > + if (vq->last_used_idx > vq->next_avail_i...
2018 May 16
2
[RFC v4 4/5] virtio_ring: add event idx support in packed ring
...needs_kick; > } > @@ -1098,7 +1111,7 @@ static void *virtqueue_get_buf_ctx_packed(struct virtqueue *_vq, > void **ctx) > { > struct vring_virtqueue *vq = to_vvq(_vq); > - u16 last_used, id; > + u16 wrap_counter, last_used, id; > void *ret; > > START_USE(vq); > @@ -1138,6 +1151,19 @@ static void *virtqueue_get_buf_ctx_packed(struct virtqueue *_vq, > ret = vq->desc_state[id].data; > detach_buf_packed(vq, last_used, id, ctx); > > + wrap_counter = vq->wrap_counter; > + if (vq->last_used_idx > vq->next_avail_i...
2018 May 16
8
[RFC v4 0/5] virtio: support packed ring
Hello everyone, This RFC implements packed ring support in virtio driver. Some simple functional tests have been done with Jason's packed ring implementation in vhost: https://lkml.org/lkml/2018/4/23/12 Both of ping and netperf worked as expected (with EVENT_IDX disabled). TODO: - Refinements (for code and commit log); - More tests; - Bug fixes; RFC v3 -> RFC v4: - Make ID allocation
2018 May 22
9
[RFC v5 0/5] virtio: support packed ring
Hello everyone, This RFC implements packed ring support in virtio driver. Some simple functional tests have been done with Jason's packed ring implementation in vhost (RFC v4): https://lkml.org/lkml/2018/5/16/501 Both of ping and netperf worked as expected w/ EVENT_IDX disabled. Ping worked as expected w/ EVENT_IDX enabled, but netperf didn't (A hack has been added in the driver to
2018 May 22
9
[RFC v5 0/5] virtio: support packed ring
Hello everyone, This RFC implements packed ring support in virtio driver. Some simple functional tests have been done with Jason's packed ring implementation in vhost (RFC v4): https://lkml.org/lkml/2018/5/16/501 Both of ping and netperf worked as expected w/ EVENT_IDX disabled. Ping worked as expected w/ EVENT_IDX enabled, but netperf didn't (A hack has been added in the driver to
2018 Apr 25
0
[RFC v3 3/5] virtio_ring: add packed ring support
...ctx, gfp_t gfp) { + struct vring_virtqueue *vq = to_vvq(_vq); + struct vring_packed_desc *desc; + struct scatterlist *sg; + unsigned int i, n, descs_used, uninitialized_var(prev), err_idx; + __virtio16 uninitialized_var(head_flags), flags; + int head, wrap_counter; + bool indirect; + + START_USE(vq); + + BUG_ON(data == NULL); + BUG_ON(ctx && vq->indirect); + + if (unlikely(vq->broken)) { + END_USE(vq); + return -EIO; + } + +#ifdef DEBUG + { + ktime_t now = ktime_get(); + + /* No kick or get, with .1 second between? Warn. */ + if (vq->last_add_time_valid) + WARN_ON...
2008 Apr 07
1
[PATCH] virtio: remove overzealous BUG_ON.
...back is designed as an optimization to tell the host we don't need callbacks now. As it is not reliable, the debug check is overzealous: it can happen on two CPUs at the same time. Document this. Even if it were reliable, the virtio_net driver doesn't disable callbacks on transmit so the START_USE/END_USE debugging reentrance protection can be easily tripped even on UP. Thanks to Balaji Rao for the bug report and testing. Signed-off-by: Rusty Russell <rusty at rustcorp.com.au> CC: Balaji Rao <balajirrao at gmail.com> diff -r 0b3e64be7696 drivers/virtio/virtio_ring.c --- a/dri...
2008 Apr 07
1
[PATCH] virtio: remove overzealous BUG_ON.
...back is designed as an optimization to tell the host we don't need callbacks now. As it is not reliable, the debug check is overzealous: it can happen on two CPUs at the same time. Document this. Even if it were reliable, the virtio_net driver doesn't disable callbacks on transmit so the START_USE/END_USE debugging reentrance protection can be easily tripped even on UP. Thanks to Balaji Rao for the bug report and testing. Signed-off-by: Rusty Russell <rusty at rustcorp.com.au> CC: Balaji Rao <balajirrao at gmail.com> diff -r 0b3e64be7696 drivers/virtio/virtio_ring.c --- a/dri...
2013 Jul 08
4
[PATCH 2/2] virtio_net: fix race in RX VQ processing
...after napi_complete, so with NAPI_STATE_SCHED clear - outside the implicit napi lock. This violates the requirement to synchronize virtqueue_enable_cq wrt virtqueue_add_buf. In particular, used event can move backwards, causing us to lose interrupts. In a debug build, this can trigger panic within START_USE. Jason Wang reports that he can trigger the races artificially, by adding udelay() in virtqueue_enable_cb() after virtio_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, causin...
2013 Jul 08
4
[PATCH 2/2] virtio_net: fix race in RX VQ processing
...after napi_complete, so with NAPI_STATE_SCHED clear - outside the implicit napi lock. This violates the requirement to synchronize virtqueue_enable_cq wrt virtqueue_add_buf. In particular, used event can move backwards, causing us to lose interrupts. In a debug build, this can trigger panic within START_USE. Jason Wang reports that he can trigger the races artificially, by adding udelay() in virtqueue_enable_cb() after virtio_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, causin...
2018 May 22
0
[RFC v5 3/5] virtio_ring: add packed ring support
...gfp_t gfp) { + struct vring_virtqueue *vq = to_vvq(_vq); + struct vring_packed_desc *desc; + struct scatterlist *sg; + unsigned int i, n, descs_used, uninitialized_var(prev), err_idx; + __virtio16 uninitialized_var(head_flags), flags; + u16 head, avail_wrap_counter, id, cur; + bool indirect; + + START_USE(vq); + + BUG_ON(data == NULL); + BUG_ON(ctx && vq->indirect); + + if (unlikely(vq->broken)) { + END_USE(vq); + return -EIO; + } + +#ifdef DEBUG + { + ktime_t now = ktime_get(); + + /* No kick or get, with .1 second between? Warn. */ + if (vq->last_add_time_valid) + WARN_ON...
2017 Oct 09
2
[PATCH] daemon: proto: Remove pervasive but useless debugging messages.
If you spend your time looking at libguestfs debugging output you'll see many messages from the daemon main loop like this: guestfsd: main_loop: new request, len 0x54 guestfsd: main_loop: proc 278 (mkfs) took 0.02 seconds I don't think these messages really bring much value. This commit removes them entirely. An alternative might be to change them to make them shorter and/or less
2018 Jul 11
15
[PATCH net-next v2 0/5] virtio: support packed ring
Hello everyone, This patch set implements packed ring support in virtio driver. Some functional tests have been done with Jason's packed ring implementation in vhost: https://lkml.org/lkml/2018/7/3/33 Both of ping and netperf worked as expected. v1 -> v2: - Use READ_ONCE() to read event off_wrap and flags together (Jason); - Add comments related to ccw (Jason); RFC (v6) -> v1: -
2018 Jul 11
15
[PATCH net-next v2 0/5] virtio: support packed ring
Hello everyone, This patch set implements packed ring support in virtio driver. Some functional tests have been done with Jason's packed ring implementation in vhost: https://lkml.org/lkml/2018/7/3/33 Both of ping and netperf worked as expected. v1 -> v2: - Use READ_ONCE() to read event off_wrap and flags together (Jason); - Add comments related to ccw (Jason); RFC (v6) -> v1: -
2018 Jul 11
0
[PATCH net-next v2 3/5] virtio_ring: add packed ring support
...gfp_t gfp) { + struct vring_virtqueue *vq = to_vvq(_vq); + struct vring_packed_desc *desc; + struct scatterlist *sg; + unsigned int i, n, descs_used, uninitialized_var(prev), err_idx; + __virtio16 uninitialized_var(head_flags), flags; + u16 head, avail_wrap_counter, id, curr; + bool indirect; + + START_USE(vq); + + BUG_ON(data == NULL); + BUG_ON(ctx && vq->indirect); + + if (unlikely(vq->broken)) { + END_USE(vq); + return -EIO; + } + +#ifdef DEBUG + { + ktime_t now = ktime_get(); + + /* No kick or get, with .1 second between? Warn. */ + if (vq->last_add_time_valid) + WARN_ON...
2018 Apr 01
8
[RFC v2] virtio: support packed ring
...ctx, + gfp_t gfp) +{ + struct vring_virtqueue *vq = to_vvq(_vq); + struct vring_packed_desc *desc; + struct scatterlist *sg; + unsigned int i, n, descs_used, uninitialized_var(prev), err_idx; + __virtio16 uninitialized_var(head_flags), flags; + int head, wrap_counter; + bool indirect; + + START_USE(vq); + + BUG_ON(data == NULL); + BUG_ON(ctx && vq->indirect); + + if (unlikely(vq->broken)) { + END_USE(vq); + return -EIO; + } + +#ifdef DEBUG + { + ktime_t now = ktime_get(); + + /* No kick or get, with .1 second between? Warn. */ + if (vq->last_add_time_valid) + WARN_ON...
2018 Apr 01
8
[RFC v2] virtio: support packed ring
...ctx, + gfp_t gfp) +{ + struct vring_virtqueue *vq = to_vvq(_vq); + struct vring_packed_desc *desc; + struct scatterlist *sg; + unsigned int i, n, descs_used, uninitialized_var(prev), err_idx; + __virtio16 uninitialized_var(head_flags), flags; + int head, wrap_counter; + bool indirect; + + START_USE(vq); + + BUG_ON(data == NULL); + BUG_ON(ctx && vq->indirect); + + if (unlikely(vq->broken)) { + END_USE(vq); + return -EIO; + } + +#ifdef DEBUG + { + ktime_t now = ktime_get(); + + /* No kick or get, with .1 second between? Warn. */ + if (vq->last_add_time_valid) + WARN_ON...
2018 May 29
2
[RFC v5 3/5] virtio_ring: add packed ring support
...*vq = to_vvq(_vq); > + struct vring_packed_desc *desc; > + struct scatterlist *sg; > + unsigned int i, n, descs_used, uninitialized_var(prev), err_idx; > + __virtio16 uninitialized_var(head_flags), flags; > + u16 head, avail_wrap_counter, id, cur; > + bool indirect; > + > + START_USE(vq); > + > + BUG_ON(data == NULL); > + BUG_ON(ctx && vq->indirect); > + > + if (unlikely(vq->broken)) { > + END_USE(vq); > + return -EIO; > + } > + > +#ifdef DEBUG > + { > + ktime_t now = ktime_get(); > + > + /* No kick or get, with .1 se...