1. 01 6月, 2015 3 次提交
  2. 09 12月, 2014 3 次提交
  3. 09 6月, 2014 2 次提交
    • M
      vhost: move memory pointer to VQs · 47283bef
      Michael S. Tsirkin 提交于
      commit 2ae76693b8bcabf370b981cd00c36cd41d33fabc
          vhost: replace rcu with mutex
      replaced rcu sync for memory accesses with VQ mutex locl/unlock.
      This is correct since all accesses are under VQ mutex, but incomplete:
      we still do useless rcu lock/unlock operations, someone might copy this
      code into some other context where this won't be right.
      This use of RCU is also non standard and hard to understand.
      Let's copy the pointer to each VQ structure, this way
      the access rules become straight-forward, and there's
      no need for RCU anymore.
      Reported-by: NEric Dumazet <eric.dumazet@gmail.com>
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      47283bef
    • M
      vhost: move acked_features to VQs · ea16c514
      Michael S. Tsirkin 提交于
      Refactor code to make sure features are only accessed
      under VQ mutex. This makes everything simpler, no need
      for RCU here anymore.
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      ea16c514
  4. 07 12月, 2013 1 次提交
  5. 11 7月, 2013 1 次提交
  6. 07 7月, 2013 1 次提交
  7. 11 6月, 2013 1 次提交
  8. 06 5月, 2013 4 次提交
  9. 01 5月, 2013 4 次提交
  10. 30 1月, 2013 1 次提交
    • J
      vhost_net: handle polling errors when setting backend · 2b8b328b
      Jason Wang 提交于
      Currently, the polling errors were ignored, which can lead following issues:
      
      - vhost remove itself unconditionally from waitqueue when stopping the poll,
        this may crash the kernel since the previous attempt of starting may fail to
        add itself to the waitqueue
      - userspace may think the backend were successfully set even when the polling
        failed.
      
      Solve this by:
      
      - check poll->wqh before trying to remove from waitqueue
      - report polling errors in vhost_poll_start(), tx_poll_start(), the return value
        will be checked and returned when userspace want to set the backend
      
      After this fix, there still could be a polling failure after backend is set, it
      will addressed by the next patch.
      Signed-off-by: NJason Wang <jasowang@redhat.com>
      Acked-by: NMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      2b8b328b
  11. 06 12月, 2012 1 次提交
    • M
      vhost: avoid backend flush on vring ops · 935cdee7
      Michael S. Tsirkin 提交于
      vring changes already do a flush internally where appropriate, so we do
      not need a second flush.
      
      It's currently not very expensive but a follow-up patch makes flush more
      heavy-weight, so remove the extra flush here to avoid regressing
      performance if call or kick fds are changed on data path.
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      935cdee7
  12. 03 11月, 2012 4 次提交
  13. 22 7月, 2012 2 次提交
  14. 14 4月, 2012 1 次提交
  15. 28 2月, 2012 1 次提交
  16. 27 7月, 2011 1 次提交
  17. 19 7月, 2011 2 次提交
    • J
      vhost: init used ring after backend was set · f59281da
      Jason Wang 提交于
      Move the used ring initialization after backend was set. This
      makes it possible to disable the backend and tweak the used ring,
      then restart. This will also make it possible to log the used ring
      write correctly.
      Signed-off-by: NJason Wang <jasowang@redhat.com>
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      f59281da
    • M
      vhost: vhost TX zero-copy support · bab632d6
      Michael S. Tsirkin 提交于
      >From: Shirley Ma <mashirle@us.ibm.com>
      
      This adds experimental zero copy support in vhost-net,
      disabled by default. To enable, set
      experimental_zcopytx module option to 1.
      
      This patch maintains the outstanding userspace buffers in the
      sequence it is delivered to vhost. The outstanding userspace buffers
      will be marked as done once the lower device buffers DMA has finished.
      This is monitored through last reference of kfree_skb callback. Two
      buffer indices are used for this purpose.
      
      The vhost-net device passes the userspace buffers info to lower device
      skb through message control. DMA done status check and guest
      notification are handled by handle_tx: in the worst case is all buffers
      in the vq are in pending/done status, so we need to notify guest to
      release DMA done buffers first before we get any new buffers from the
      vq.
      
      One known problem is that if the guest stops submitting
      buffers, buffers might never get used until some
      further action, e.g. device reset. This does not
      seem to affect linux guests.
      Signed-off-by: NShirley <xma@us.ibm.com>
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      bab632d6
  18. 30 5月, 2011 1 次提交
  19. 01 2月, 2011 1 次提交
    • M
      vhost: rcu annotation fixup · 5e18247b
      Michael S. Tsirkin 提交于
      When built with rcu checks enabled, vhost triggers
      bogus warnings as vhost features are read without
      dev->mutex sometimes, and private pointer is read
      with our kind of rcu where work serves as a
      read side critical section.
      
      Fixing it properly is not trivial.
      Disable the warnings by stubbing out the checks for now.
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      5e18247b
  20. 09 12月, 2010 1 次提交
  21. 05 10月, 2010 1 次提交
    • J
      vhost: max s/g to match qemu · e0e9b406
      Jason Wang 提交于
      Qemu supports up to UIO_MAXIOV s/g so we have to match that because guest
      drivers may rely on this.
      
      Allocate indirect and log arrays dynamically to avoid using too much contigious
      memory and make the length of hdr array to match the header length since each
      iovec entry has a least one byte.
      
      Test with copying large files w/ and w/o migration in both linux and windows
      guests.
      Signed-off-by: NJason Wang <jasowang@redhat.com>
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      e0e9b406
  22. 22 8月, 2010 1 次提交
  23. 28 7月, 2010 2 次提交
    • D
      vhost-net: mergeable buffers support · 8dd014ad
      David Stevens 提交于
      This adds support for mergeable buffers in vhost-net: this is needed
      for older guests without indirect buffer support, as well
      as for zero copy with some devices.
      
      Includes changes by Michael S. Tsirkin to make the
      patch as low risk as possible (i.e., close to no changes
      when feature is disabled).
      Signed-off-by: NDavid Stevens <dlstevens@us.ibm.com>
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      8dd014ad
    • T
      vhost: replace vhost_workqueue with per-vhost kthread · c23f3445
      Tejun Heo 提交于
      Replace vhost_workqueue with per-vhost kthread.  Other than callback
      argument change from struct work_struct * to struct vhost_work *,
      there's no visible change to vhost_poll_*() interface.
      
      This conversion is to make each vhost use a dedicated kthread so that
      resource control via cgroup can be applied.
      
      Partially based on Sridhar Samudrala's patch.
      
      * Updated to use sub structure vhost_work instead of directly using
        vhost_poll at Michael's suggestion.
      
      * Added flusher wake_up() optimization at Michael's suggestion.
      
      Changes by MST:
      * Converted atomics/barrier use to a spinlock.
      * Create thread on SET_OWNER
      * Fix flushing
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      Cc: Sridhar Samudrala <samudrala.sridhar@gmail.com>
      c23f3445