An error occurred fetching the project authors.
  1. 01 Jun, 2015 4 commits
    • Christoph Hellwig's avatar
      target: simplify backend attribute implementation · 3effdb90
      Christoph Hellwig authored
      Consolidate the implementation of the backend attributes in a single file
      and single function per attribute show/store function instead of splitting
      it into multiple functions in multiple files.
      
      Also use the proper strto* helpers for exposed data types, add macros to
      implement the store methods for the most common data types and share the
      show methods between the two different attribute implementations.
      
      (Fix bogus store_pi_prot_format flag=0 return value - nab)
      Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
      3effdb90
    • 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: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default 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: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
      0a06d430
    • Nicholas Bellinger's avatar
      target: Convert se_node_acl->device_list[] to RCU hlist · 29a05dee
      Nicholas Bellinger authored
      This patch converts se_node_acl->device_list[] table for mappedluns
      to modern RCU hlist_head usage in order to support an arbitrary number
      of node_acl lun mappings.
      
      It converts transport_lookup_*_lun() fast-path code to use RCU read path
      primitives when looking up se_dev_entry.  It adds a new hlist_head at
      se_node_acl->lun_entry_hlist for this purpose.
      
      For transport_lookup_cmd_lun() code, it works with existing per-cpu
      se_lun->lun_ref when associating se_cmd with se_lun + se_device.
      Also, go ahead and update core_create_device_list_for_node() +
      core_free_device_list_for_node() to use ->lun_entry_hlist.
      
      It also converts se_dev_entry->pr_ref_count access to use modern
      struct kref counting, and updates core_disable_device_list_for_node()
      to kref_put() and block on se_deve->pr_comp waiting for outstanding PR
      special-case PR references to drop, then invoke kfree_rcu() to wait
      for the RCU grace period to complete before releasing memory.
      
      So now that se_node_acl->lun_entry_hlist fast path access uses RCU
      protected pointers, go ahead and convert remaining non-fast path
      RCU updater code using ->lun_entry_lock to struct mutex to allow
      callers to block while walking se_node_acl->lun_entry_hlist.
      
      Finally drop the left-over core_clear_initiator_node_from_tpg() that
      originally cleared lun_access during se_node_acl shutdown, as post
      RCU conversion it now becomes duplicated logic.
      Reviewed-by: default avatarHannes Reinecke <hare@suse.de>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Sagi Grimberg <sagig@mellanox.com>
      Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
      Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
      29a05dee
  2. 31 May, 2015 3 commits
  3. 20 Mar, 2015 1 commit
  4. 09 Jan, 2015 1 commit
  5. 02 Dec, 2014 7 commits
    • Nicholas Bellinger's avatar
      target: Add EXPORT_SYMBOL for existing se_dev_set_* · d30cd123
      Nicholas Bellinger authored
      Now that target_core_backend_configfs.h macros will be using these
      se_dev_set attribute functions externally to allow backend drivers
      to populate different attributes, go ahead and add EXPORT_SYMBOL()
      for the existing default set of 30 device attributes.
      
      Also update target_core_backend.h with proper function prototypes.
      Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
      d30cd123
    • Nicholas Bellinger's avatar
      target: Move dev_stat_cit to struct se_subsystem_api · d23ab570
      Nicholas Bellinger authored
      This patch adds support for dev_stat_cit as an external config_item_type
      using TB_CIT_SETUP() helper macro, and sets only ct_group_ops following
      existing code.
      
      It updates target_core_make_subdev() + target_core_setup_dev_attrib_cit() +
      struct target_backend_cits, and drops left-over target_core_dev_stat_cit
      from target_core_configfs.c code and update comments.
      
      This patch introduces no functional change from existing code.
      Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
      d23ab570
    • Nicholas Bellinger's avatar
      target: Move dev_alua_tg_pt_gps_cit to struct se_subsystem_api · 72aca57b
      Nicholas Bellinger authored
      This patch adds support for dev_alua_tg_pt_gps_cit as an external config_item_type
      using TB_CIT_SETUP() helper macro, and sets only ct_group_ops following
      existing code.
      
      It updates target_core_make_subdev() + target_core_setup_dev_attrib_cit() +
      struct target_backend_cits, and drops left-over target_core_dev_alua_tg_pt_gps_cit
      from target_core_configfs.c code and update comments.
      
      This patch introduces no functional change from existing code.
      Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
      72aca57b
    • Nicholas Bellinger's avatar
      target: Move dev_wwn_cit to struct se_subsystem_api · f8d389c6
      Nicholas Bellinger authored
      This patch adds support for dev_wwn_cit as an external config_item_type
      using TB_CIT_SETUP() helper macro, and sets both ct_item_ops + ct_attr
      following existing code.
      
      It updates target_core_make_subdev() + target_core_setup_dev_attrib_cit() +
      struct target_backend_cits, and drops left-over target_core_dev_wwn_cit
      from target_core_configfs.c code and update comments.
      
      This patch introduces no functional change from existing code.
      Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
      f8d389c6
    • Nicholas Bellinger's avatar
      target: Move dev_pr_cit to struct se_subsystem_api · 91e2e39b
      Nicholas Bellinger authored
      This patch adds support for dev_pr_cit as an external config_item_type
      using TB_CIT_SETUP() helper macro, and sets both ct_item_ops + ct_attr
      following existing code.
      
      It updates target_core_make_subdev() + target_core_setup_dev_attrib_cit() +
      struct target_backend_cits, and drops left-over target_core_dev_pr_cit
      from target_core_configfs.c code and update comments.
      
      This patch introduces no functional change from existing code.
      Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
      91e2e39b
    • Nicholas Bellinger's avatar
      target: Move dev_attrib_cit to struct se_subsystem_api · f79a897e
      Nicholas Bellinger authored
      This patch adds support for dev_attrib_cit as an external config_item_type
      using TB_CIT_SETUP() helper macro, and sets both ct_item_ops + ct_attr
      following existing code.
      
      It updates target_core_make_subdev() + target_core_setup_dev_attrib_cit() +
      struct target_backend_cits, and drops left-over target_core_dev_attrib_cit
      from target_core_configfs.c code and update comments.
      
      This patch introduces no functional change from existing code.
      Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
      f79a897e
    • Nicholas Bellinger's avatar
      target: Move dev_cit to struct se_subsystem_api · 73112edc
      Nicholas Bellinger authored
      This patch adds initial support for dev_cit as external config_item_type.
      
      This includes a new struct target_backend_cits to hold the external CITs
      within struct se_subsystem_api, and target_core_setup_sub_cits() to be
      used by backend drivers ahead of transport_subsystem_register().
      
      It adds a TB_CIT_SETUP() helper following target_core_fabric_configfs.c
      to perform the config_item_type assignments.
      
      Also, drop left-over target_core_dev_cit from target_core_configfs.c code
      and update comments.
      Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
      73112edc
  6. 11 Jun, 2014 1 commit
  7. 07 Apr, 2014 2 commits
    • Nicholas Bellinger's avatar
      target/sbc: Add sbc_dif_read_strip software emulation · 395ccb25
      Nicholas Bellinger authored
      Split up __sbc_dif_verify_read() so that VERIFY READ emulation can
      perform target-core specific READ_STRIP, seperate from the existing
      FILEIO/RAMDISK backend emulation code.
      
      Also add sbc_dif_read_strip() in order to determine number of sectors
      using cmd->prot_length, and skip the extra sbc_dif_copy_prot().
      Reviewed-by: default avatarSagi Grimberg <sagig@mellanox.com>
      Cc: Martin K. Petersen <martin.petersen@oracle.com>
      Cc: Or Gerlitz <ogerlitz@mellanox.com>
      Cc: Quinn Tran <quinn.tran@qlogic.com>
      Cc: Giridhar Malavali <giridhar.malavali@qlogic.com>
      Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
      395ccb25
    • Nicholas Bellinger's avatar
      target/sbc: Add sbc_dif_generate software emulation · 66a3d5bc
      Nicholas Bellinger authored
      This patch adds WRITE_INSERT emulation within target-core
      using TYPE1 / TYPE3 PI modes in sbc_dif_generate() code.
      
      This is useful in order for existing legacy fabrics that do not
      support protection offloads to interact with backend devices that
      currently have T10 PI enabled.
      
      v2 changes:
         - Rename to sbc_dif_generate() (Sagi)
      
      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: default avatarNicholas Bellinger <nab@linux-iscsi.org>
      66a3d5bc
  8. 18 Jan, 2014 2 commits
    • Nicholas Bellinger's avatar
      target/sbc: Add DIF TYPE1+TYPE3 read/write verify emulation · 41861fa8
      Nicholas Bellinger authored
      This patch adds support for DIF read/write verify emulation
      for TARGET_DIF_TYPE1_PROT + TARGET_DIF_TYPE3_PROT operation.
      
      This includes sbc_dif_verify_write() + sbc_dif_verify_read()
      calls accessable by backend drivers to perform DIF verify
      for SGL based data and protection information.
      
      Also included is sbc_dif_copy_prot() logic to copy protection
      information to/from backend provided protection SGLs.
      
      Based on scsi_debug.c DIF TYPE1+TYPE3 emulation.
      
      v2 changes:
        - Select CRC_T10DIF for TARGET_CORE in Kconfig (Fengguang)
        - Drop IP checksum logic from sbc_dif_v1_verify (MKP)
        - Fix offset on app_tag = 0xffff in sbc_dif_verify_read()
      
      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: default avatarNicholas Bellinger <nab@linux-iscsi.org>
      41861fa8
    • Nicholas Bellinger's avatar
      target: Add DIF related base definitions · ce65e5b9
      Nicholas Bellinger authored
      This patch adds DIF related definitions to target_core_base.h
      that includes enums for target_prot_op + target_prot_type +
      target_prot_version + target_guard_type + target_pi_error.
      
      Also included is struct se_dif_v1_tuple, along with changes
      to struct se_cmd, struct se_dev_attrib, and struct se_device.
      
      Also, add new se_subsystem_api->[init,format,free]_prot() callers
      used by target core code to setup backend specific protection
      information after the device has been configured.
      
      Enums taken from Sagi Grimberg's original patch.
      
      v2 changes:
        - Drop guard_type related definitions
        - Update target_prot_op + target_prot_ho definitions (Sagi)
        - Drop SCF_PROT + pi_prot_version flag
        - Add se_subsystem_api->format_prot() (Sagi)
        - Add hw_pi_prot_type device attribute
      
      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: default avatarNicholas Bellinger <nab@linux-iscsi.org>
      ce65e5b9
  9. 12 Nov, 2013 1 commit
  10. 10 Sep, 2013 1 commit
    • Nicholas Bellinger's avatar
      target: Make helpers non static for EXTENDED_COPY command setup · c5ff8d6b
      Nicholas Bellinger authored
      Both target_alloc_sgl() and transport_generic_map_mem_to_cmd() are
      required by EXTENDED_COPY logic when setting up internally dispatched
      command descriptors, so go ahead and make both of these non static.
      
      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: default avatarNicholas Bellinger <nab@daterainc.com>
      c5ff8d6b
  11. 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: default avatarNicholas Bellinger <nab@daterainc.com>
      a82a9538
  12. 25 Apr, 2013 1 commit
  13. 23 Feb, 2013 1 commit
  14. 13 Feb, 2013 2 commits
    • Nicholas Bellinger's avatar
      target/iblock: Use backend REQ_FLUSH hint for WriteCacheEnabled status · d0c8b259
      Nicholas Bellinger authored
      This patch allows IBLOCK to check block hints in request_queue->flush_flags
      when reporting current backend device WriteCacheEnabled status to a remote
      SCSI initiator port.
      
      This is done via a se_subsystem_api->get_write_cache() call instead of a
      backend se_device creation time flag, as we expect REQ_FLUSH bits to possibly
      change from an underlying blk_queue_flush() by the SCSI disk driver, or
      internal raw struct block_device driver usage.
      
      Also go ahead and update iblock_execute_rw() bio I/O path code to use
      REQ_FLUSH + REQ_FUA hints when determining WRITE_FUA usage, and make SPC
      emulation code use a spc_check_dev_wce() helper to handle both types of
      cases for virtual backend subsystem drivers.
      
      (asias: Drop unnecessary comparsion operators)
      Reported-by: default avatarmajianpeng <majianpeng@gmail.com>
      Cc: majianpeng <majianpeng@gmail.com>
      Cc: Christoph Hellwig <hch@infradead.org>
      Cc: Jens Axboe <axboe@kernel.dk>
      Cc: James Bottomley <JBottomley@Parallels.com>
      Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
      d0c8b259
    • Hannes Reinecke's avatar
      target: Export SPC inquiry emulation · 0dfa1c5d
      Hannes Reinecke authored
      Some target drivers might need to access the inquiry data
      directly, without sending out the actual command.
      So export these functions.
      Signed-off-by: default avatarHannes Reinecke <hare@suse.de>
      Cc: Nicholas Bellinger <nab@risingtidesystems.com>
      Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
      0dfa1c5d
  15. 28 Nov, 2012 1 commit
    • Nicholas Bellinger's avatar
      target: Make spc_get_write_same_sectors return sector_t · ffe00675
      Nicholas Bellinger authored
      We already expect TFO->get_blocks() to return sector_t for zero value case
      when doing WRITE_SAME to the end of the backend device, so go ahead and return
      sector_t from spc_get_write_same_sectors() to handle this case properly.
      
      Also, update the single iblock_execute_write_same() caller of this code.
      
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Martin K. Petersen <martin.petersen@oracle.com>
      Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
      ffe00675
  16. 15 Nov, 2012 1 commit
  17. 07 Nov, 2012 6 commits
  18. 18 Sep, 2012 1 commit
  19. 06 Sep, 2012 1 commit
  20. 17 Jul, 2012 2 commits