aboutsummaryrefslogtreecommitdiffstats
path: root/tools/virtio/vringh_test.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/virtio/vringh_test.c')
-rw-r--r--tools/virtio/vringh_test.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/tools/virtio/vringh_test.c b/tools/virtio/vringh_test.c
index 14a4f4cab5b9..9d4b1bca54be 100644
--- a/tools/virtio/vringh_test.c
+++ b/tools/virtio/vringh_test.c
@@ -304,7 +304,7 @@ static int parallel_test(unsigned long features,
304 close(to_guest[1]); 304 close(to_guest[1]);
305 close(to_host[0]); 305 close(to_host[0]);
306 306
307 gvdev.vdev.features[0] = features; 307 gvdev.vdev.features = features;
308 gvdev.to_host_fd = to_host[1]; 308 gvdev.to_host_fd = to_host[1];
309 gvdev.notifies = 0; 309 gvdev.notifies = 0;
310 310
@@ -449,13 +449,13 @@ int main(int argc, char *argv[])
449 bool fast_vringh = false, parallel = false; 449 bool fast_vringh = false, parallel = false;
450 450
451 getrange = getrange_iov; 451 getrange = getrange_iov;
452 vdev.features[0] = 0; 452 vdev.features = 0;
453 453
454 while (argv[1]) { 454 while (argv[1]) {
455 if (strcmp(argv[1], "--indirect") == 0) 455 if (strcmp(argv[1], "--indirect") == 0)
456 vdev.features[0] |= (1 << VIRTIO_RING_F_INDIRECT_DESC); 456 __virtio_set_bit(&vdev, VIRTIO_RING_F_INDIRECT_DESC);
457 else if (strcmp(argv[1], "--eventidx") == 0) 457 else if (strcmp(argv[1], "--eventidx") == 0)
458 vdev.features[0] |= (1 << VIRTIO_RING_F_EVENT_IDX); 458 __virtio_set_bit(&vdev, VIRTIO_RING_F_EVENT_IDX);
459 else if (strcmp(argv[1], "--slow-range") == 0) 459 else if (strcmp(argv[1], "--slow-range") == 0)
460 getrange = getrange_slow; 460 getrange = getrange_slow;
461 else if (strcmp(argv[1], "--fast-vringh") == 0) 461 else if (strcmp(argv[1], "--fast-vringh") == 0)
@@ -468,7 +468,7 @@ int main(int argc, char *argv[])
468 } 468 }
469 469
470 if (parallel) 470 if (parallel)
471 return parallel_test(vdev.features[0], getrange, fast_vringh); 471 return parallel_test(vdev.features, getrange, fast_vringh);
472 472
473 if (posix_memalign(&__user_addr_min, PAGE_SIZE, USER_MEM) != 0) 473 if (posix_memalign(&__user_addr_min, PAGE_SIZE, USER_MEM) != 0)
474 abort(); 474 abort();
@@ -483,7 +483,7 @@ int main(int argc, char *argv[])
483 483
484 /* Set up host side. */ 484 /* Set up host side. */
485 vring_init(&vrh.vring, RINGSIZE, __user_addr_min, ALIGN); 485 vring_init(&vrh.vring, RINGSIZE, __user_addr_min, ALIGN);
486 vringh_init_user(&vrh, vdev.features[0], RINGSIZE, true, 486 vringh_init_user(&vrh, vdev.features, RINGSIZE, true,
487 vrh.vring.desc, vrh.vring.avail, vrh.vring.used); 487 vrh.vring.desc, vrh.vring.avail, vrh.vring.used);
488 488
489 /* No descriptor to get yet... */ 489 /* No descriptor to get yet... */
@@ -652,13 +652,13 @@ int main(int argc, char *argv[])
652 } 652 }
653 653
654 /* Test weird (but legal!) indirect. */ 654 /* Test weird (but legal!) indirect. */
655 if (vdev.features[0] & (1 << VIRTIO_RING_F_INDIRECT_DESC)) { 655 if (__virtio_test_bit(&vdev, VIRTIO_RING_F_INDIRECT_DESC)) {
656 char *data = __user_addr_max - USER_MEM/4; 656 char *data = __user_addr_max - USER_MEM/4;
657 struct vring_desc *d = __user_addr_max - USER_MEM/2; 657 struct vring_desc *d = __user_addr_max - USER_MEM/2;
658 struct vring vring; 658 struct vring vring;
659 659
660 /* Force creation of direct, which we modify. */ 660 /* Force creation of direct, which we modify. */
661 vdev.features[0] &= ~(1 << VIRTIO_RING_F_INDIRECT_DESC); 661 __virtio_clear_bit(&vdev, VIRTIO_RING_F_INDIRECT_DESC);
662 vq = vring_new_virtqueue(0, RINGSIZE, ALIGN, &vdev, true, 662 vq = vring_new_virtqueue(0, RINGSIZE, ALIGN, &vdev, true,
663 __user_addr_min, 663 __user_addr_min,
664 never_notify_host, 664 never_notify_host,