virtio: support unlocked queue poll
authorMichael S. Tsirkin <mst@redhat.com>
Tue, 9 Jul 2013 10:19:18 +0000 (13:19 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 28 Jul 2013 23:29:55 +0000 (16:29 -0700)
commitc23b1ece6112ed0f227fdc881db33c6427b65222
treeafe12ef05dbfdbd96e31e233ce78866d1f33081a
parentd1a2a1a6efee375e9ac00ec0a718503fd05b4302
virtio: support unlocked queue poll

[ Upstream commit cc229884d3f77ec3b1240e467e0236c3e0647c0c ]

This adds a way to check ring empty state after enable_cb outside any
locks. Will be used by virtio_net.

Note: there's room for more optimization: caller is likely to have a
memory barrier already, which means we might be able to get rid of a
barrier here.  Deferring this optimization until we do some
benchmarking.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/virtio/virtio_ring.c
include/linux/virtio.h