[dpdk-dev] [PATCH v2 3/7] vhost: refactor virtio_dev_merge_rx

Yuanhan Liu yuanhan.liu at linux.intel.com
Mon Mar 7 07:51:30 CET 2016


On Mon, Mar 07, 2016 at 06:38:42AM +0000, Xie, Huawei wrote:
> On 3/7/2016 2:35 PM, Yuanhan Liu wrote:
> > On Mon, Mar 07, 2016 at 06:22:25AM +0000, Xie, Huawei wrote:
> >> On 2/18/2016 9:48 PM, Yuanhan Liu wrote:
> >>> +	uint16_t idx = vq->avail->ring[avail_idx & (vq->size - 1)];
> >>> +	uint32_t vec_id = *vec_idx;
> >>> +	uint32_t len    = *allocated;
> >>>  
> >> There is bug not using volatile to retrieve the avail idx.
> > avail_idx? This is actually from "vq->last_used_idx_res". 
> 
> uint16_t idx = vq->avail->ring[avail_idx & (vq->size - 1)]
> 
> the idx retrieved from avail->ring. 

Hmm.. I saw quite many similar lines of code retrieving an index from
avail->ring, but none of them acutally use "volatile". So, a bug?

	--yliu


More information about the dev mailing list