1. 31 5月, 2015 9 次提交
  2. 16 4月, 2015 1 次提交
  3. 15 4月, 2015 3 次提交
    • B
      target: Remove the unused flag SCF_ACK_KREF · 054922bb
      Bart Van Assche 提交于
      The flag SCF_ACK_KREF is only set but never tested. Hence remove
      this flag.
      Signed-off-by: NBart Van Assche <bart.vanassche@sandisk.com>
      Cc: Christoph Hellwig <hch@lst.de>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      054922bb
    • N
      target: Fix COMPARE_AND_WRITE with SG_TO_MEM_NOALLOC handling · c8e63985
      Nicholas Bellinger 提交于
      This patch fixes a bug for COMPARE_AND_WRITE handling with
      fabrics using SCF_PASSTHROUGH_SG_TO_MEM_NOALLOC.
      
      It adds the missing allocation for cmd->t_bidi_data_sg within
      transport_generic_new_cmd() that is used by COMPARE_AND_WRITE
      for the initial READ payload, even if the fabric is already
      providing a pre-allocated buffer for cmd->t_data_sg.
      
      Also, fix zero-length COMPARE_AND_WRITE handling within the
      compare_and_write_callback() and target_complete_ok_work()
      to queue the response, skipping the initial READ.
      
      This fixes COMPARE_AND_WRITE emulation with loopback, vhost,
      and xen-backend fabric drivers using SG_TO_MEM_NOALLOC.
      Reported-by: NChristoph Hellwig <hch@lst.de>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: <stable@vger.kernel.org> # v3.12+
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      c8e63985
    • C
      target: simplify the target template registration API · 9ac8928e
      Christoph Hellwig 提交于
      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: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      9ac8928e
  4. 08 4月, 2015 3 次提交
    • C
    • N
      iscsi/iser-target: Add fabric_prot_type attribute support · 901c04a3
      Nicholas Bellinger 提交于
      This patch updates iscsi/iser-target to add a new fabric_prot_type
      TPG attribute for iser-target, used for controlling LLD level
      protection into LIO when the backend device does not support T10-PI.
      
      This is required for ib_isert to enable WRITE_STRIP + READ_INSERT
      hardware offloads.
      
      It's disabled by default and controls which se_sesion->sess_prot_type
      are set at iscsi_target_locate_portal() session registration time.
      
      Cc: Sagi Grimberg <sagig@mellanox.com>
      Cc: Martin Petersen <martin.petersen@oracle.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      901c04a3
    • N
      target: Add protected fabric + unprotected device support · 38b57f82
      Nicholas Bellinger 提交于
      This patch adds a new target_core_fabric_ops callback for allowing fabric
      drivers to expose a TPG attribute for signaling when a T10-PI protected
      fabric wants to function with an un-protected device without T10-PI.
      
      This specifically is to allow LIO to perform WRITE_STRIP + READ_INSERT
      operations when functioning with non T10-PI enabled devices, seperate
      from any available hw offloads the fabric supports.
      
      This is done using a new se_sess->sess_prot_type that is set at fabric
      session creation time based upon the TPG attribute.  It currently cannot
      be changed for individual sessions after initial creation.
      
      Also, update existing target_core_sbc.c code to honor sess_prot_type when
      setting up cmd->prot_op + cmd->prot_type assignments.
      
      (Add unlikely and !! boolean conversion in sbc_check_prot - Sagi)
      
      Cc: Martin Petersen <martin.petersen@oracle.com>
      Cc: Sagi Grimberg <sagig@mellanox.com>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Doug Gilbert <dgilbert@interlog.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      38b57f82
  5. 27 3月, 2015 2 次提交
  6. 20 3月, 2015 1 次提交
  7. 07 3月, 2015 1 次提交
    • N
      target: Add target_show_dynamic_sessions attribute helper · f8e471f9
      Nicholas Bellinger 提交于
      This patch adds a new helper function that can be used by fabric driver
      TPG attributes for dumping the list of active sessions with a dynamically
      generated se_node_acl. (generate_node_acl=1).
      
      It prints one se_node_acl->initiatorname per line, up to PAGE_SIZE which
      is due to the current limitiation of single page attribute output within
      sysfs and configfs code.
      
      Note that if a session is referencing a explicit NodeACL, the InitiatorName
      will not appear within dynamic_sessions output.
      Reported-by: NAndy Grover <agrover@redhat.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      f8e471f9
  8. 13 2月, 2015 2 次提交
    • N
      target: Fix PR_APTPL_BUF_LEN buffer size limitation · f161d4b4
      Nicholas Bellinger 提交于
      This patch addresses the original PR_APTPL_BUF_LEN = 8k limitiation
      for write-out of PR APTPL metadata that Martin has recently been
      running into.
      
      It changes core_scsi3_update_and_write_aptpl() to use vzalloc'ed
      memory instead of kzalloc, and increases the default hardcoded
      length to 256k.
      
      It also adds logic in core_scsi3_update_and_write_aptpl() to double
      the original length upon core_scsi3_update_aptpl_buf() failure, and
      retries until the vzalloc'ed buffer is large enough to accommodate
      the outgoing APTPL metadata.
      Reported-by: NMartin Svec <martin.svec@zoner.cz>
      Cc: stable@vger.kernel.org
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      f161d4b4
    • S
      iscsi/iser-target: Support multi-sequence sendtargets text response · e4f4e801
      Sagi Grimberg 提交于
      In case sendtargets response is larger than initiator MRDSL, we
      send a partial sendtargets response (setting F=0, C=1, TTT!=0xffffffff),
      accept a consecutive empty text message and send the rest of the payload.
      In case we are done, we set F=1, C=0, TTT=0xffffffff.
      We do that by storing the sendtargets response bytes done under
      the session.
      
      This patch also makes iscsit_find_cmd_from_itt public for isert.
      
      (Re-add cmd->maxcmdsn_inc and clear in iscsit_build_text_rsp - nab)
      Signed-off-by: NSagi Grimberg <sagig@mellanox.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      e4f4e801
  9. 05 2月, 2015 1 次提交
  10. 31 1月, 2015 1 次提交
  11. 10 1月, 2015 1 次提交
  12. 04 12月, 2014 1 次提交
  13. 02 12月, 2014 9 次提交
    • N
      target: Add DEF_TB_DEFAULT_ATTRIBS macro for virtual device attrs · e6c39f70
      Nicholas Bellinger 提交于
      This helper macro adds the default set of 30 device attributes for
      virtual devices from existing target_core_configfs.c code, and moves
      the definitions into a single macro to create the structs necessary
      for backend drivers.
      
      It allows them to populate their own external struct configfs_attribute
      for se_subsystem_api->tb_cits.tb_dev_attrib_cit.ct_attrs.
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      e6c39f70
    • N
      target: Add EXPORT_SYMBOL for existing se_dev_set_* · d30cd123
      Nicholas Bellinger 提交于
      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: NNicholas Bellinger <nab@linux-iscsi.org>
      d30cd123
    • N
      target: Add target_core_backend_configfs.h helper macros · 7a23f890
      Nicholas Bellinger 提交于
      This patch adds a number of configfs e-attr macros following
      what existing target_core_configfs.c code does for internal
      target_backend_dev_attrib setup, and similar to how target
      fabric drivers allow for external config_item_type + cit->ct_attrs.
      assignment.
      
      This is useful for backend drivers like PSCSI who need to only
      expose a small subset of device attributes, while still retaining
      a default list of attributes for other backend drivers like
      IBLOCK, FILEIO, RAMDISK, and TCMU.
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      7a23f890
    • N
      target: Move dev_stat_cit to struct se_subsystem_api · d23ab570
      Nicholas Bellinger 提交于
      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: NNicholas Bellinger <nab@linux-iscsi.org>
      d23ab570
    • N
      target: Move dev_alua_tg_pt_gps_cit to struct se_subsystem_api · 72aca57b
      Nicholas Bellinger 提交于
      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: NNicholas Bellinger <nab@linux-iscsi.org>
      72aca57b
    • N
      target: Move dev_wwn_cit to struct se_subsystem_api · f8d389c6
      Nicholas Bellinger 提交于
      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: NNicholas Bellinger <nab@linux-iscsi.org>
      f8d389c6
    • N
      target: Move dev_pr_cit to struct se_subsystem_api · 91e2e39b
      Nicholas Bellinger 提交于
      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: NNicholas Bellinger <nab@linux-iscsi.org>
      91e2e39b
    • N
      target: Move dev_attrib_cit to struct se_subsystem_api · f79a897e
      Nicholas Bellinger 提交于
      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: NNicholas Bellinger <nab@linux-iscsi.org>
      f79a897e
    • N
      target: Move dev_cit to struct se_subsystem_api · 73112edc
      Nicholas Bellinger 提交于
      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: NNicholas Bellinger <nab@linux-iscsi.org>
      73112edc
  14. 04 10月, 2014 1 次提交
    • N
      target: Add force_pr_aptpl device attribute · 92404e60
      Nicholas Bellinger 提交于
      This patch adds a force_pr_aptpl device attribute used to force SPC-3 PR
      Activate Persistence across Target Power Loss (APTPL) operation.  This
      makes PR metadata write-out occur during state change regardless if new
      PERSISTENT_RESERVE_OUT CDBs have their APTPL feature bit set.
      
      This is useful during H/A failover in active/passive setups where all PR
      state is being re-created on a different node, driven by configfs backend
      device + export layout and pre-loaded $DEV/pr/res_aptpl_metadata.
      
      Cc: Mike Christie <michaelc@cs.wisc.edu>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      92404e60
  15. 02 10月, 2014 1 次提交
    • J
      target: encapsulate smp_mb__after_atomic() · 33940d09
      Joern Engel 提交于
      The target code has a rather generous helping of smp_mb__after_atomic()
      throughout the code base.  Most atomic operations were followed by one
      and none were preceded by smp_mb__before_atomic(), nor accompanied by a
      comment explaining the need for a barrier.
      
      Instead of trying to prove for every case whether or not it is needed,
      this patch introduces atomic_inc_mb() and atomic_dec_mb(), which
      explicitly include the memory barriers before and after the atomic
      operation.  For now they are defined in a target header, although they
      could be of general use.
      
      Most of the existing atomic/mb combinations were replaced by the new
      helpers.  In a few cases the atomic was sandwiched in
      spin_lock/spin_unlock and I simply removed the barrier.
      
      I suspect that in most cases the correct conversion would have been to
      drop the barrier.  I also suspect that a few cases exist where a) the
      barrier was necessary and b) a second barrier before the atomic would
      have been necessary and got added by this patch.
      Signed-off-by: NJoern Engel <joern@logfs.org>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      33940d09
  16. 12 6月, 2014 2 次提交
  17. 07 4月, 2014 1 次提交
    • N
      target/sbc: Add sbc_dif_read_strip software emulation · 395ccb25
      Nicholas Bellinger 提交于
      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: NSagi 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: NNicholas Bellinger <nab@linux-iscsi.org>
      395ccb25