diff options
-rw-r--r-- | tools/virtio/linux/virtio.h | 10 | ||||
-rw-r--r-- | tools/virtio/vringh_test.c | 8 |
2 files changed, 14 insertions, 4 deletions
diff --git a/tools/virtio/linux/virtio.h b/tools/virtio/linux/virtio.h index 5fa612ad932c..6df181a6bcc6 100644 --- a/tools/virtio/linux/virtio.h +++ b/tools/virtio/linux/virtio.h | |||
@@ -63,6 +63,16 @@ int virtqueue_add_sgs(struct virtqueue *vq, | |||
63 | void *data, | 63 | void *data, |
64 | gfp_t gfp); | 64 | gfp_t gfp); |
65 | 65 | ||
66 | int virtqueue_add_outbuf(struct virtqueue *vq, | ||
67 | struct scatterlist sg[], unsigned int num, | ||
68 | void *data, | ||
69 | gfp_t gfp); | ||
70 | |||
71 | int virtqueue_add_inbuf(struct virtqueue *vq, | ||
72 | struct scatterlist sg[], unsigned int num, | ||
73 | void *data, | ||
74 | gfp_t gfp); | ||
75 | |||
66 | void virtqueue_kick(struct virtqueue *vq); | 76 | void virtqueue_kick(struct virtqueue *vq); |
67 | 77 | ||
68 | void *virtqueue_get_buf(struct virtqueue *vq, unsigned int *len); | 78 | void *virtqueue_get_buf(struct virtqueue *vq, unsigned int *len); |
diff --git a/tools/virtio/vringh_test.c b/tools/virtio/vringh_test.c index 6a48ca5c101f..bb0bd9403e9e 100644 --- a/tools/virtio/vringh_test.c +++ b/tools/virtio/vringh_test.c | |||
@@ -369,11 +369,11 @@ static int parallel_test(unsigned long features, | |||
369 | * user addr */ | 369 | * user addr */ |
370 | __kmalloc_fake = indirects + (xfers % RINGSIZE) * 4; | 370 | __kmalloc_fake = indirects + (xfers % RINGSIZE) * 4; |
371 | if (output) | 371 | if (output) |
372 | err = virtqueue_add_buf(vq, sg, num_sg, 0, dbuf, | 372 | err = virtqueue_add_outbuf(vq, sg, num_sg, dbuf, |
373 | GFP_KERNEL); | 373 | GFP_KERNEL); |
374 | else | 374 | else |
375 | err = virtqueue_add_buf(vq, sg, 0, num_sg, dbuf, | 375 | err = virtqueue_add_inbuf(vq, sg, num_sg, |
376 | GFP_KERNEL); | 376 | dbuf, GFP_KERNEL); |
377 | 377 | ||
378 | if (err == -ENOSPC) { | 378 | if (err == -ENOSPC) { |
379 | if (!virtqueue_enable_cb_delayed(vq)) | 379 | if (!virtqueue_enable_cb_delayed(vq)) |