1. 19 Apr, 2015 1 commit
  2. 03 Oct, 2014 1 commit
    • Andy Grover's avatar
      target: Add a user-passthrough backstore · 7c9e7a6f
      Andy Grover authored
      Add a LIO storage engine that presents commands to userspace for execution.
      This would allow more complex backstores to be implemented out-of-kernel,
      and also make experimentation a-la FUSE (but at the SCSI level -- "SUSE"?)
      possible.
      
      It uses a mmap()able UIO device per LUN to share a command ring and data
      area. The commands are raw SCSI CDBs and iovs for in/out data. The command
      ring is also reused for returning scsi command status and optional sense
      data.
      
      This implementation is based on Shaohua Li's earlier version but heavily
      modified. Differences include:
      
      * Shared memory allocated by kernel, not locked-down user pages
      * Single ring for command request and response
      * Offsets instead of embedded pointers
      * Generic SCSI CDB passthrough instead of per-cmd specialization in ring
        format.
      * Uses UIO device instead of anon_file passed in mailbox.
      * Optional in-kernel handling of some commands.
      
      The main reason for these differences is to permit greater resiliency
      if the user process dies or hangs.
      
      Things not yet implemented (on purpose):
      
      * Zero copy. The data area is flexible enough to allow page flipping or
        backend-allocated pages to be used by fabrics, but it's not clear these
        are performance wins. Can come later.
      * Out-of-order command completion by userspace. Possible to add by just
        allowing userspace to change cmd_id in rsp cmd entries, but currently
        not supported.
      * No locks between kernel cmd submission and completion routines. Sounds
        like it's possible, but this can come later.
      * Sparse allocation of mmaped area. Current code vmallocs the whole thing.
        If the mapped area was larger and not fully mapped then the driver would
        have more freedom to change cmd and data area sizes based on demand.
      
      Current code open issues:
      
      * The use of idrs may be overkill -- we maybe can replace them with a
        simple counter to generate cmd_ids, and a hash table to get a cmd_id's
        associated pointer.
      * Use of a free-running counter for cmd ring instead of explicit modulo
        math. This would require power-of-2 cmd ring size.
      
      (Add kconfig depends NET - Randy)
      Signed-off-by: 's avatarAndy Grover <agrover@redhat.com>
      Signed-off-by: 's avatarNicholas Bellinger <nab@linux-iscsi.org>
      7c9e7a6f
  3. 10 Sep, 2013 1 commit
    • 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
  4. 16 Jul, 2012 3 commits
  5. 09 May, 2012 1 commit
    • Chris Boot's avatar
      sbp-target: Initial merge of firewire/ieee-1394 target mode support · a511ce33
      Chris Boot authored
      The FireWire SBP-2 Target is a driver for using an IEEE-1394 connection
      as a SCSI transport. This module uses the SCSI Target framework to
      expose LUNs to other machines attached to a FireWire bus, in effect
      acting as a FireWire hard disk similar to FireWire Target Disk mode
      on many Apple computers.
      
      This commit contains the squashed pull from Chris Boot's SBP-2-Target:
      
            https://github.com/bootc/Linux-SBP-2-Target.git patch-v3
      
      firewire-sbp-target: Add sbp_base.h header
      firewire-sbp-target: Add sbp_configfs.c
      firewire-sbp-target: Add sbp_fabric.{c,h}
      firewire-sbp-target: Add sbp_management_agent.{c,h}
      firewire-sbp-target: Add sbp_login.{c,h}
      firewire-sbp-target: Add sbp_target_agent.{c,h}
      firewire-sbp-target: Add sbp_scsi_cmnd.{c,h}
      firewire-sbp-target: Add to target Kconfig and Makefile
      
      Also add bootc's entry to the MAINTAINERS file.  Great work Chris !!
      Signed-off-by: 's avatarChris Boot <bootc@bootc.net>
      Acked-by: 's avatarStefan Richter <stefanr@s5r6.in-berlin.de>
      Cc: Andy Grover <agrover@redhat.com>
      Cc: Clemens Ladisch <clemens@ladisch.de>
      Signed-off-by: 's avatarNicholas Bellinger <nab@linux-iscsi.org>
      a511ce33
  6. 23 Oct, 2011 1 commit
  7. 26 Jul, 2011 1 commit
    • Nicholas Bellinger's avatar
      iscsi-target: Add iSCSI fabric support for target v4.1 · e48354ce
      Nicholas Bellinger authored
      The Linux-iSCSI.org target module is a full featured in-kernel
      software implementation of iSCSI target mode (RFC-3720) for the
      current WIP mainline target v4.1 infrastructure code for the v3.1
      kernel.  More information can be found here:
      
      http://linux-iscsi.org/wiki/ISCSI
      
      This includes support for:
      
         * RFC-3720 defined request / response state machines and support for
           all defined iSCSI operation codes from Section 10.2.1.2 using libiscsi
           include/scsi/iscsi_proto.h PDU definitions
         * Target v4.1 compatible control plane using the generic layout in
           target_core_fabric_configfs.c and fabric dependent attributes
           within /sys/kernel/config/target/iscsi/ subdirectories.
         * Target v4.1 compatible iSCSI statistics based on RFC-4544 (iSCSI MIBS)
         * Support for IPv6 and IPv4 network portals in M:N mapping to TPGs
         * iSCSI Error Recovery Hierarchy support
         * Per iSCSI connection RX/TX thread pair scheduling affinity
         * crc32c + crc32c_intel SSEv4 instruction offload support using libcrypto
         * CHAP Authentication support using libcrypto
         * Conversion to use internal SGl allocation with iscsit_alloc_buffs() ->
           transport_generic_map_mem_to_cmd()
      
      (nab: Fix iscsi_proto.h struct scsi_lun usage from linux-next in commit:
            iscsi: Use struct scsi_lun in iscsi structs instead of u8[8])
      (nab: Fix 32-bit compile warnings)
      Reviewed-by: 's avatarChristoph Hellwig <hch@lst.de>
      Reviewed-by: 's avatarAndy Grover <agrover@redhat.com>
      Acked-by: 's avatarRoland Dreier <roland@kernel.org>
      Signed-off-by: 's avatarNicholas A. Bellinger <nab@linux-iscsi.org>
      e48354ce
  8. 17 May, 2011 1 commit
    • Kiran Patil's avatar
      [SCSI] tcm_fc: Adding FC_FC4 provider (tcm_fc) for FCoE target (TCM - target core) support · 3699d92a
      Kiran Patil authored
      This is a comprehensive patch for FC-FC4 provider. tcm_fc is a FC-FC4
      provider which glues target core (TCM) with Fiber channel library
      (libfc). tcm_fc uses existing FC4 provider hooks from Fiber channel
      library. This Fiber channel library is used by FCoE (transport - FC
      over Ethernet) protocol driver as well.
      
      Combination of modules such as Fiber channel library, tcm_fc, TCM
      target core, and FCoE protocol driver enables functional FCoE target.
      
      This patch includes initial commit for tcm_fc plus additional
      enhancement, bug fixes.
      
      This tcm_fc module essentially contains 3 entry points such as "prli",
      "prlo", "recv".  When process login request (ELS_PRLI) request is
      received, Fiber channel library (libfc) module calls passive providers
      (FC-FC4, tcm_fc) (if any registered) "prli" function. Likewise when
      LOGO request is received, "prlo" function of passive provider is
      invoked by libfc.  For all other request (e.g. any read/write, task
      management, LUN inquiry commands), "recv" function of passiver
      provider is invoked by libfc. Those passive providers "prli, prlo,
      recv" functions interact with TCM target core for requested operation.
      
      This module was primarily developed by "Joe Eykholt" and there were
      significant contributions from the people listed under signed-off.
      Signed-off-by: 's avatarJoe Eykholt <jeykholt@cisco.com>
      Signed-off-by: 's avatarNicholas A. Bellinger <nab@linux-iscsi.org>
      Signed-off-by: 's avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: 's avatarYi Zou <yi.zou@intel.com>
      Signed-off-by: 's avatarKiran Patil <kiran.patil@intel.com>
      Acked-by: 's avatarRobert Love <robert.w.love@intel.com>
      Signed-off-by: 's avatarJames Bottomley <jbottomley@parallels.com>
      Signed-off-by: 's avatarJames Bottomley <James.Bottomley@suse.de>
      3699d92a
  9. 23 Mar, 2011 3 commits
    • Nicholas Bellinger's avatar
      [SCSI] tcm_loop: Add multi-fabric Linux/SCSI LLD fabric module · 3703b2c5
      Nicholas Bellinger authored
      This patch adds the TCM_Loop Linux/SCSI LLD fabric module for
      accessing TCM device backstores as locally accessable SCSI LUNs in
      virtual SAS, FC, and iSCSI Target ports using the generic fabric
      TransportID and Target Port WWN naming handlers from TCM's
      target_core_fabric_lib.c The TCM_Loop module uses the generic fabric
      configfs infratructure provided by target_core_fabric_configfs.c and
      adds a module dependent attribute for the creation/release of the
      virtual I_T Nexus connected the TCM_Loop Target and Initiator Ports.
      
      TCM_Loop can also be used with scsi-generic and BSG drivers so that
      STGT userspace fabric modules, QEMU-KVM and other hypervisor SCSI
      passthrough support can access TCM device backstore and control CDB
      emulation.
      
      For more information please see:
      
      http://linux-iscsi.org/wiki/Tcm_loop
      
      [jejb: fixed up checkpatch stuff]
      Signed-off-by: 's avatarNicholas A. Bellinger <nab@linux-iscsi.org>
      Reviewed-by: 's avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: 's avatarJames Bottomley <James.Bottomley@suse.de>
      3703b2c5
    • Nicholas Bellinger's avatar
      [SCSI] target: add initial statistics · 12d23384
      Nicholas Bellinger authored
      This patch adds a target_core_mib.c statistics conversion for
      backend context struct se_subsystem_dev + struct se_device config_group
      based statistics in target_core_device.c using CONFIGFS_EATTR()
      based struct config_item_types from target_core_stat.c code.
      
      The conversion from backend /proc/scsi_target/mib/ context output to configfs
      default groups+attributes include scsi_dev, scsi_lu, and scsi_tgt_dev output
      from within individual:
      
      	/sys/kernel/config/target/core/$HBA/DEV/
      
      The legacy procfs output now appear as individual configfs attributes under:
      
      *) $HBA/$DEV/statistics/scsi_dev:
      
      |-- indx
      |-- inst
      |-- ports
      `-- role
      
      *) $HBA/$DEV/statistics/scsi_lu:
      
      |-- creation_time
      |-- dev
      |-- dev_type
      |-- full_stat
      |-- hs_num_cmds
      |-- indx
      |-- inst
      |-- lu_name
      |-- lun
      |-- num_cmds
      |-- prod
      |-- read_mbytes
      |-- resets
      |-- rev
      |-- state_bit
      |-- status
      |-- vend
      `-- write_mbytes
      
      *) $HBA/$DEV/statistics/scsi_tgt_dev:
      
      |-- indx
      |-- inst
      |-- non_access_lus
      |-- num_lus
      |-- resets
      `-- status
      
      The conversion from backend /proc/scsi_target/mib/ context output to configfs
      default groups+attributes include scsi_port, scsi_tgt_port and scsi_transport
      output from within individual:
      
      	/sys/kernel/config/target/fabric/$WWN/tpgt_$TPGT/lun/lun_$LUN_ID/statistics/
      
      The legacy procfs output now appear as individual configfs attributes under:
      
      *) fabric/$WWN/tpgt_$TPGT/lun/lun_$LUN_ID/statistics/scsi_port
      
      |-- busy_count
      |-- dev
      |-- indx
      |-- inst
      `-- role
      
      *) fabric/$WWN/tpgt_$TPGT/lun/lun_$LUN_ID/statistics/scsi_tgt_port
      
      |-- dev
      |-- hs_in_cmds
      |-- in_cmds
      |-- indx
      |-- inst
      |-- name
      |-- port_index
      |-- read_mbytes
      `-- write_mbytes
      
      *) fabric/$WWN/tpgt_$TPGT/lun/lun_$LUN_ID/statistics/scsi_transport
      
      |-- dev_name
      |-- device
      |-- indx
      `-- inst
      
      The conversion from backend /proc/scsi_target/mib/ context output to configfs
      default groups+attributes include scsi_att_intr_port and scsi_auth_intr output
      from within individual:
      
      	/sys/kernel/config/target/fabric/$WWN/tpgt_$TPGT/acls/$INITIATOR_WWN/lun_$LUN_ID/statistics/
      
      The legacy procfs output now appear as individual configfs attributes under:
      
      *) acls/$INITIATOR_WWN/lun_$LUN_ID/statistics/scsi_att_intr_port
      
      |-- dev
      |-- indx
      |-- inst
      |-- port
      |-- port_auth_indx
      `-- port_ident
      
      *) acls/$INITIATOR_WWN/lun_$LUN_ID/statistics/scsi_auth_intr
      
      |-- att_count
      |-- creation_time
      |-- dev
      |-- dev_or_port
      |-- hs_num_cmds
      |-- indx
      |-- inst
      |-- intr_name
      |-- map_indx
      |-- num_cmds
      |-- port
      |-- read_mbytes
      |-- row_status
      `-- write_mbytes
      
      Also, this includes adding struct target_fabric_configfs_template->
      tfc_wwn_fabric_stats_cit and ->tfc_tpg_nacl_stat_cit respectively for
      use during target_core_fabric_configfs.c:target_fabric_setup_cits()
      Signed-off-by: 's avatarNicholas A. Bellinger <nab@linux-iscsi.org>
      Signed-off-by: 's avatarJames Bottomley <James.Bottomley@suse.de>
      12d23384
    • Christoph Hellwig's avatar
      [SCSI] target: remove EXTRA_CFLAGS · 5e8de4f3
      Christoph Hellwig authored
      Add the current directory is superflous in general, and no includes in
      drivers/scsi are needed either.
      Signed-off-by: 's avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: 's avatarNicholas A. Bellinger <nab@linux-iscsi.org>
      Signed-off-by: 's avatarJames Bottomley <James.Bottomley@suse.de>
      5e8de4f3
  10. 12 Feb, 2011 1 commit
  11. 14 Jan, 2011 1 commit
    • Nicholas Bellinger's avatar
      [SCSI] target: Add LIO target core v4.0.0-rc6 · c66ac9db
      Nicholas Bellinger authored
      LIO target is a full featured in-kernel target framework with the
      following feature set:
      
      High-performance, non-blocking, multithreaded architecture with SIMD
      support.
      
      Advanced SCSI feature set:
      
          * Persistent Reservations (PRs)
          * Asymmetric Logical Unit Assignment (ALUA)
          * Protocol and intra-nexus multiplexing, load-balancing and failover (MC/S)
          * Full Error Recovery (ERL=0,1,2)
          * Active/active task migration and session continuation (ERL=2)
          * Thin LUN provisioning (UNMAP and WRITE_SAMExx)
      
      Multiprotocol target plugins
      
      Storage media independence:
      
          * Virtualization of all storage media; transparent mapping of IO to LUNs
          * No hard limits on number of LUNs per Target; maximum LUN size ~750 TB
          * Backstores: SATA, SAS, SCSI, BluRay, DVD, FLASH, USB, ramdisk, etc.
      
      Standards compliance:
      
          * Full compliance with IETF (RFC 3720)
          * Full implementation of SPC-4 PRs and ALUA
      
      Significant code cleanups done by Christoph Hellwig.
      
      [jejb: fix up for new block bdev exclusive interface. Minor fixes from
       Randy Dunlap and Dan Carpenter.]
      Signed-off-by: 's avatarNicholas A. Bellinger <nab@linux-iscsi.org>
      Signed-off-by: 's avatarJames Bottomley <James.Bottomley@suse.de>
      c66ac9db