summaryrefslogtreecommitdiffstats
path: root/tools/virtio/virtio_test.c
Commit message (Collapse)AuthorAgeFilesLines
* tools/virtio: fix spelling mistake: "wakeus" -> "wakeups"Colin Ian King2017-05-091-1/+1
| | | | | | | | trivial fix to spelling mistake in an error message. Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Acked-by: Jason Wang <jasowang@redhat.com>
* tools/virtio: fix build breakageSekhar Nori2017-05-021-1/+1
| | | | | | | | | | | | | | | | | | | | Previous commit ("virtio: add context flag to find vqs") added a new 'context' flag to vring_new_virtqueue(), but the corresponding API in tools/virtio/ is not updated causing build errors due to conflicting declarations. Bring code in tools/virtio in sync with that in kernel. I have used 'false' for the value of the new boolean 'context' flag as that seems to be the best way to preserve existing behavior. Tested with: $ make -C tools/virtio clean all ARCH=x86 Signed-off-by: Sekhar Nori <nsekhar@ti.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* tools/virtio: add virtio 1.0 in virtio_testMichael S. Tsirkin2014-12-151-1/+13
| | | | Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* tools/virtio: more stubsMichael S. Tsirkin2014-12-151-0/+1
| | | | | | | As usual, add more stubs to fix test build after main codebase changes. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* virtio: use u32, not bitmap for featuresMichael S. Tsirkin2014-12-091-3/+2Star
| | | | | | | | | | | | | | | | | | | It seemed like a good idea to use bitmap for features in struct virtio_device, but it's actually a pain, and seems to become even more painful when we get more than 32 feature bits. Just change it to a u32 for now. Based on patch by Rusty. Suggested-by: David Hildenbrand <dahi@linux.vnet.ibm.com> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
* tools/virtio: add a missing )Joel Stanley2014-03-131-1/+1
| | | | | | | | | | | | | | | | | | Fixes the following build failure: cc -g -O2 -Wall -I. -I ../../usr/include/ -Wno-pointer-sign -fno-strict-overflow -fno-strict-aliasing -fno-common -MMD -U_FORTIFY_SOURCE -c -o virtio_test.o virtio_test.c virtio_test.c: In function ‘run_test’: virtio_test.c:176:7: error: expected ‘)’ before ‘r’ r = -1; ^ Fixes: 53c18c9906441 (virtio_test: verify if virtqueue_kick() succeeded) Cc: Heinz Graalfs <graalfs@linux.vnet.ibm.com> Signed-off-by: Joel Stanley <joel@jms.id.au> Acked-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
* virtio_test: verify if virtqueue_kick() succeededHeinz Graalfs2013-10-291-1/+2
| | | | | | | Verify if a host kick succeeded by checking return value of virtqueue_kick(). Signed-off-by: Heinz Graalfs <graalfs@linux.vnet.ibm.com> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
* virtio_ring: change host notification APIHeinz Graalfs2013-10-291-1/+2
| | | | | | | | | | | | | | | Currently a host kick error is silently ignored and not reflected in the virtqueue of a particular virtio device. Changing the notify API for guest->host notification seems to be one prerequisite in order to be able to handle such errors in the context where the kick is triggered. This patch changes the notify API. The notify function must return a bool return value. It returns false if the host notification failed. Signed-off-by: Heinz Graalfs <graalfs@linux.vnet.ibm.com> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
* tools/virtio: remove virtqueue_add_buf() from tests.Rusty Russell2013-03-201-3/+3
| | | | | | Make the rest of the paths use virtqueue_add_sgs or add_outbuf. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
* tools/virtio: separate headers more.Rusty Russell2013-03-201-0/+4
| | | | | | | | | | This makes them a bit more like the kernel headers, so we can include more real kernel headers in our tests. In addition this means that we don't break tools/virtio with the next patch. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
* tools/virtio: fix build for 3.8Michael S. Tsirkin2013-03-201-1/+2
| | | | | Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
* Merge tag 'virtio-next-for-linus' of ↵Linus Torvalds2012-12-201-2/+2
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux Pull virtio update from Rusty Russell: "Some nice cleanups, and even a patch my wife did as a "live" demo for Latinoware 2012. There's a slightly non-trivial merge in virtio-net, as we cleaned up the virtio add_buf interface while DaveM accepted the mq virtio-net patches." * tag 'virtio-next-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux: (27 commits) virtio_console: Add support for remoteproc serial virtio_console: Merge struct buffer_token into struct port_buffer virtio: add drv_to_virtio to make code clearly virtio: use dev_to_virtio wrapper in virtio virtio-mmio: Fix irq parsing in command line parameter virtio_console: Free buffers from out-queue upon close virtio: Convert dev_printk(KERN_<LEVEL> to dev_<level>( virtio_console: Use kmalloc instead of kzalloc virtio_console: Free buffer if splice fails virtio: tools: make it clear that virtqueue_add_buf() no longer returns > 0 virtio: scsi: make it clear that virtqueue_add_buf() no longer returns > 0 virtio: rpmsg: make it clear that virtqueue_add_buf() no longer returns > 0 virtio: net: make it clear that virtqueue_add_buf() no longer returns > 0 virtio: console: make it clear that virtqueue_add_buf() no longer returns > 0 virtio: make virtqueue_add_buf() returning 0 on success, not capacity. virtio: console: don't rely on virtqueue_add_buf() returning capacity. virtio_net: don't rely on virtqueue_add_buf() returning capacity. virtio-net: remove unused skb_vnet_hdr->num_sg field virtio-net: correct capacity math on ring full virtio: move queue_index and num_free fields into core struct virtqueue. ...
| * virtio: tools: make it clear that virtqueue_add_buf() no longer returns > 0Rusty Russell2012-12-181-2/+2
| | | | | | | | | | | | We simplified virtqueue_add_buf(), make it clear in the callers. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
* | tools:virtio: fix compilation warningCong Ding2012-12-061-1/+1
|/ | | | | | | | We do not allow old-style function definition. Always spell foo(void) if a function does not take any parameters. Signed-off-by: Cong Ding <dinggnu@gmail.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* virtio/tools: add delayed interupt modeMichael S. Tsirkin2012-05-021-4/+22
| | | | Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* virtio: rename virtqueue_add_buf_gfp to virtqueue_add_bufRusty Russell2012-01-121-1/+2
| | | | | | | | | Remove wrapper functions. This makes the allocation type explicit in all callers; I used GPF_KERNEL where it seemed obvious, left it at GFP_ATOMIC otherwise. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Reviewed-by: Christoph Hellwig <hch@lst.de>
* virtio: harsher barriers for rpmsg.Rusty Russell2012-01-121-1/+2
| | | | | | | | | | | | | | | | | | We were cheating with our barriers; using the smp ones rather than the real device ones. That was fine, until rpmsg came along, which is used to talk to a real device (a non-SMP CPU). Unfortunately, just putting back the real barriers (reverting d57ed95d) causes a performance regression on virtio-pci. In particular, Amos reports netbench's TCP_RR over virtio_net CPU utilization increased up to 35% while throughput went down by up to 14%. By comparison, this branch is in the noise. Reference: https://lkml.org/lkml/2011/12/11/22 Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
* virtio_test: support event indexMichael S. Tsirkin2011-05-301-2/+17
| | | | | | | Add ability to test the new event idx feature, enable by default. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
* tools/virtio: virtio_test toolMichael S. Tsirkin2010-12-091-0/+248
This is the userspace part of the tool: it includes a bunch of stubs for linux APIs, somewhat simular to linuxsched. This makes it possible to recompile the ring code in userspace. A small test example is implemented combining this with vhost_test module. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>