diff options
author | Michael S. Tsirkin <mst@redhat.com> | 2013-07-09 06:19:18 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-07-28 19:29:55 -0400 |
commit | c23b1ece6112ed0f227fdc881db33c6427b65222 (patch) | |
tree | afe12ef05dbfdbd96e31e233ce78866d1f33081a /include | |
parent | d1a2a1a6efee375e9ac00ec0a718503fd05b4302 (diff) |
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>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/virtio.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/virtio.h b/include/linux/virtio.h index 9ff8645b7e0b..72398eea6e86 100644 --- a/include/linux/virtio.h +++ b/include/linux/virtio.h | |||
@@ -70,6 +70,10 @@ void virtqueue_disable_cb(struct virtqueue *vq); | |||
70 | 70 | ||
71 | bool virtqueue_enable_cb(struct virtqueue *vq); | 71 | bool virtqueue_enable_cb(struct virtqueue *vq); |
72 | 72 | ||
73 | unsigned virtqueue_enable_cb_prepare(struct virtqueue *vq); | ||
74 | |||
75 | bool virtqueue_poll(struct virtqueue *vq, unsigned); | ||
76 | |||
73 | bool virtqueue_enable_cb_delayed(struct virtqueue *vq); | 77 | bool virtqueue_enable_cb_delayed(struct virtqueue *vq); |
74 | 78 | ||
75 | void *virtqueue_detach_unused_buf(struct virtqueue *vq); | 79 | void *virtqueue_detach_unused_buf(struct virtqueue *vq); |