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

Yuanhan Liu yuanhan.liu at linux.intel.com
Mon Mar 7 09:20:18 CET 2016


On Mon, Mar 07, 2016 at 07:16:39AM +0000, Xie, Huawei wrote:
> On 3/7/2016 3:04 PM, Xie, Huawei wrote:
> > On 3/7/2016 2:49 PM, Yuanhan Liu wrote:
> >> 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?
> > Others are not. This function is inline, and is in one translation unit
> > with its caller.
> 
> Oh, my fault. For the avail idx, we should take care on whether using
> volatile.

I will keep it as it is. If there are any issues with it, let's fix it
in another patch, but not in this refactor patch.

	--yliu



More information about the dev mailing list