1. 13 May, 2016 1 commit
  2. 11 Sep, 2015 1 commit
    • Nicholas Bellinger's avatar
      target: Attach EXTENDED_COPY local I/O descriptors to xcopy_pt_sess · 4416f89b
      Nicholas Bellinger authored
      This patch is a >= v4.1 regression bug-fix where control CDB
      emulation logic in commit 38b57f82 now expects a se_cmd->se_sess
      pointer to exist when determining T10-PI support is to be exposed
      for initiator host ports.
      
      To address this bug, go ahead and add locally generated se_cmd
      descriptors for copy-offload block-copy to it's own stand-alone
      se_session nexus, while the parent EXTENDED_COPY se_cmd descriptor
      remains associated with it's originating se_cmd->se_sess nexus.
      
      Note a valid se_cmd->se_sess is also required for future support
      of WRITE_INSERT and READ_STRIP software emulation when submitting
      backend I/O to se_device that exposes T10-PI suport.
      Reported-by: 's avatarAlex Gorbachev <ag@iss-integration.com>
      Tested-by: 's avatarAlex Gorbachev <ag@iss-integration.com>
      Cc: "Martin K. Petersen" <martin.petersen@oracle.com>
      Cc: Hannes Reinecke <hare@suse.de>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Doug Gilbert <dgilbert@interlog.com>
      Cc: <stable@vger.kernel.org> # v4.1+
      Signed-off-by: 's avatarNicholas Bellinger <nab@linux-iscsi.org>
      4416f89b
  3. 02 Jun, 2015 1 commit
    • Bart Van Assche's avatar
      target: Minimize SCSI header #include directives · ba929992
      Bart Van Assche authored
      Only include SCSI initiator header files in target code that needs
      these header files, namely the SCSI pass-through code and the tcm_loop
      driver. Change SCSI_SENSE_BUFFERSIZE into TRANSPORT_SENSE_BUFFER in
      target code because the former is intended for initiator code and the
      latter for target code. With this patch the only initiator include
      directives in target code that remain are as follows:
      
      $ git grep -nHE 'include .scsi/(scsi.h|scsi_host.h|scsi_device.h|scsi_cmnd.h)' drivers/target drivers/infiniband/ulp/{isert,srpt} drivers/usb/gadget/legacy/tcm_*.[ch] drivers/{vhost,xen} include/{target,trace/events/target.h}
      drivers/target/loopback/tcm_loop.c:29:#include <scsi/scsi.h>
      drivers/target/loopback/tcm_loop.c:31:#include <scsi/scsi_host.h>
      drivers/target/loopback/tcm_loop.c:32:#include <scsi/scsi_device.h>
      drivers/target/loopback/tcm_loop.c:33:#include <scsi/scsi_cmnd.h>
      drivers/target/target_core_pscsi.c:39:#include <scsi/scsi_device.h>
      drivers/target/target_core_pscsi.c:40:#include <scsi/scsi_host.h>
      drivers/xen/xen-scsiback.c:52:#include <scsi/scsi_host.h> /* SG_ALL */
      Signed-off-by: 's avatarBart Van Assche <bart.vanassche@sandisk.com>
      Reviewed-by: 's avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: 's avatarJames Bottomley <JBottomley@Odin.com>
      ba929992
  4. 01 Jun, 2015 1 commit
  5. 30 May, 2015 3 commits
  6. 14 Apr, 2015 1 commit
    • Christoph Hellwig's avatar
      target: simplify the target template registration API · 9ac8928e
      Christoph Hellwig authored
      Instead of calling target_fabric_configfs_init() +
      target_fabric_configfs_register() / target_fabric_configfs_deregister()
      target_fabric_configfs_free() from every target driver, rewrite the API
      so that we have simple register/unregister functions that operate on
      a const operations vector.
      
      This patch also fixes a memory leak in several target drivers. Several
      target drivers namely called target_fabric_configfs_deregister()
      without calling target_fabric_configfs_free().
      
      A large part of this patch is based on earlier changes from
      Bart Van Assche <bart.vanassche@sandisk.com>.
      
      (v2: Add a new TF_CIT_SETUP_DRV macro so that the core configfs code
      can declare attributes as either core only or for drivers)
      Signed-off-by: 's avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: 's avatarNicholas Bellinger <nab@linux-iscsi.org>
      9ac8928e
  7. 08 Apr, 2015 2 commits
  8. 26 Mar, 2015 1 commit
  9. 20 Nov, 2014 1 commit
  10. 06 Jun, 2014 1 commit
  11. 09 Jan, 2014 1 commit
  12. 08 Nov, 2013 1 commit
  13. 07 Nov, 2013 2 commits
    • Nicholas Bellinger's avatar
      target: Drop left-over se_lun->lun_cmd_list shutdown code · 4a9a6c8d
      Nicholas Bellinger authored
      Now with percpu refcounting for se_lun in place, go ahead and drop
      the legacy per se_cmd accounting for se_lun shutdown.
      
      This includes __transport_clear_lun_from_sessions(), the associated
      transport_lun_wait_for_tasks() logic, along with a handful of now
      unused se_cmd structure members and ->transport_state bits.
      
      Cc: Kent Overstreet <kmo@daterainc.com>
      Signed-off-by: 's avatarNicholas Bellinger <nab@linux-iscsi.org>
      4a9a6c8d
    • Nicholas Bellinger's avatar
      target: Add percpu refcounting for se_lun access · 5277797d
      Nicholas Bellinger authored
      This patch adds percpu refcounting for se_lun access that allows the
      association of an se_lun + se_cmd in transport_lookup_cmd_lun() to
      occur without an extra list_head for tracking outstanding I/O during
      se_lun shutdown.
      
      This effectively changes se_lun shutdown logic to wait for outstanding
      I/O percpu references to complete in transport_lun_remove_cmd() using
      se_lun->lun_ref_comp, instead of explicitly draining the per se_lun
      command list and waiting for individual se_cmd descriptor processing
      to complete.
      
      Cc: Kent Overstreet <kmo@daterainc.com>
      Signed-off-by: 's avatarNicholas Bellinger <nab@linux-iscsi.org>
      5277797d
  14. 24 Oct, 2013 3 commits
  15. 09 Oct, 2013 3 commits
  16. 01 Oct, 2013 1 commit
  17. 10 Sep, 2013 2 commits
    • Wei Yongjun's avatar
      target: remove unused including <linux/version.h> · 0105c257
      Wei Yongjun authored
      Remove including <linux/version.h> that don't need it.
      Signed-off-by: 's avatarWei Yongjun <yongjun_wei@trendmicro.com.cn>
      Signed-off-by: 's avatarNicholas Bellinger <nab@linux-iscsi.org>
      0105c257
    • Nicholas Bellinger's avatar
      target: Add support for EXTENDED_COPY copy offload emulation · cbf031f4
      Nicholas Bellinger authored
      This patch adds support for EXTENDED_COPY emulation from SPC-3, that
      enables full copy offload target support within both a single virtual
      backend device, and across multiple virtual backend devices.  It also
      functions independent of target fabric, and supports copy offload
      across multiple target fabric ports.
      
      This implemenation supports both EXTENDED_COPY PUSH and PULL models
      of operation, so the actual CDB may be received on either source or
      desination logical unit.
      
      For Target Descriptors, it currently supports the NAA IEEE Registered
      Extended designator (type 0xe4), which allows the reference of target
      ports to occur independent of fabric type using EVPD 0x83 WWNs.
      
      For Segment Descriptors, it currently supports copy from block to
      block (0x02) mode.
      
      It also honors any present SCSI reservations of the destination target
      port.  Note that only Supports No List Identifier (SNLID=1) mode is
      supported.
      
      Also included is basic RECEIVE_COPY_RESULTS with service action type
      OPERATING PARAMETERS (0x03) required for SNLID=1 operation.
      
      v3 changes:
        - Fix incorrect return type in target_do_receive_copy_results()
          (Fengguang)
      
      v2 changes:
        - Use target_alloc_sgl() instead of transport_generic_get_mem()
        - Convert debug output to use pr_debug()
        - Convert target_xcopy_parse_target_descriptors() NAA IEEN WWN
          dump to use 0x%16phN format specification
        - Drop unnecessary xcopy_pt_cmd->xpt_passthrough_wsem, and
          associated usage in xcopy_pt_write_pending() and
          target_xcopy_issue_pt_cmd()
        - Add check for unsupported EXTENDED_COPY(LID4) service action
          bits in target_do_xcopy()
      
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Hannes Reinecke <hare@suse.de>
      Cc: Martin Petersen <martin.petersen@oracle.com>
      Cc: Chris Mason <chris.mason@fusionio.com>
      Cc: Roland Dreier <roland@purestorage.com>
      Cc: Zach Brown <zab@redhat.com>
      Cc: James Bottomley <JBottomley@Parallels.com>
      Cc: Nicholas Bellinger <nab@linux-iscsi.org>
      Signed-off-by: 's avatarNicholas Bellinger <nab@daterainc.com>
      cbf031f4