ptr_ring: support testing different batching sizes
authorMichael S. Tsirkin <mst@redhat.com>
Fri, 7 Apr 2017 05:45:32 +0000 (08:45 +0300)
committerMichael S. Tsirkin <mst@redhat.com>
Tue, 9 May 2017 13:43:23 +0000 (16:43 +0300)
Use the param flag for that.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
tools/virtio/ringtest/ptr_ring.c

index 635b07b4fdd3949c7883a2775575c0ff4d8ce228..7b22f1b20652082b606e4ee55dae31b56f670ef3 100644 (file)
@@ -97,6 +97,9 @@ void alloc_ring(void)
 {
        int ret = ptr_ring_init(&array, ring_size, 0);
        assert(!ret);
+       /* Hacky way to poke at ring internals. Useful for testing though. */
+       if (param)
+               array.batch = param;
 }
 
 /* guest side */