Browse Source

ptr_ring: support testing different batching sizes

Use the param flag for that.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Michael S. Tsirkin 8 years ago
parent
commit
3008a20620
1 changed files with 3 additions and 0 deletions
  1. 3 0
      tools/virtio/ringtest/ptr_ring.c

+ 3 - 0
tools/virtio/ringtest/ptr_ring.c

@@ -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 */