1. 27 Feb, 2017 4 commits
    • Christoph Hellwig's avatar
      virtio_pci: use shared interrupts for virtqueues · 07ec5148
      Christoph Hellwig authored
      
      
      This lets IRQ layer handle dispatching IRQs to separate handlers for the
      case where we don't have per-VQ MSI-X vectors, and allows us to greatly
      simplify the code based on the assumption that we always have interrupt
      vector 0 (legacy INTx or config interrupt for MSI-X) available, and
      any other interrupt is request/freed throught the VQ, even if the
      actual interrupt line might be shared in some cases.
      
      This allows removing a great deal of variables keeping track of the
      interrupt state in struct virtio_pci_device, as we can now simply walk the
      list of VQs and deal with per-VQ interrupt handlers there, and only treat
      vector 0 special.
      
      Additionally clean up the VQ allocation code to properly unwind on error
      instead of having a single global cleanup label, which is error prone,
      and in this case also leads to more code.
      
      Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      07ec5148
    • Christoph Hellwig's avatar
      virtio_pci: remove struct virtio_pci_vq_info · 5c34d002
      Christoph Hellwig authored
      
      
      We don't really need struct virtio_pci_vq_info, as most field in there
      are redundant:
      
       - the vq backpointer is not strictly neede to start with
       - the entry in the vqs list is not needed - the generic virtqueue already
         has list, we only need to check if it has a callback to get the same
         semantics
       - we can use a simple array to look up the MSI-X vec if needed.
       - That simple array now also duoble serves to replace the per_vq_vectors
         flag
      
      Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      5c34d002
    • Jason Wang's avatar
      vhost: try avoiding avail index access when getting descriptor · e3b56cdd
      Jason Wang authored
      
      
      If last avail idx is not equal to cached avail idx, we're sure there's
      still available buffers in the virtqueue so there's no need to re-read
      avail idx. So let's skip this to avoid unnecessary userspace memory
      access and memory barrier. Pktgen test show about 3% improvement on rx
      pps.
      
      Signed-off-by: default avatarJason Wang <jasowang@redhat.com>
      Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      e3b56cdd
    • Michael S. Tsirkin's avatar
      virtio_mmio: expose header to userspace · 51be7a9a
      Michael S. Tsirkin authored
      
      
      It's handy for userspace emulators like QEMU.
      
      Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      51be7a9a
  2. 19 Feb, 2017 11 commits
  3. 18 Feb, 2017 1 commit
  4. 17 Feb, 2017 19 commits
  5. 16 Feb, 2017 5 commits