virtio: use weaker barriers
authorStephen Hemminger <stephen@networkplumber.org>
Mon, 9 Feb 2015 01:13:51 +0000 (09:13 +0800)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Fri, 20 Feb 2015 18:18:26 +0000 (19:18 +0100)
commitfaf79b7854e82c9312b1e1192b64efae46d2b5f8
tree4bca4eb2e897a7c07371f6eeb05230b337fabfdf
parentdec08c28c0b30a6167df6895084fa1f7c6aa2505
virtio: use weaker barriers

The DPDK driver only has to deal with the case of running on PCI
and with SMP. In this case, the code can use the weaker barriers
instead of using hard (fence) barriers. This will help performance.
The rationale is explained in Linux kernel virtio_ring.h.

To make it clearer that this is a virtio thing and not some generic
barrier, prefix the barrier calls with virtio_.

Add missing (and needed) barrier between updating ring data
structure and notifying host.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Changchun Ouyang <changchun.ouyang@intel.com>
Acked-by: Huawei Xie <huawei.xie@intel.com>
lib/librte_pmd_virtio/virtio_ethdev.c
lib/librte_pmd_virtio/virtio_rxtx.c
lib/librte_pmd_virtio/virtqueue.h