Skip to content
Snippets Groups Projects
  1. May 15, 2014
  2. May 05, 2014
  3. Feb 13, 2014
  4. Feb 12, 2014
  5. Feb 06, 2014
  6. Jan 22, 2014
  7. Dec 31, 2013
  8. Dec 27, 2013
    • Asias He's avatar
      virtio: Enable indirect descriptor for vblk and vscsi · 4ec750b7
      Asias He authored
      
      With indirect descriptor, we can queue more buffers in the queue.
      Indirect descriptor helps block device by making the large request does
      not consume the entire ring and making the queue depth deeper. Indirect
      descriptor does not help net device because it makes the queue longer so
      it adds latency. The tests show that indirect descriptor makes blk
      faster and there is no real measurable degradation on net. Also the
      indirect will turn on only when we are short of descriptors.
      
      This patch only enables indirect descriptor for vblk and vscsi. vnet is
      not enabled.
      
      1) vblk
      Before: 340MB/s
      After:  350MB/s
      
      2) vscsi
      Before: 320MB/s
      After:  410MB/s
      
      Signed-off-by: default avatarAsias He <asias@cloudius-systems.com>
      Signed-off-by: default avatarPekka Enberg <penberg@cloudius-systems.com>
      4ec750b7
  9. Dec 23, 2013
  10. Dec 09, 2013
  11. Dec 06, 2013
    • Asias He's avatar
      virtio: Fix vring::used_ring_is_half_empty() calculation · c62c9dd8
      Asias He authored
      
      This patch fixes:
      
      - The order of _used_ring_host_head and _used->_idx, the latter is more
        advanced than the former.
      - The unwanted promotion to "int"
      
      Pekka wrote:
      
         However, on the right-hand side, the expression type in master
         evaluates to "int" because of that innocent-looking constant "2" and
         lack of parenthesis after the cast.  That will also force the
         left-hand side to promote to "int".
      
         And no, I really don't claim to follow integer promotion rules so I
         used typeid().name() verify what the compiler is doing:
      
         [penberg@localhost tmp]$ cat types.cpp
         #include <typeinfo>
         #include <stdint.h>
         #include <cstdio>
      
         using namespace std;
      
         int main()
         {
             unsigned int _num = 1;
      
             printf("int                = %s\n", typeid(int).name());
             printf("uint16_t           = %s\n", typeid(uint16_t).name());
             printf("(uint16_t)_num/2)  = %s\n", typeid((uint16_t)_num/2).name());
             printf("(uint16_t)(_num/2) = %s\n", typeid((uint16_t)(_num/2)).name());
         }
         [penberg@localhost tmp]$ g++ -std=c++11 -Wall types.cpp
         [penberg@localhost tmp]$ ./a.out
         int                = i
         uint16_t           = t
         (uint16_t)_num/2)  = i
         (uint16_t)(_num/2) = t
      
      Signed-off-by: default avatarAsias He <asias@cloudius-systems.com>
      Signed-off-by: default avatarPekka Enberg <penberg@cloudius-systems.com>
      c62c9dd8
  12. Sep 15, 2013
    • Nadav Har'El's avatar
      Add copyright statement to drivers/* · c0e0ebf2
      Nadav Har'El authored
      Add Cloudius copyright and license statement to drivers/*.
      
      A couple of header files were based on Linux's BSD-licensed header files
      (e.g., include/uapi/linux/virtio_net.h) so they included the BSD license,
      but not any copyright statement, so we can just replace that by our own
      statement of the BSD license.
      c0e0ebf2
  13. Jul 11, 2013
    • Avi Kivity's avatar
      virtio: explicitly request contiguous memory for the virtio ring · 79aa5d28
      Avi Kivity authored
      Required by the virtio spec.
      79aa5d28
    • Nadav Har'El's avatar
      Fix hang in virtio_driver::wait_for_queue · 8ebb1693
      Nadav Har'El authored
      virtio_driver::wait_for_queue() would often hang in a memcached and
      mc_benchmark workload, waiting forever for received packets although
      these *do* arrive.
      
      As part of the virtio protocol, we need to set the host notification
      flag (we call this, somewhat confusingly, queue->enable_interrupts())
      and then check if there's anything in the queue, and if not, wait
      for the interrupt.
      
      This order is important: If we check the queue and only then set the
      notification flag, and data came in between those, the check will be
      empty and an interrupt never sent - and we can wait indefinitely for
      data that has already arrived.
      
      We did this in the right order, but the host code, running on a
      different CPU, might see memory accesses in a different order!
      We need a memory fence to ensure that the same order is also seen
      on other processors.
      
      This patch adds a memory fence to the end of the enable_interrupts()
      function itself, so we can continue to use it as before in
      wait_for_queue(). Note that we do *not* add a memory fence to
      disable_interrupts() - because no current use (and no expected use)
      cares about the ordering of disable_interrupts() vs other memory
      accesses.
      8ebb1693
  14. Jul 10, 2013
    • Dor Laor's avatar
      Allow parallel execution of {add|get}_buff, prevent fast path allocs · 350fa518
      Dor Laor authored
      virtio-vring and it's users (net/blk) were changed so no request
      header will be allocated on run time except for init. In order to
      do that, I have to change get_buf and break it into multiple parts:
      
              // Get the top item from the used ring
              void* get_buf_elem(u32 *len);
              // Let the host know we consumed the used entry
              // We separate that from get_buf_elem so no one
              // will re-cycle the request header location until
              // we're finished with it in the upper layer
              void get_buf_finalize();
              // GC the used items that were already read to be emptied
              // within the ring. Should be called by add_buf
              // It was separated from the get_buf flow to allow parallelism of the two
              void get_buf_gc();
      
      As a result, it was simple to get rid of the shared lock that protected
      _avail_head variable before. Today only the thread that calls add_buf
      updates this variable (add_buf calls get_buf_gc internally).
      
      There are two new locks instead:
        - virtio-net tx_gc lock - very rarely it can be accessed
          by the tx_gc thread or normally by the tx xmit thread
        - virtio-blk make_requests - there are parallel requests
      350fa518
  15. Jul 04, 2013
    • Dor Laor's avatar
      Trivial: get rid of sglist entirely · 18beb1b6
      Dor Laor authored
      18beb1b6
    • Dor Laor's avatar
      Sglist virtio usage refactore · ddef97f6
      Dor Laor authored
      Use a single instance per queue vector of sglist data.
      Before this patch sglist was implemented as a std::list
      which caused it to allocate heap memory and travel through pointers.
      Now we use a single vector per queue to temoprary keep the
      buffer data between the upper virtio layer and the lower one.
      ddef97f6
  16. Jul 03, 2013
  17. Jun 30, 2013
    • Dor Laor's avatar
      Implement event index, a virtio optimization · 26e046a3
      Dor Laor authored
      The optimization improves performance by letting each side
      of the ring know what was the last index read by the remote
      party. In case were the other side has older indexes, waiting
      for processing we won't trigger another update (kick or irq,
      depending on the direction).
      The optimization reduces irq injection by a 7%.
      
      Along the way, collapse vring::need_event to the code and use
      std::atomic(s) to access any variable which is shared w/ the host
      26e046a3
  18. Jun 21, 2013
    • Guy Zana's avatar
      virtio: respect host virtqueue notification suppression · e0355a8e
      Guy Zana authored
      same as we can tell the host to disable interrupts via the _avail ring,
      the host can tell us to supress notification via the _used ring.
      every notificaion, or kick consumes about 10ns as it is implemented as
      writing to an io port, which travels to usespace qemu in the host.
      
      this simple patch, increase netperf's throughput by 600%, from a
      300mbps to 1800mbps.
      e0355a8e
  19. Jun 20, 2013
    • Dor Laor's avatar
      Limit the usage of indirect buffers · 5b751612
      Dor Laor authored
      Indirect is good for very large SG list but isn't required
      in case there is enough place on the ring or the SG list is tiny.
      For the time being there is barely use of it so I set it off
      by default
      5b751612
    • Dor Laor's avatar
      Add mergeable buffers support for virtio-net · d487ffd1
      Dor Laor authored
      The feature allows the hypervisor to batch several packets together
      as one large SG list. Once such header is received, the guest rx
      routine interates over the list and assembles a mega mbuf.
      
      The patch also simplifies the rx path by using a single buffer for
      the virtio data and its header. This shrinks the sg list from size of
      two into a single one.
      
      The issue is that at the moment I haven't seen packets w/ mbuf > 1
      being received. Linux guest does receives such packets here and there.
      It may be due to the use of offload features that enalrge the packet size
      d487ffd1
  20. Jun 17, 2013
  21. Jun 09, 2013
  22. Jun 06, 2013
Loading