aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/vhost/vhost.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/vhost/vhost.h')
-rw-r--r--drivers/vhost/vhost.h11
1 files changed, 3 insertions, 8 deletions
diff --git a/drivers/vhost/vhost.h b/drivers/vhost/vhost.h
index 1125af3d27d1..5e19e3d5db8c 100644
--- a/drivers/vhost/vhost.h
+++ b/drivers/vhost/vhost.h
@@ -7,17 +7,11 @@
7#include <linux/mutex.h> 7#include <linux/mutex.h>
8#include <linux/poll.h> 8#include <linux/poll.h>
9#include <linux/file.h> 9#include <linux/file.h>
10#include <linux/skbuff.h>
11#include <linux/uio.h> 10#include <linux/uio.h>
12#include <linux/virtio_config.h> 11#include <linux/virtio_config.h>
13#include <linux/virtio_ring.h> 12#include <linux/virtio_ring.h>
14#include <linux/atomic.h> 13#include <linux/atomic.h>
15 14
16/* This is for zerocopy, used buffer len is set to 1 when lower device DMA
17 * done */
18#define VHOST_DMA_DONE_LEN 1
19#define VHOST_DMA_CLEAR_LEN 0
20
21struct vhost_device; 15struct vhost_device;
22 16
23struct vhost_work; 17struct vhost_work;
@@ -70,6 +64,8 @@ struct vhost_ubuf_ref *vhost_ubuf_alloc(struct vhost_virtqueue *, bool zcopy);
70void vhost_ubuf_put(struct vhost_ubuf_ref *); 64void vhost_ubuf_put(struct vhost_ubuf_ref *);
71void vhost_ubuf_put_and_wait(struct vhost_ubuf_ref *); 65void vhost_ubuf_put_and_wait(struct vhost_ubuf_ref *);
72 66
67struct ubuf_info;
68
73/* The virtqueue structure describes a queue attached to a device. */ 69/* The virtqueue structure describes a queue attached to a device. */
74struct vhost_virtqueue { 70struct vhost_virtqueue {
75 struct vhost_dev *dev; 71 struct vhost_dev *dev;
@@ -167,6 +163,7 @@ long vhost_dev_init(struct vhost_dev *, struct vhost_virtqueue *vqs, int nvqs);
167long vhost_dev_check_owner(struct vhost_dev *); 163long vhost_dev_check_owner(struct vhost_dev *);
168long vhost_dev_reset_owner(struct vhost_dev *); 164long vhost_dev_reset_owner(struct vhost_dev *);
169void vhost_dev_cleanup(struct vhost_dev *, bool locked); 165void vhost_dev_cleanup(struct vhost_dev *, bool locked);
166void vhost_dev_stop(struct vhost_dev *);
170long vhost_dev_ioctl(struct vhost_dev *, unsigned int ioctl, unsigned long arg); 167long vhost_dev_ioctl(struct vhost_dev *, unsigned int ioctl, unsigned long arg);
171int vhost_vq_access_ok(struct vhost_virtqueue *vq); 168int vhost_vq_access_ok(struct vhost_virtqueue *vq);
172int vhost_log_access_ok(struct vhost_dev *); 169int vhost_log_access_ok(struct vhost_dev *);
@@ -191,8 +188,6 @@ bool vhost_enable_notify(struct vhost_dev *, struct vhost_virtqueue *);
191 188
192int vhost_log_write(struct vhost_virtqueue *vq, struct vhost_log *log, 189int vhost_log_write(struct vhost_virtqueue *vq, struct vhost_log *log,
193 unsigned int log_num, u64 len); 190 unsigned int log_num, u64 len);
194void vhost_zerocopy_callback(struct ubuf_info *);
195int vhost_zerocopy_signal_used(struct vhost_virtqueue *vq);
196 191
197#define vq_err(vq, fmt, ...) do { \ 192#define vq_err(vq, fmt, ...) do { \
198 pr_debug(pr_fmt(fmt), ##__VA_ARGS__); \ 193 pr_debug(pr_fmt(fmt), ##__VA_ARGS__); \