diff options
author | Michael S. Tsirkin <mst@redhat.com> | 2012-11-01 05:16:22 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-11-02 21:29:57 -0400 |
commit | e19d6763cc300fcb706bd291b24ac06be71e1ce6 (patch) | |
tree | 05608ee69740360480b4c66a368eb21987993058 /drivers/vhost | |
parent | 202975b4c522c197e4e2269d389aafbf056a4c37 (diff) |
skb: report completion status for zero copy skbs
Even if skb is marked for zero copy, net core might still decide
to copy it later which is somewhat slower than a copy in user context:
besides copying the data we need to pin/unpin the pages.
Add a parameter reporting such cases through zero copy callback:
if this happens a lot, device can take this into account
and switch to copying in user context.
This patch updates all users but ignores the passed value for now:
it will be used by follow-up patches.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/vhost')
-rw-r--r-- | drivers/vhost/vhost.c | 2 | ||||
-rw-r--r-- | drivers/vhost/vhost.h | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c index 99ac2cb08b43..73d08db2e677 100644 --- a/drivers/vhost/vhost.c +++ b/drivers/vhost/vhost.c | |||
@@ -1600,7 +1600,7 @@ void vhost_ubuf_put_and_wait(struct vhost_ubuf_ref *ubufs) | |||
1600 | kfree(ubufs); | 1600 | kfree(ubufs); |
1601 | } | 1601 | } |
1602 | 1602 | ||
1603 | void vhost_zerocopy_callback(struct ubuf_info *ubuf) | 1603 | void vhost_zerocopy_callback(struct ubuf_info *ubuf, bool status) |
1604 | { | 1604 | { |
1605 | struct vhost_ubuf_ref *ubufs = ubuf->ctx; | 1605 | struct vhost_ubuf_ref *ubufs = ubuf->ctx; |
1606 | struct vhost_virtqueue *vq = ubufs->vq; | 1606 | struct vhost_virtqueue *vq = ubufs->vq; |
diff --git a/drivers/vhost/vhost.h b/drivers/vhost/vhost.h index 1125af3d27d1..2de4ce2fec40 100644 --- a/drivers/vhost/vhost.h +++ b/drivers/vhost/vhost.h | |||
@@ -191,7 +191,7 @@ bool vhost_enable_notify(struct vhost_dev *, struct vhost_virtqueue *); | |||
191 | 191 | ||
192 | int vhost_log_write(struct vhost_virtqueue *vq, struct vhost_log *log, | 192 | int vhost_log_write(struct vhost_virtqueue *vq, struct vhost_log *log, |
193 | unsigned int log_num, u64 len); | 193 | unsigned int log_num, u64 len); |
194 | void vhost_zerocopy_callback(struct ubuf_info *); | 194 | void vhost_zerocopy_callback(struct ubuf_info *, bool); |
195 | int vhost_zerocopy_signal_used(struct vhost_virtqueue *vq); | 195 | int vhost_zerocopy_signal_used(struct vhost_virtqueue *vq); |
196 | 196 | ||
197 | #define vq_err(vq, fmt, ...) do { \ | 197 | #define vq_err(vq, fmt, ...) do { \ |