diff options
Diffstat (limited to 'drivers/vhost/vhost.h')
-rw-r--r-- | drivers/vhost/vhost.h | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/drivers/vhost/vhost.h b/drivers/vhost/vhost.h index 3693327549b3..afd77295971c 100644 --- a/drivers/vhost/vhost.h +++ b/drivers/vhost/vhost.h | |||
@@ -96,7 +96,9 @@ struct vhost_virtqueue { | |||
96 | struct iovec indirect[VHOST_NET_MAX_SG]; | 96 | struct iovec indirect[VHOST_NET_MAX_SG]; |
97 | struct iovec iov[VHOST_NET_MAX_SG]; | 97 | struct iovec iov[VHOST_NET_MAX_SG]; |
98 | struct iovec hdr[VHOST_NET_MAX_SG]; | 98 | struct iovec hdr[VHOST_NET_MAX_SG]; |
99 | size_t hdr_size; | 99 | size_t vhost_hlen; |
100 | size_t sock_hlen; | ||
101 | struct vring_used_elem heads[VHOST_NET_MAX_SG]; | ||
100 | /* We use a kind of RCU to access private pointer. | 102 | /* We use a kind of RCU to access private pointer. |
101 | * All readers access it from worker, which makes it possible to | 103 | * All readers access it from worker, which makes it possible to |
102 | * flush the vhost_work instead of synchronize_rcu. Therefore readers do | 104 | * flush the vhost_work instead of synchronize_rcu. Therefore readers do |
@@ -139,12 +141,16 @@ int vhost_get_vq_desc(struct vhost_dev *, struct vhost_virtqueue *, | |||
139 | struct iovec iov[], unsigned int iov_count, | 141 | struct iovec iov[], unsigned int iov_count, |
140 | unsigned int *out_num, unsigned int *in_num, | 142 | unsigned int *out_num, unsigned int *in_num, |
141 | struct vhost_log *log, unsigned int *log_num); | 143 | struct vhost_log *log, unsigned int *log_num); |
142 | void vhost_discard_vq_desc(struct vhost_virtqueue *); | 144 | void vhost_discard_vq_desc(struct vhost_virtqueue *, int n); |
143 | 145 | ||
144 | int vhost_add_used(struct vhost_virtqueue *, unsigned int head, int len); | 146 | int vhost_add_used(struct vhost_virtqueue *, unsigned int head, int len); |
145 | void vhost_signal(struct vhost_dev *, struct vhost_virtqueue *); | 147 | int vhost_add_used_n(struct vhost_virtqueue *, struct vring_used_elem *heads, |
148 | unsigned count); | ||
146 | void vhost_add_used_and_signal(struct vhost_dev *, struct vhost_virtqueue *, | 149 | void vhost_add_used_and_signal(struct vhost_dev *, struct vhost_virtqueue *, |
147 | unsigned int head, int len); | 150 | unsigned int id, int len); |
151 | void vhost_add_used_and_signal_n(struct vhost_dev *, struct vhost_virtqueue *, | ||
152 | struct vring_used_elem *heads, unsigned count); | ||
153 | void vhost_signal(struct vhost_dev *, struct vhost_virtqueue *); | ||
148 | void vhost_disable_notify(struct vhost_virtqueue *); | 154 | void vhost_disable_notify(struct vhost_virtqueue *); |
149 | bool vhost_enable_notify(struct vhost_virtqueue *); | 155 | bool vhost_enable_notify(struct vhost_virtqueue *); |
150 | 156 | ||
@@ -161,7 +167,8 @@ enum { | |||
161 | VHOST_FEATURES = (1 << VIRTIO_F_NOTIFY_ON_EMPTY) | | 167 | VHOST_FEATURES = (1 << VIRTIO_F_NOTIFY_ON_EMPTY) | |
162 | (1 << VIRTIO_RING_F_INDIRECT_DESC) | | 168 | (1 << VIRTIO_RING_F_INDIRECT_DESC) | |
163 | (1 << VHOST_F_LOG_ALL) | | 169 | (1 << VHOST_F_LOG_ALL) | |
164 | (1 << VHOST_NET_F_VIRTIO_NET_HDR), | 170 | (1 << VHOST_NET_F_VIRTIO_NET_HDR) | |
171 | (1 << VIRTIO_NET_F_MRG_RXBUF), | ||
165 | }; | 172 | }; |
166 | 173 | ||
167 | static inline int vhost_has_feature(struct vhost_dev *dev, int bit) | 174 | static inline int vhost_has_feature(struct vhost_dev *dev, int bit) |