Re: [PATCH net] ptr_ring: keep consumer_head valid at all times

2018-01-25 Thread Michael S. Tsirkin
On Thu, Jan 25, 2018 at 05:04:46PM +0200, Michael S. Tsirkin wrote: > The comment near __ptr_ring_peek says: > > * If ring is never resized, and if the pointer is merely > * tested, there's no need to take the lock - see e.g. __ptr_ring_empty. > > but this was in fact never possible as index g

[PATCH net] ptr_ring: keep consumer_head valid at all times

2018-01-25 Thread Michael S. Tsirkin
The comment near __ptr_ring_peek says: * If ring is never resized, and if the pointer is merely * tested, there's no need to take the lock - see e.g. __ptr_ring_empty. but this was in fact never possible as index gets out of range temporarily. We tried to allocate one more entry for lockless