[dpdk-dev] [PATCH v2] virtio: fix idx in used ring retrieved only once

Yuanhan Liu yuanhan.liu at linux.intel.com
Mon Jun 20 13:46:49 CEST 2016


On Mon, Jun 20, 2016 at 01:48:52AM +0800, Huawei Xie wrote:
> In the following loop:
>     while (vq->vq_used_cons_idx != vq->vq_ring.used->idx) {
>             ...
>     }
> There is no external function call or any explict memory barrier
> in the loop, the re-read of used->idx would be optimized and would
> only be retrieved once.
> 
> use of voaltile normally should be prohibited, and access_once
> is Linux kernel's style to handle this issue; Once we have that
> macro in DPDK, we could change to that style.
> 
> virtio_recv_mergable_pkts might have the same issue, so will be fixed.
> 
> Fixes: 823ad647950a ("virtio: support multiple queues")
> Fixes: 13ce5e7eb94f ("virtio: mergeable buffers")
> 
> Signed-off-by: Huawei Xie <huawei.xie at intel.com>

Applied to dpdk-next-virtio.

Thanks.

	--yliu


More information about the dev mailing list