summaryrefslogtreecommitdiffstats
path: root/drivers/vhost/vhost.h
diff options
context:
space:
mode:
authorMichael S. Tsirkin <mst@redhat.com>2012-11-01 10:16:42 +0100
committerDavid S. Miller <davem@davemloft.net>2012-11-03 02:29:57 +0100
commitc4fcb586c337f8b8de3a3d7ba8514eed03695f6e (patch)
treeba018d4de83d2e4a9898e06e9f813359a56d85fd /drivers/vhost/vhost.h
parentvhost-net: cleanup macros for DMA status tracking (diff)
downloadlinux-c4fcb586c337f8b8de3a3d7ba8514eed03695f6e.tar.xz
linux-c4fcb586c337f8b8de3a3d7ba8514eed03695f6e.zip
vhost: track zero copy failures using DMA length
This will be used to disable zerocopy when error rate is high. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/vhost/vhost.h')
-rw-r--r--drivers/vhost/vhost.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/vhost/vhost.h b/drivers/vhost/vhost.h
index b6538eef7468..464469d901d5 100644
--- a/drivers/vhost/vhost.h
+++ b/drivers/vhost/vhost.h
@@ -17,6 +17,8 @@
* For transmit, used buffer len is unused; we override it to track buffer
* status internally; used for zerocopy tx only.
*/
+/* Lower device DMA failed */
+#define VHOST_DMA_FAILED_LEN 3
/* Lower device DMA done */
#define VHOST_DMA_DONE_LEN 2
/* Lower device DMA in progress */
@@ -24,6 +26,8 @@
/* Buffer unused */
#define VHOST_DMA_CLEAR_LEN 0
+#define VHOST_DMA_IS_DONE(len) ((len) >= VHOST_DMA_DONE_LEN)
+
struct vhost_device;
struct vhost_work;