1. 07 12月, 2015 1 次提交
  2. 11 2月, 2015 1 次提交
  3. 21 1月, 2015 1 次提交
  4. 09 12月, 2014 4 次提交
  5. 14 9月, 2014 2 次提交
    • R
      virtio_ring: unify direct/indirect code paths. · b25bd251
      Rusty Russell 提交于
      virtqueue_add() populates the virtqueue descriptor table from the sgs
      given.  If it uses an indirect descriptor table, then it puts a single
      descriptor in the descriptor table pointing to the kmalloc'ed indirect
      table where the sg is populated.
      
      Previously vring_add_indirect() did the allocation and the simple
      linear layout.  We replace that with alloc_indirect() which allocates
      the indirect table then chains it like the normal descriptor table so
      we can reuse the core logic.
      
      This slows down pktgen by less than 1/2 a percent (which uses direct
      descriptors), as well as vring_bench, but it's far neater.
      
      vring_bench before:
      	1061485790-1104800648(1.08254e+09+/-6.6e+06)ns
      vring_bench after:
      	1125610268-1183528965(1.14172e+09+/-8e+06)ns
      
      pktgen before:
         787781-796334(793165+/-2.4e+03)pps 365-369(367.5+/-1.2)Mb/sec (365530384-369498976(3.68028e+08+/-1.1e+06)bps) errors: 0
      
      pktgen after:
         779988-790404(786391+/-2.5e+03)pps 361-366(364.35+/-1.3)Mb/sec (361914432-366747456(3.64885e+08+/-1.2e+06)bps) errors: 0
      
      Now, if we make force indirect descriptors by turning off any_header_sg
      in virtio_net.c:
      
      pktgen before:
        713773-721062(718374+/-2.1e+03)pps 331-334(332.95+/-0.92)Mb/sec (331190672-334572768(3.33325e+08+/-9.6e+05)bps) errors: 0
      pktgen after:
        710542-719195(714898+/-2.4e+03)pps 329-333(331.15+/-1.1)Mb/sec (329691488-333706480(3.31713e+08+/-1.1e+06)bps) errors: 0
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b25bd251
    • R
      virtio_ring: assume sgs are always well-formed. · eeebf9b1
      Rusty Russell 提交于
      We used to have several callers which just used arrays.  They're
      gone, so we can use sg_next() everywhere, simplifying the code.
      
      On my laptop, this slowed down vring_bench by 15%:
      
      vring_bench before:
      	936153354-967745359(9.44739e+08+/-6.1e+06)ns
      vring_bench after:
      	1061485790-1104800648(1.08254e+09+/-6.6e+06)ns
      
      However, a more realistic test using pktgen on a AMD FX(tm)-8320 saw
      a few percent improvement:
      
      pktgen before:
        767390-792966(785159+/-6.5e+03)pps 356-367(363.75+/-2.9)Mb/sec (356068960-367936224(3.64314e+08+/-3e+06)bps) errors: 0
      
      pktgen after:
         787781-796334(793165+/-2.4e+03)pps 365-369(367.5+/-1.2)Mb/sec (365530384-369498976(3.68028e+08+/-1.1e+06)bps) errors: 0
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      eeebf9b1
  6. 28 4月, 2014 1 次提交
  7. 13 3月, 2014 2 次提交
    • R
      virtio: fail adding buffer on broken queues. · 70670444
      Rusty Russell 提交于
      Heinz points out that adding buffers to a broken virtqueue (which
      should "never happen") still works.  Failing allows drivers to detect
      and complain about broken devices.
      
      Now drivers are robust, we can add this extra check.
      Reported-by: NHeinz Graalfs <graalfs@linux.vnet.ibm.com>
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      70670444
    • J
      tools/virtio: fix missing kmemleak_ignore symbol · 6abb2dd9
      Joel Stanley 提交于
      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: NJoel Stanley <joel@jms.id.au>
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      6abb2dd9
  8. 05 11月, 2013 1 次提交
  9. 29 10月, 2013 3 次提交
  10. 17 10月, 2013 1 次提交
    • R
      virtio_ring: plug kmemleak false positive. · bb478d8b
      Rusty Russell 提交于
      unreferenced object 0xffff88003d467e20 (size 32):
        comm "softirq", pid 0, jiffies 4295197765 (age 6.364s)
        hex dump (first 32 bytes):
          28 19 bf 3d 00 00 00 00 0c 00 00 00 01 00 01 00  (..=............
          02 dc 51 3c 00 00 00 00 56 00 00 00 00 00 00 00  ..Q<....V.......
        backtrace:
          [<ffffffff8152db19>] kmemleak_alloc+0x59/0xc0
          [<ffffffff81102e93>] __kmalloc+0xf3/0x180
          [<ffffffff812db5d6>] vring_add_indirect+0x36/0x280
          [<ffffffff812dc59f>] virtqueue_add_outbuf+0xbf/0x4e0
          [<ffffffff813a8b30>] start_xmit+0x1a0/0x3b0
          [<ffffffff81445861>] dev_hard_start_xmit+0x2d1/0x4d0
          [<ffffffff81460052>] sch_direct_xmit+0xf2/0x1c0
          [<ffffffff81445c28>] dev_queue_xmit+0x1c8/0x460
          [<ffffffff814e3187>] ip6_finish_output2+0x1d7/0x470
          [<ffffffff814e34b0>] ip6_finish_output+0x90/0xb0
          [<ffffffff814e3507>] ip6_output+0x37/0xb0
          [<ffffffff815021eb>] igmp6_send+0x2db/0x470
          [<ffffffff81502645>] igmp6_timer_handler+0x95/0xa0
          [<ffffffff8104b57c>] call_timer_fn+0x2c/0x90
          [<ffffffff8104b7ba>] run_timer_softirq+0x1da/0x1f0
          [<ffffffff81045721>] __do_softirq+0xd1/0x1b0
      
      Address gets embedded in a descriptor via virt_to_phys().  See detach_buf,
      which frees it:
      
      	if (vq->vring.desc[i].flags & VRING_DESC_F_INDIRECT)
      		kfree(phys_to_virt(vq->vring.desc[i].addr));
      Reported-by: NChristoph Paasch <christoph.paasch@uclouvain.be>
      Fix-suggested-by: NChristoph Paasch <christoph.paasch@uclouvain.be>
      Typing-done-by: NRusty Russell <rusty@rustcorp.com.au>
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      bb478d8b
  11. 10 7月, 2013 1 次提交
  12. 20 5月, 2013 1 次提交
  13. 20 3月, 2013 3 次提交
  14. 18 12月, 2012 2 次提交
  15. 22 10月, 2012 1 次提交
    • W
      virtio: force vring descriptors to be allocated from lowmem · b92b1b89
      Will Deacon 提交于
      Virtio devices may attempt to add descriptors to a virtqueue from atomic
      context using GFP_ATOMIC allocation. This is problematic because such
      allocations can fall outside of the lowmem mapping, causing virt_to_phys
      to report bogus physical addresses which are subsequently passed to
      userspace via the buffers for the virtual device.
      
      This patch masks out __GFP_HIGH and __GFP_HIGHMEM from the requested
      flags when allocating descriptors for a virtqueue. If an atomic
      allocation is requested and later fails, we will return -ENOSPC which
      will be handled by the driver.
      
      Cc: stable@kernel.org
      Cc: Sasha Levin <levinsasha928@gmail.com>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      b92b1b89
  16. 28 9月, 2012 1 次提交
  17. 28 1月, 2012 2 次提交
  18. 12 1月, 2012 7 次提交
  19. 01 11月, 2011 1 次提交
  20. 24 10月, 2011 1 次提交
  21. 30 5月, 2011 2 次提交
    • M
      virtio: add api for delayed callbacks · 7ab358c2
      Michael S. Tsirkin 提交于
      Add an API that tells the other side that callbacks
      should be delayed until a lot of work has been done.
      Implement using the new event_idx feature.
      
      Note: it might seem advantageous to let the drivers
      ask for a callback after a specific capacity has
      been reached. However, as a single head can
      free many entries in the descriptor table,
      we don't really have a clue about capacity
      until get_buf is called. The API is the simplest
      to implement at the moment, we'll see what kind of
      hints drivers can pass when there's more than one
      user of the feature.
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      7ab358c2
    • M
      virtio_ring: support event idx feature · a5c262c5
      Michael S. Tsirkin 提交于
      Support for the new event idx feature:
      1. When enabling interrupts, publish the current avail index
         value to the host to get interrupts on the next update.
      2. Use the new avail_event feature to reduce the number
         of exits from the guest.
      
      Simple test with the simulator:
      
      [virtio]# time ./virtio_test
      spurious wakeus: 0x7
      
      real    0m0.169s
      user    0m0.140s
      sys     0m0.019s
      [virtio]# time ./virtio_test --no-event-idx
      spurious wakeus: 0x11
      
      real    0m0.649s
      user    0m0.295s
      sys     0m0.335s
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      a5c262c5
  22. 21 4月, 2011 1 次提交