1. 22 May, 2016 1 commit
  2. 02 Mar, 2016 1 commit
    • Andy Lutomirski's avatar
      virtio_ring: Support DMA APIs · 780bc790
      Andy Lutomirski authored
      virtio_ring currently sends the device (usually a hypervisor)
      physical addresses of its I/O buffers.  This is okay when DMA
      addresses and physical addresses are the same thing, but this isn't
      always the case.  For example, this never works on Xen guests, and
      it is likely to fail if a physical "virtio" device ever ends up
      behind an IOMMU or swiotlb.
      
      The immediate use case for me is to enable virtio on Xen guests.
      For that to work, we need vring to support DMA address translation
      as well as a corresponding change to virtio_pci or to another
      driver.
      Signed-off-by: default avatarAndy Lutomirski <luto@kernel.org>
      Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      780bc790
  3. 26 Jan, 2016 2 commits
  4. 07 Dec, 2015 2 commits
  5. 16 Sep, 2015 1 commit
  6. 09 Sep, 2015 1 commit
  7. 15 Dec, 2014 6 commits
  8. 09 Dec, 2014 2 commits
  9. 01 May, 2014 2 commits
  10. 13 Mar, 2014 3 commits
    • Joel Stanley's avatar
      tools/virtio: add a missing ) · be40d5cc
      Joel Stanley authored
      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: 53c18c99 (virtio_test: verify if virtqueue_kick() succeeded)
      Cc: Heinz Graalfs <graalfs@linux.vnet.ibm.com>
      Signed-off-by: default avatarJoel Stanley <joel@jms.id.au>
      Acked-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
      be40d5cc
    • Joel Stanley's avatar
      tools/virtio: fix missing kmemleak_ignore symbol · 6abb2dd9
      Joel Stanley authored
      In commit bb478d8b virtio_ring: plug kmemleak false positive,
      kmemleak_ignore was introduced. This broke compilation of virtio_test:
      
        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_ring.o ../../drivers/virtio/virtio_ring.c
        ../../drivers/virtio/virtio_ring.c: In function ‘vring_add_indirect’:
        ../../drivers/virtio/virtio_ring.c:177:2: warning: implicit declaration
        of function ‘kmemleak_ignore’ [-Wimplicit-function-declaration]
          kmemleak_ignore(desc);
          ^
        cc   virtio_test.o virtio_ring.o   -o virtio_test
        virtio_ring.o: In function `vring_add_indirect':
        tools/virtio/../../drivers/virtio/virtio_ring.c:177:
        undefined reference to `kmemleak_ignore'
      
      Add a dummy header for tools/virtio, and add #incldue <linux/kmemleak.h>
      to drivers/virtio/virtio_ring.c so it is picked up by the userspace
      tools.
      Signed-off-by: default avatarJoel Stanley <joel@jms.id.au>
      Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
      6abb2dd9
    • Joel Stanley's avatar
      tools/virtio: update internal copies of headers · d1b8c4c2
      Joel Stanley authored
      The virtio headers have changed recently:
      
       5b1bf7cb virtio_ring: let virtqueue_{kick()/notify()} return a bool
       46f9c2b9 virtio_ring: change host notification API
      
      Update the internal copies to fix the build of virtio_test:
      
        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
        In file included from virtio_test.c:15:0:
        ./linux/virtio.h:76:19: error: conflicting types for ‘vring_new_virtqueue’
         struct virtqueue *vring_new_virtqueue(unsigned int index,
                           ^
        In file included from ./linux/virtio_ring.h:1:0,
                         from ../../usr/include/linux/vhost.h:17,
                         from virtio_test.c:14:
        ./linux/../../../include/linux/virtio_ring.h:68:19: note: previous
        declaration of ‘vring_new_virtqueue’ was here
         struct virtqueue *vring_new_virtqueue(unsigned int index,
        virtio_test.c: In function ‘vq_info_add’:
        virtio_test.c:103:12: warning: passing argument 7 of ‘vring_new_virtqueue’
        from incompatible pointer type [enabled by default]
                    vq_notify, vq_callback, "test");
                    ^
        In file included from virtio_test.c:15:0:
        ./linux/virtio.h:76:19: note: expected ‘void (*)(struct virtqueue *)’ but
        argument is of type ‘_Bool (*)(struct virtqueue *)’
         struct virtqueue *vring_new_virtqueue(unsigned int index,
                           ^
      Signed-off-by: default avatarJoel Stanley <joel@jms.id.au>
      Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
      d1b8c4c2
  11. 29 Oct, 2013 2 commits
  12. 15 Jul, 2013 1 commit
  13. 09 Jul, 2013 1 commit
  14. 20 Mar, 2013 6 commits
    • Rusty Russell's avatar
      tools/virtio: remove virtqueue_add_buf() from tests. · cf994e0a
      Rusty Russell authored
      Make the rest of the paths use virtqueue_add_sgs or add_outbuf.
      Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
      cf994e0a
    • Rusty Russell's avatar
      tools/virtio: make vringh_test use inbuf/outbuf. · e538ebaf
      Rusty Russell authored
      As expected, the simplified accessors are faster.
      
      for i in `seq 50`; do /usr/bin/time -f 'Wall time:%e' ./vringh_test --indirect --eventidx --parallel --fast-vringh; done 2>&1 | stats --trim-outliers:
      
      Before:
      	Using CPUS 0 and 3
      	Guest: notified 0, pinged 39062-39063(39063)
      	Host: notified 39062-39063(39063), pinged 0
      	Wall time:1.760000-2.220000(1.789167)
      
      After:
      	Using CPUS 0 and 3
      	Guest: notified 0, pinged 39037-39063(39062)
      	Host: notified 39037-39063(39062), pinged 0
      	Wall time:1.640000-1.810000(1.676875)
      Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
      e538ebaf
    • Rusty Russell's avatar
      virtio_ring: virtqueue_add_sgs, to add multiple sgs. · 13816c76
      Rusty Russell authored
      virtio_scsi can really use this, to avoid the current hack of copying
      the whole sg array.  Some other things get slightly neater, too.
      
      This causes a slowdown in virtqueue_add_buf(), which is implemented as
      a wrapper.  This is addressed in the next patches.
      
      for i in `seq 50`; do /usr/bin/time -f 'Wall time:%e' ./vringh_test --indirect --eventidx --parallel --fast-vringh; done 2>&1 | stats --trim-outliers:
      
      Before:
      	Using CPUS 0 and 3
      	Guest: notified 0, pinged 39009-39063(39062)
      	Host: notified 39009-39063(39062), pinged 0
      	Wall time:1.700000-1.950000(1.723542)
      
      After:
      	Using CPUS 0 and 3
      	Guest: notified 0, pinged 39062-39063(39063)
      	Host: notified 39062-39063(39063), pinged 0
      	Wall time:1.760000-2.220000(1.789167)
      Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
      Reviewed-by: default avatarWanlong Gao <gaowanlong@cn.fujitsu.com>
      Reviewed-by: default avatarAsias He <asias@redhat.com>
      13816c76
    • Rusty Russell's avatar
      tools/virtio: add vring_test. · 1515c5ce
      Rusty Russell authored
      This is mainly to test the drivers/vhost/vringh.c code, but it also
      uses the drivers/virtio/virtio_ring.c code for the guest side.
      
      Usage for testing the basic implementation:
      
      	./vringh_test
      	# Test with indirect descriptors
      	./vringh_test --indirect
      	# Test with indirect descriptors and event indexex
      	./vringh_test --indirect --eventidx
      
      You can run a parallel stress test by adding --parallel to any of the
      above options.
      
      eg ./vringh_test --parallel:
      	Using CPUS 0 and 3
      	Guest: notified 10107974, pinged 107970
      	Host: notified 108158, pinged 3172148
      
      ./vringh_test --indirect --eventidx --parallel:
      	Using CPUS 0 and 3
      	Guest: notified 156357, pinged 156251
      	Host: notified 156251, pinged 78179
      
      Average of 50 times doing ./vringh_test --indirect --eventidx --parallel:
      	2.840000-3.040000(2.927292)user
      Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
      1515c5ce
    • Rusty Russell's avatar
      tools/virtio: separate headers more. · 61d0b5a4
      Rusty Russell authored
      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: default avatarRusty Russell <rusty@rustcorp.com.au>
      61d0b5a4
    • Michael S. Tsirkin's avatar
      73640c99
  15. 18 Dec, 2012 1 commit
  16. 06 Dec, 2012 1 commit
  17. 28 Sep, 2012 2 commits
  18. 02 May, 2012 1 commit
  19. 28 Feb, 2012 3 commits
  20. 12 Jan, 2012 1 commit