1. 12 6月, 2014 1 次提交
    • N
      vhost-scsi: Include prot_bytes into expected data transfer length · 9f977ef7
      Nicholas Bellinger 提交于
      This patch updates vhost_scsi_get_tag() to accept the combined
      expected data transfer length + T10 PI bytes as the value passed
      into target_submit_cmd().
      
      This is required now that target-core logic in commit 14ef9200
      expects to subtract se_cmd->prot_length from se_cmd->data_length.
      
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Michael S. Tsirkin <mst@redhat.com>
      Cc: Martin K. Petersen <martin.petersen@oracle.com>
      Cc: Sagi Grimberg <sagig@mellanox.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      9f977ef7
  2. 03 6月, 2014 4 次提交
    • N
      vhost/scsi: Enable T10 PI IOV -> SGL memory mapping · 95e7c434
      Nicholas Bellinger 提交于
      This patch updates vhost_scsi_handle_vq() to check for the existance
      of virtio_scsi_cmd_req_pi comparing vq->iov[0].iov_len in order to
      calculate seperate data + protection SGLs from data_num.
      
      Also update tcm_vhost_submission_work() to pass the pre-allocated
      cmd->tvc_prot_sgl[] memory into target_submit_cmd_map_sgls(), and
      update vhost_scsi_get_tag() parameters to accept scsi_tag, lun, and
      task_attr.
      
      Cc: Michael S. Tsirkin <mst@redhat.com>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Martin K. Petersen <martin.petersen@oracle.com>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Hannes Reinecke <hare@suse.de>
      Cc: Sagi Grimberg <sagig@dev.mellanox.co.il>
      Cc: H. Peter Anvin <hpa@zytor.com>
      Acked-by: NMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      95e7c434
    • N
      vhost/scsi: Add T10 PI IOV -> SGL memory mapping logic · e31885dd
      Nicholas Bellinger 提交于
      This patch adds vhost_scsi_map_iov_to_prot() to perform the mapping of
      T10 data integrity memory between virtio iov + struct scatterlist using
      get_user_pages_fast() following existing code.
      
      As with vhost_scsi_map_iov_to_sgl(), this does sanity checks against the
      total prot_sgl_count vs. pre-allocated SGLs, and loops across protection
      iovs using vhost_scsi_map_to_sgl() to perform the actual memory mapping.
      
      Also update tcm_vhost_release_cmd() to release associated tvc_prot_sgl[]
      struct page.
      
      Cc: Michael S. Tsirkin <mst@redhat.com>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Martin K. Petersen <martin.petersen@oracle.com>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Hannes Reinecke <hare@suse.de>
      Cc: Sagi Grimberg <sagig@dev.mellanox.co.il>
      Cc: H. Peter Anvin <hpa@zytor.com>
      Acked-by: NMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      e31885dd
    • N
      vhost/scsi: Add preallocation of protection SGLs · b1935f68
      Nicholas Bellinger 提交于
      This patch updates tcm_vhost_make_nexus() to pre-allocate per descriptor
      tcm_vhost_cmd->tvc_prot_sgl[] used to expose protection SGLs from within
      virtio-scsi guest memory to vhost-scsi.
      
      Cc: Michael S. Tsirkin <mst@redhat.com>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Martin K. Petersen <martin.petersen@oracle.com>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Hannes Reinecke <hare@suse.de>
      Acked-by: NMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      b1935f68
    • N
      vhost/scsi: Move sanity check into vhost_scsi_map_iov_to_sgl · 5a01d082
      Nicholas Bellinger 提交于
      Move the overflow check for sgl_count > TCM_VHOST_PREALLOC_SGLS into
      vhost_scsi_map_iov_to_sgl() so that it's based on the total number
      of SGLs for all IOVs, instead of single IOVs.
      
      Also, rename TCM_VHOST_PREALLOC_PAGES -> TCM_VHOST_PREALLOC_UPAGES
      to better describe pointers to user-space pages.
      
      Cc: Michael S. Tsirkin <mst@redhat.com>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Martin K. Petersen <martin.petersen@oracle.com>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Hannes Reinecke <hare@suse.de>
      Acked-by: NMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      5a01d082
  3. 07 4月, 2014 2 次提交
    • N
      target: Pass in transport supported PI at session initialization · e70beee7
      Nicholas Bellinger 提交于
      In order to support local WRITE_INSERT + READ_STRIP operations for
      non PI enabled fabrics, the fabric driver needs to be able signal
      what protection offload operations are supported.
      
      This is done at session initialization time so the modes can be
      signaled by individual se_wwn + se_portal_group endpoints, as well
      as optionally across different transports on the same endpoint.
      
      For iser-target, set TARGET_PROT_ALL if the underlying ib_device
      has already signaled PI offload support, and allow this to be
      exposed via a new iscsit_transport->iscsit_get_sup_prot_ops()
      callback.
      
      For loopback, set TARGET_PROT_ALL to signal SCSI initiator mode
      operation.
      
      For all other drivers, set TARGET_PROT_NORMAL to disable fabric
      level PI.
      
      Cc: Martin K. Petersen <martin.petersen@oracle.com>
      Cc: Sagi Grimberg <sagig@mellanox.com>
      Cc: Or Gerlitz <ogerlitz@mellanox.com>
      Cc: Quinn Tran <quinn.tran@qlogic.com>
      Cc: Giridhar Malavali <giridhar.malavali@qlogic.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      e70beee7
    • N
      target: Add TFO->abort_task for aborted task resources release · 131e6abc
      Nicholas Bellinger 提交于
      Now that TASK_ABORTED status is not generated for all cases by
      TMR ABORT_TASK + LUN_RESET, a new TFO->abort_task() caller is
      necessary in order to give fabric drivers a chance to unmap
      hardware / software resources before the se_cmd descriptor is
      released via the normal TFO->release_cmd() codepath.
      
      This patch adds TFO->aborted_task() in core_tmr_abort_task()
      in place of the original transport_send_task_abort(), and
      also updates all fabric drivers to implement this caller.
      
      The fabric drivers that include changes to perform cleanup
      via ->aborted_task() are:
      
        - iscsi-target
        - iser-target
        - srpt
        - tcm_qla2xxx
      
      The fabric drivers that currently set ->aborted_task() to
      NOPs are:
      
        - loopback
        - tcm_fc
        - usb-gadget
        - sbp-target
        - vhost-scsi
      
      For the latter five, there appears to be no additional cleanup
      required before invoking TFO->release_cmd() to release the
      se_cmd descriptor.
      
      v2 changes:
        - Move ->aborted_task() call into transport_cmd_finish_abort (Alex)
      
      Cc: Alex Leung <amleung21@yahoo.com>
      Cc: Mark Rustad <mark.d.rustad@intel.com>
      Cc: Roland Dreier <roland@kernel.org>
      Cc: Vu Pham <vu@mellanox.com>
      Cc: Chris Boot <bootc@bootc.net>
      Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
      Cc: Michael S. Tsirkin <mst@redhat.com>
      Cc: Giridhar Malavali <giridhar.malavali@qlogic.com>
      Cc: Saurav Kashyap <saurav.kashyap@qlogic.com>
      Cc: Quinn Tran <quinn.tran@qlogic.com>
      Cc: Sagi Grimberg <sagig@mellanox.com>
      Cc: Or Gerlitz <ogerlitz@mellanox.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      131e6abc
  4. 25 2月, 2014 1 次提交
  5. 24 1月, 2014 1 次提交
    • K
      percpu_ida: Make percpu_ida_alloc + callers accept task state bitmask · 6f6b5d1e
      Kent Overstreet 提交于
      This patch changes percpu_ida_alloc() + callers to accept task state
      bitmask for prepare_to_wait() for code like target/iscsi that needs
      it for interruptible sleep, that is provided in a subsequent patch.
      
      It now expects TASK_UNINTERRUPTIBLE when the caller is able to sleep
      waiting for a new tag, or TASK_RUNNING when the caller cannot sleep,
      and is forced to return a negative value when no tags are available.
      
      v2 changes:
        - Include blk-mq + tcm_fc + vhost/scsi + target/iscsi changes
        - Drop signal_pending_state() call
      v3 changes:
        - Only call prepare_to_wait() + finish_wait() when != TASK_RUNNING
          (PeterZ)
      Reported-by: NLinus Torvalds <torvalds@linux-foundation.org>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Jens Axboe <axboe@kernel.dk>
      Signed-off-by: NKent Overstreet <kmo@daterainc.com>
      Cc: <stable@vger.kernel.org> #3.12+
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      6f6b5d1e
  6. 18 1月, 2014 1 次提交
    • N
      target: Add protection SGLs to target_submit_cmd_map_sgls · def2b339
      Nicholas Bellinger 提交于
      This patch adds support to target_submit_cmd_map_sgls() for
      accepting 'sgl_prot' + 'sgl_prot_count' parameters for
      DIF protection information.
      
      Note the passed parameters are stored at se_cmd->t_prot_sg
      and se_cmd->t_prot_nents respectively.
      
      Also, update tcm_loop and vhost-scsi fabrics usage of
      target_submit_cmd_map_sgls() to take into account the
      new parameters.
      
      Cc: Martin K. Petersen <martin.petersen@oracle.com>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Hannes Reinecke <hare@suse.de>
      Cc: Sagi Grimberg <sagig@mellanox.com>
      Cc: Or Gerlitz <ogerlitz@mellanox.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      def2b339
  7. 07 12月, 2013 1 次提交
  8. 26 10月, 2013 1 次提交
    • N
      vhost/scsi: Fix incorrect usage of get_user_pages_fast write parameter · 60a01f55
      Nicholas Bellinger 提交于
      This patch addresses a long-standing bug where the get_user_pages_fast()
      write parameter used for setting the underlying page table entry permission
      bits was incorrectly set to write=1 for data_direction=DMA_TO_DEVICE, and
      passed into get_user_pages_fast() via vhost_scsi_map_iov_to_sgl().
      
      However, this parameter is intended to signal WRITEs to pinned userspace
      PTEs for the virtio-scsi DMA_FROM_DEVICE -> READ payload case, and *not*
      for the virtio-scsi DMA_TO_DEVICE -> WRITE payload case.
      
      This bug would manifest itself as random process segmentation faults on
      KVM host after repeated vhost starts + stops and/or with lots of vhost
      endpoints + LUNs.
      
      Cc: Stefan Hajnoczi <stefanha@redhat.com>
      Cc: Michael S. Tsirkin <mst@redhat.com>
      Cc: Asias He <asias@redhat.com>
      Cc: <stable@vger.kernel.org> # 3.6+
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      60a01f55
  9. 17 10月, 2013 1 次提交
  10. 02 10月, 2013 1 次提交
  11. 18 9月, 2013 2 次提交
  12. 11 9月, 2013 1 次提交
  13. 10 9月, 2013 2 次提交
  14. 11 7月, 2013 2 次提交
  15. 08 7月, 2013 1 次提交
  16. 07 7月, 2013 7 次提交
  17. 21 6月, 2013 2 次提交
    • N
      vhost/scsi: Convert to se_cmd->cmd_kref TARGET_SCF_ACK_KREF usage · 084ed45b
      Nicholas Bellinger 提交于
      This patch coverts vhost/scsi to se_cmd->cmd_kref TARGET_SCF_ACK_KREF
      usage, instead of assuming that vhost_scsi_free_cmd() is always called
      before TCM processing is completed in the response fast path.
      
      This includes adding vhost_scsi_check_stop_free() -> target_put_sess_cmd()
      to perform the second se_cmd->cmd_kref put, and moving vhost_scsi_free_cmd()
      resource release into tcm_vhost_release_cmd() that is invoked once the last
      se_cmd->cmd_kref put occurs.
      
      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>
      084ed45b
    • 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
  18. 07 5月, 2013 1 次提交
  19. 02 5月, 2013 3 次提交
  20. 01 5月, 2013 4 次提交
  21. 25 4月, 2013 1 次提交