Re: [PATCH 2/2] virtio_net: fix race in RX VQ processing

2013-07-09 Thread Asias He
On Tue, Jul 09, 2013 at 11:28:34AM +0800, Jason Wang wrote: > On 07/08/2013 05:04 PM, Michael S. Tsirkin wrote: > > virtio net called virtqueue_enable_cq on RX path after napi_complete, so > > with NAPI_STATE_SCHED clear - outside the implicit napi lock. > > This violates the requirement to

Re: [PATCH 2/2] virtio_net: fix race in RX VQ processing

2013-07-09 Thread Asias He
On Tue, Jul 09, 2013 at 11:28:34AM +0800, Jason Wang wrote: On 07/08/2013 05:04 PM, Michael S. Tsirkin wrote: virtio net called virtqueue_enable_cq on RX path after napi_complete, so with NAPI_STATE_SCHED clear - outside the implicit napi lock. This violates the requirement to synchronize

Re: [PATCH 2/2] virtio_net: fix race in RX VQ processing

2013-07-08 Thread Jason Wang
On 07/08/2013 05:04 PM, Michael S. Tsirkin wrote: > virtio net called virtqueue_enable_cq on RX path 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,

Re: [PATCH 2/2] virtio_net: fix race in RX VQ processing

2013-07-08 Thread Michael S. Tsirkin
On Mon, Jul 08, 2013 at 04:52:26PM +0400, Sergei Shtylyov wrote: > Hello. > > On 08-07-2013 13:04, Michael S. Tsirkin wrote: > > >virtio net called virtqueue_enable_cq on RX path after napi_complete, so > >with NAPI_STATE_SCHED clear - outside the implicit napi lock. > >This violates the

Re: [PATCH 2/2] virtio_net: fix race in RX VQ processing

2013-07-08 Thread Sergei Shtylyov
Hello. On 08-07-2013 13:04, Michael S. Tsirkin wrote: virtio net called virtqueue_enable_cq on RX path 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,

[PATCH 2/2] virtio_net: fix race in RX VQ processing

2013-07-08 Thread Michael S. Tsirkin
virtio net called virtqueue_enable_cq on RX path 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

[PATCH 2/2] virtio_net: fix race in RX VQ processing

2013-07-08 Thread Michael S. Tsirkin
virtio net called virtqueue_enable_cq on RX path 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

Re: [PATCH 2/2] virtio_net: fix race in RX VQ processing

2013-07-08 Thread Sergei Shtylyov
Hello. On 08-07-2013 13:04, Michael S. Tsirkin wrote: virtio net called virtqueue_enable_cq on RX path 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,

Re: [PATCH 2/2] virtio_net: fix race in RX VQ processing

2013-07-08 Thread Michael S. Tsirkin
On Mon, Jul 08, 2013 at 04:52:26PM +0400, Sergei Shtylyov wrote: Hello. On 08-07-2013 13:04, Michael S. Tsirkin wrote: virtio net called virtqueue_enable_cq on RX path after napi_complete, so with NAPI_STATE_SCHED clear - outside the implicit napi lock. This violates the requirement to

Re: [PATCH 2/2] virtio_net: fix race in RX VQ processing

2013-07-08 Thread Jason Wang
On 07/08/2013 05:04 PM, Michael S. Tsirkin wrote: virtio net called virtqueue_enable_cq on RX path 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