Re: [PATCH net-next 01/12] ptr_ring: keep consumer_head valid at all times

2018-01-25 Thread John Fastabend
On 01/25/2018 03:36 PM, 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 since consumer_head would

Re: [PATCH net-next 01/12] ptr_ring: keep consumer_head valid at all times

2018-01-25 Thread John Fastabend
On 01/25/2018 03:36 PM, 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 since consumer_head would

[PATCH net-next 01/12] 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 since consumer_head would sometimes point outside the ring. Refactor the code so that

[PATCH net-next 01/12] 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 since consumer_head would sometimes point outside the ring. Refactor the code so that