1. 10 May, 2016 1 commit
  2. 17 Aug, 2015 1 commit
  3. 06 Jul, 2015 1 commit
  4. 23 Jun, 2015 1 commit
  5. 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
  6. 01 Jun, 2015 3 commits
    • Nicholas Bellinger's avatar
      target: Drop lun_sep_lock for se_lun->lun_se_dev RCU usage · 4cc987ea
      Nicholas Bellinger authored
      With se_port and t10_alua_tg_pt_gp_member being absored into se_lun,
      there is no need for an extra lock to protect se_lun->lun_se_dev
      assignment.
      
      This patch also converts backend drivers to use call_rcu() release
      to allow any se_device readers to complete.  The call_rcu() instead
      of kfree_rcu() is required here because se_device is embedded into
      the backend driver specific structure.
      
      Also, convert se_lun->lun_stats to use atomic_long_t within the
      target_complete_ok_work() completion callback, and add FIXME for
      transport_lookup_tmr_lun() with se_lun->lun_ref.
      
      Finally, update sbp_update_unit_directory() special case usage with
      proper rcu_dereference_raw() and configfs symlink comment.
      Reported-by: 's avatarChristoph Hellwig <hch@lst.de>
      Reviewed-by: 's avatarHannes Reinecke <hare@suse.de>
      Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
      Cc: Chris Boot <bootc@bootc.net>
      Signed-off-by: 's avatarNicholas Bellinger <nab@linux-iscsi.org>
      4cc987ea
    • Christoph Hellwig's avatar
      target: consolidate backend attribute implementations · 5873c4d1
      Christoph Hellwig authored
      Provide a common sets of dev_attrib attributes for all devices using the
      generic SPC/SBC parsers, and a second one with the minimal required read-only
      attributes for passthrough devices.  The later is only used by pscsi for now,
      but will be wired up for the full-passthrough TCMU use case as well.
      Signed-off-by: 's avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: 's avatarNicholas Bellinger <nab@linux-iscsi.org>
      5873c4d1
    • Christoph Hellwig's avatar
      target: simplify backend driver registration · 0a06d430
      Christoph Hellwig authored
      Rewrite the backend driver registration based on what we did to the fabric
      drivers:  introduce a read-only struct target_bakckend_ops that the driver
      registers, which is then instanciate as a struct target_backend by the
      core.  This allows the ops vector to be smaller and allows us to mark it
      const.  At the same time the registration function can set up the
      configfs attributes, avoiding the need to add additional boilerplate code
      for that to the drivers.
      Signed-off-by: 's avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: 's avatarNicholas Bellinger <nab@linux-iscsi.org>
      0a06d430
  7. 30 May, 2015 2 commits
  8. 14 Apr, 2015 1 commit
    • Akinobu Mita's avatar
      target/rd: Don't pass incomplete scatterlist entries to sbc_dif_verify_* · bfd9a53e
      Akinobu Mita authored
      The scatterlist for protection information which is passed to
      sbc_dif_verify_read() or sbc_dif_verify_write() requires that
      neighboring scatterlist entries are contiguous or chained so that they
      can be iterated by sg_next().
      
      However, the protection information for RD-MCP backends could be located
      in the multiple scatterlist arrays when the ramdisk space is too large.
      So if the read/write request straddles this boundary, sbc_dif_verify_read()
      or sbc_dif_verify_write() can't iterate all scatterlist entries.
      
      This problem can be fixed by chaining protection information scatterlist
      at creation time.  For the architectures which don't support sg chaining
      (i.e. !CONFIG_ARCH_HAS_SG_CHAIN), fix it by allocating temporary
      scatterlist if needed.
      Signed-off-by: 's avatarAkinobu Mita <akinobu.mita@gmail.com>
      Cc: Nicholas Bellinger <nab@linux-iscsi.org>
      Cc: Sagi Grimberg <sagig@dev.mellanox.co.il>
      Cc: "Martin K. Petersen" <martin.petersen@oracle.com>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>
      Cc: target-devel@vger.kernel.org
      Cc: linux-scsi@vger.kernel.org
      Signed-off-by: 's avatarNicholas Bellinger <nab@linux-iscsi.org>
      bfd9a53e
  9. 08 Apr, 2015 2 commits
  10. 09 Jan, 2015 1 commit
  11. 01 Dec, 2014 1 commit
    • Nicholas Bellinger's avatar
      target/rd: Convert to external rd_mcp_backend_dev_attrs · 03a62745
      Nicholas Bellinger authored
      This patch converts RAMDISK to use an external set of device attributes,
      and utilizes target_core_backend_configfs.h macros to generate a default
      set of configfs extended-attr handlers.
      
      It calls target_core_setup_sub_cits() to setup the initial config_item_type
      based on existing target_core_configfs.c defaults, and using configfs_attribute
      generated by DEF_TB_DEFAULT_ATTRIBS(rc_mcp) populates rd_mcp_backend_dev_attrs[]
      
      It introduces no functional change for existing RD_MCP device attributes.
      Signed-off-by: 's avatarNicholas Bellinger <nab@linux-iscsi.org>
      03a62745
  12. 07 Apr, 2014 1 commit
  13. 18 Jan, 2014 3 commits
    • Nicholas Bellinger's avatar
      target/rd: Add DIF protection into rd_execute_rw · 6e611119
      Nicholas Bellinger authored
      This patch adds support for DIF protection into rd_execute_rw() code
      for WRITE/READ I/O using sbc_dif_verify_[write,read]() logic.
      
      It also adds rd_get_prot_table() for locating protection SGLs
      assoicated with the ramdisk backend device.
      
      v2 changes:
        - Make rd_execute_rw() to u32 sectors count instead of sector_t
        - Drop SCF_PROT usage
      
      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: 's avatarNicholas Bellinger <nab@linux-iscsi.org>
      6e611119
    • Nicholas Bellinger's avatar
      target/rd: Add support for protection SGL setup + release · d7e8eb5d
      Nicholas Bellinger authored
      This patch adds rd_build_prot_space() + rd_release_prot_space() logic
      to setup + release protection information scatterlists.
      
      It also adds rd_init_prot() + rd_free_prot() se_subsystem_api
      callbacks used by target core code for setup + release of
      protection information.
      
      v2 changes:
        - Drop unused sg_table from rd_release_prot_space (Wei)
        - Drop rd_release_prot_space call from rd_free_device
      
      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: 's avatarNicholas Bellinger <nab@linux-iscsi.org>
      d7e8eb5d
    • Nicholas Bellinger's avatar
      target/rd: Refactor rd_build_device_space + rd_release_device_space · 4442dc8a
      Nicholas Bellinger authored
      This patch refactors rd_build_device_space() + rd_release_device_space()
      into rd_allocate_sgl_table() + rd_release_device_space() so that they
      may be used seperatly for setup + release of protection information
      scatterlists.
      
      Also add explicit memset of pages within rd_allocate_sgl_table() based
      upon passed 'init_payload' value.
      
      v2 changes:
        - Drop unused sg_table from rd_release_device_space (Wei)
      
      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: 's avatarNicholas Bellinger <nab@linux-iscsi.org>
      4442dc8a
  14. 12 Nov, 2013 1 commit
  15. 10 Sep, 2013 1 commit
  16. 09 Sep, 2013 1 commit
    • Nicholas Bellinger's avatar
      target: Allow sbc_ops->execute_rw() to accept SGLs + data_direction · a82a9538
      Nicholas Bellinger authored
      COMPARE_AND_WRITE expects to be able to send down a DMA_FROM_DEVICE
      to obtain the necessary READ payload for comparision against the
      first half of the WRITE payload containing the verify user data.
      
      Currently virtual backends expect to internally reference SGLs,
      SGL nents, and data_direction, so change IBLOCK, FILEIO and RD
      sbc_ops->execute_rw() to accept this values as function parameters.
      
      Also add default sbc_execute_rw() handler for the typical case for
      cmd->execute_rw() submission using cmd->t_data_sg, cmd->t_data_nents,
      and cmd->data_direction).
      
      v2 Changes:
        - Add SCF_COMPARE_AND_WRITE command flag
        - Use sbc_execute_rw() for normal cmd->execute_rw() submission
          with expected se_cmd members.
      
      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: James Bottomley <JBottomley@Parallels.com>
      Cc: Nicholas Bellinger <nab@linux-iscsi.org>
      Signed-off-by: 's avatarNicholas Bellinger <nab@daterainc.com>
      a82a9538
  17. 14 Jun, 2013 1 commit
  18. 11 May, 2013 1 commit
    • Nicholas Bellinger's avatar
      target/rd: Add ramdisk bit for NULLIO operation · 52c07423
      Nicholas Bellinger authored
      This patch adds a rd_nullio parameter that allows RAMDISK_MCP backends
      to function in NULLIO mode, where all se_cmd I/O is immediately completed
      in rd_execute_rw() without actually performing the SGL memory copy.
      
      This is useful for performance testing when the ramdisk SGL memory copy
      begins to eat lots of cycles during heavy small block workloads, so allow
      this bit to be enabled when necessary on a per rd_dev basis.
      Signed-off-by: 's avatarNicholas Bellinger <nab@linux-iscsi.org>
      52c07423
  19. 13 Feb, 2013 2 commits
  20. 27 Nov, 2012 1 commit
  21. 06 Nov, 2012 5 commits
  22. 17 Sep, 2012 2 commits
  23. 16 Jul, 2012 2 commits
  24. 06 May, 2012 3 commits
  25. 14 Apr, 2012 1 commit