Re: [dpdk-dev] [PATCH v2 1/4] vhost: enforce avail index and desc read ordering

2018-12-19 Thread Maxime Coquelin
On 12/19/18 4:47 PM, Michael S. Tsirkin wrote: On Wed, Dec 19, 2018 at 09:21:10AM +0100, Maxime Coquelin wrote: A read barrier is required to ensure the ordering between available index and the descriptor reads is enforced. 1. read avail_head = avail->idx 2. read cur_idx = last_avail_idx if

Re: [dpdk-dev] [PATCH v2 1/4] vhost: enforce avail index and desc read ordering

2018-12-19 Thread Michael S. Tsirkin
On Wed, Dec 19, 2018 at 09:21:10AM +0100, Maxime Coquelin wrote: > A read barrier is required to ensure the ordering between > available index and the descriptor reads is enforced. > > 1. read avail_head = avail->idx > 2. read cur_idx = last_avail_idx > if (cur_idx != avail_head) { > 3. read i

[dpdk-dev] [PATCH v2 1/4] vhost: enforce avail index and desc read ordering

2018-12-19 Thread Maxime Coquelin
A read barrier is required to ensure the ordering between available index and the descriptor reads is enforced. 1. read avail_head = avail->idx 2. read cur_idx = last_avail_idx if (cur_idx != avail_head) { 3. read idx = avail->ring[cur_idx] 4. read desc[idx] } There is a control dependenc