1. 21 6月, 2013 1 次提交
    • N
      vhost/scsi: Drop unnecessary wait_for_tasks=true usage with transport_generic_free_cmd · 6c131d0c
      Nicholas Bellinger 提交于
      This patch changes vhost_scsi_free_cmd() to call transport_generic_free_cmd()
      with wait_for_tasks=false in order to avoid the extra se_cmd->t_state_lock
      access for the wait_for_tasks=true case.
      
      This is unnecessary because vhost_scsi_free_cmd() is only ever called by
      vhost_scsi_complete_cmd_work() after TCM completion handoff, and by
      vhost_scsi_handle_vq() exception code before TCM submission handoff, so
      there is never a case where se_cmd is still active from TCM's perspective
      when transport_generic_free_cmd() is called.
      
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Roland Dreier <roland@kernel.org>
      Cc: Kent Overstreet <koverstreet@google.com>
      Cc: Asias He <asias@redhat.com>
      Cc: Michael S. Tsirkin <mst@redhat.com>
      Cc: Or Gerlitz <ogerlitz@mellanox.com>
      Cc: Moussa Ba <moussaba@micron.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      6c131d0c
  2. 07 5月, 2013 1 次提交
  3. 02 5月, 2013 3 次提交
  4. 01 5月, 2013 4 次提交
  5. 25 4月, 2013 4 次提交
  6. 11 4月, 2013 4 次提交
  7. 09 4月, 2013 2 次提交
    • A
      tcm_vhost: Initialize vq->last_used_idx when set endpoint · dfd5d569
      Asias He 提交于
      This patch fixes guest hang when booting seabios and guest.
      
        [    0.576238] scsi0 : Virtio SCSI HBA
        [    0.616754] virtio_scsi virtio1: request:id 0 is not a head!
      
      vq->last_used_idx is initialized only when /dev/vhost-scsi is
      opened or closed.
      
         vhost_scsi_open -> vhost_dev_init() -> vhost_vq_reset()
         vhost_scsi_release() -> vhost_dev_cleanup -> vhost_vq_reset()
      
      So, when guest talks to tcm_vhost after seabios does, vq->last_used_idx
      still contains the old valule for seabios. This confuses guest.
      
      Fix this by calling vhost_init_used() to init vq->last_used_idx when
      we set endpoint.
      Signed-off-by: NAsias He <asias@redhat.com>
      Acked-by: NMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      dfd5d569
    • A
      tcm_vhost: Use vq->private_data to indicate if the endpoint is setup · 4f7f46d3
      Asias He 提交于
      Currently, vs->vs_endpoint is used indicate if the endpoint is setup or
      not. It is set or cleared in vhost_scsi_set_endpoint() or
      vhost_scsi_clear_endpoint() under the vs->dev.mutex lock. However, when
      we check it in vhost_scsi_handle_vq(), we ignored the lock.
      
      Instead of using the vs->vs_endpoint and the vs->dev.mutex lock to
      indicate the status of the endpoint, we use per virtqueue
      vq->private_data to indicate it. In this way, we can only take the
      vq->mutex lock which is per queue and make the concurrent multiqueue
      process having less lock contention. Further, in the read side of
      vq->private_data, we can even do not take the lock if it is accessed in
      the vhost worker thread, because it is protected by "vhost rcu".
      
      (nab: Do s/VHOST_FEATURES/~VHOST_SCSI_FEATURES)
      Signed-off-by: NAsias He <asias@redhat.com>
      Acked-by: NMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      4f7f46d3
  8. 03 4月, 2013 1 次提交
  9. 29 3月, 2013 1 次提交
  10. 19 3月, 2013 2 次提交
  11. 14 2月, 2013 6 次提交
  12. 01 2月, 2013 1 次提交
  13. 06 12月, 2012 2 次提交
  14. 20 11月, 2012 1 次提交
  15. 19 11月, 2012 1 次提交
  16. 07 11月, 2012 1 次提交
    • C
      target: pass sense_reason as a return value · de103c93
      Christoph Hellwig 提交于
      Pass the sense reason as an explicit return value from the I/O submission
      path instead of storing it in struct se_cmd and using negative return
      values.  This cleans up a lot of the code pathes, and with the sparse
      annotations for the new sense_reason_t type allows for much better
      error checking.
      
      (nab: Convert spc_emulate_modesense + spc_emulate_modeselect to use
            sense_reason_t with Roland's MODE SELECT changes)
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Cc: Roland Dreier <roland@purestorage.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      de103c93
  17. 03 11月, 2012 1 次提交
  18. 03 10月, 2012 1 次提交
    • N
      tcm_vhost: Convert I/O path to use target_submit_cmd_map_sgls · 9f0abc15
      Nicholas Bellinger 提交于
      This patch converts tcm_vhost to use target_submit_cmd_map_sgls() for
      I/O submission and mapping of pre-allocated SGL memory from incoming
      virtio-scsi SGL memory -> se_cmd descriptors.
      
      This includes removing the original open-coded fabric uses of target
      core callers to support transport_generic_map_mem_to_cmd() between
      target_setup_cmd_from_cdb() and transport_handle_cdb_direct() logic.
      
      It also includes adding a handful of new tcm_vhost_cmnd member +
      assignments in vhost_scsi_allocate_cmd() used from cmwq process
      context I/O submission within tcm_vhost_submission_work()
      
      (v2: Use renamed target_submit_cmd_map_sgls)
      Reported-by: NChristoph Hellwig <hch@lst.de>
      Cc: Christoph Hellwig <hch@lst.de>
      Acked-by: NMichael S. Tsirkin <mst@redhat.com>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Stefan Hajnoczi <stefanha@gmail.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      9f0abc15
  19. 18 9月, 2012 2 次提交
  20. 21 8月, 2012 1 次提交
    • M
      tcm_vhost: Fix vhost_scsi_target structure alignment · 6de7145c
      Michael S. Tsirkin 提交于
      Here TRANSPORT_IQN_LEN is 224, which is a multiple of 4.
      Since vhost_tpgt is 2 bytes and abi_version is 4, the total size would
      be 230.  But gcc needs struct size be aligned to first field size, which
      is 4 bytes, so it pads the structure by extra 2 bytes to the total of
      232.
      
      This padding is very undesirable in an ABI:
      - it can not be initialized easily
      - it can not be checked easily
      - it can leak information between kernel and userspace
      
      Simplest solution is probably just to make the padding
      explicit.
      
      (v2: Add check for zero'ed backend->reserved field for VHOST_SCSI_SET_ENDPOINT
           and VHOST_SCSI_CLEAR_ENDPOINT ops as requested by MST)
      Reported-by: NMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      6de7145c