virtio: support unlocked queue poll
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>
This commit is contained in:
parent
01276ed242
commit
cc229884d3
2 changed files with 55 additions and 19 deletions
|
@ -70,6 +70,10 @@ void virtqueue_disable_cb(struct virtqueue *vq);
|
|||
|
||||
bool virtqueue_enable_cb(struct virtqueue *vq);
|
||||
|
||||
unsigned virtqueue_enable_cb_prepare(struct virtqueue *vq);
|
||||
|
||||
bool virtqueue_poll(struct virtqueue *vq, unsigned);
|
||||
|
||||
bool virtqueue_enable_cb_delayed(struct virtqueue *vq);
|
||||
|
||||
void *virtqueue_detach_unused_buf(struct virtqueue *vq);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue