1. 08 12月, 2018 1 次提交
    • B
      scsi: target/core: Simplify the code for aborting SCSI commands · fbbd4923
      Bart Van Assche 提交于
      Instead of allowing the code that aborts a SCSI command to finish before
      all iSCSI data frames have been received, make that code wait until all
      iSCSI data frames have been received. Introduce a new member variable in
      the target driver template to communicate that information from the iSCSI
      target driver to the target core. This change allows to leave out the check
      whether or not it is already safe to send the TASK_ABORTED reply from
      transport_send_task_abort().
      
      Cc: Nicholas Bellinger <nab@linux-iscsi.org>
      Cc: Mike Christie <mchristi@redhat.com>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: David Disseldorp <ddiss@suse.de>
      Cc: Hannes Reinecke <hare@suse.de>
      Signed-off-by: NBart Van Assche <bvanassche@acm.org>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      fbbd4923
  2. 29 11月, 2018 2 次提交
  3. 31 7月, 2018 1 次提交
  4. 03 7月, 2018 2 次提交
  5. 05 11月, 2017 1 次提交
  6. 12 7月, 2017 1 次提交
    • N
      iscsi-target: Add login_keys_workaround attribute for non RFC initiators · 138d351e
      Nicholas Bellinger 提交于
      This patch re-introduces part of a long standing login workaround that
      was recently dropped by:
      
        commit 1c99de98
        Author: Nicholas Bellinger <nab@linux-iscsi.org>
        Date:   Sun Apr 2 13:36:44 2017 -0700
      
            iscsi-target: Drop work-around for legacy GlobalSAN initiator
      
      Namely, the workaround for FirstBurstLength ended up being required by
      Mellanox Flexboot PXE boot ROMs as reported by Robert.
      
      So this patch re-adds the work-around for FirstBurstLength within
      iscsi_check_proposer_for_optional_reply(), and makes the key optional
      to respond when the initiator does not propose, nor respond to it.
      
      Also as requested by Arun, this patch introduces a new TPG attribute
      named 'login_keys_workaround' that controls the use of both the
      FirstBurstLength workaround, as well as the two other existing
      workarounds for gPXE iSCSI boot client.
      
      By default, the workaround is enabled with login_keys_workaround=1,
      since Mellanox FlexBoot requires it, and Arun has verified the Qlogic
      MSFT initiator already proposes FirstBurstLength, so it's uneffected
      by this re-adding this part of the original work-around.
      Reported-by: NRobert LeBlanc <robert@leblancnet.us>
      Cc: Robert LeBlanc <robert@leblancnet.us>
      Reviewed-by: NArun Easi <arun.easi@cavium.com>
      Cc: <stable@vger.kernel.org> # 3.1+
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      138d351e
  7. 05 5月, 2017 1 次提交
    • N
      iscsi-target: Set session_fall_back_to_erl0 when forcing reinstatement · 197b806a
      Nicholas Bellinger 提交于
      While testing modification of per se_node_acl queue_depth forcing
      session reinstatement via lio_target_nacl_cmdsn_depth_store() ->
      core_tpg_set_initiator_node_queue_depth(), a hung task bug triggered
      when changing cmdsn_depth invoked session reinstatement while an iscsi
      login was already waiting for session reinstatement to complete.
      
      This can happen when an outstanding se_cmd descriptor is taking a
      long time to complete, and session reinstatement from iscsi login
      or cmdsn_depth change occurs concurrently.
      
      To address this bug, explicitly set session_fall_back_to_erl0 = 1
      when forcing session reinstatement, so session reinstatement is
      not attempted if an active session is already being shutdown.
      
      This patch has been tested with two scenarios.  The first when
      iscsi login is blocked waiting for iscsi session reinstatement
      to complete followed by queue_depth change via configfs, and
      second when queue_depth change via configfs us blocked followed
      by a iscsi login driven session reinstatement.
      
      Note this patch depends on commit d36ad77f to handle multiple
      sessions per se_node_acl when changing cmdsn_depth, and for
      pre v4.5 kernels will need to be included for stable as well.
      Reported-by: NGary Guo <ghg@datera.io>
      Tested-by: NGary Guo <ghg@datera.io>
      Cc: Gary Guo <ghg@datera.io>
      Cc: <stable@vger.kernel.org> # v4.1+
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      197b806a
  8. 04 4月, 2017 1 次提交
  9. 31 3月, 2017 1 次提交
  10. 16 12月, 2016 1 次提交
    • V
      iscsi-target: Return error if unable to add network portal · 83337e54
      Varun Prakash 提交于
      If iscsit_tpg_add_network_portal() fails then
      return error code instead of 0 to user space.
      
      If iscsi-target returns 0 then user space keeps
      on retrying same command infinitely, targetcli or
      echo hangs till command completes with non zero
      return value. In some cases it is possible that
      add network portal command never completes with
      success even after retrying multiple times,
      for example - cxgbit_setup_np() always returns
      -EINVAL if portal IP does not belong to Chelsio
      adapter interface.
      Signed-off-by: NVarun Prakash <varun@chelsio.com>
      Signed-off-by: NBart Van Assche <bart.vanassche@sandisk.com>
      [ bvanassche: Added "Fixes:" and "Cc: stable" tags ]
      Fixes: commit d4b3fa4b ("iscsi-target: Make iscsi_tpg_np driver show/store use generic code")
      Cc: <stable@vger.kernel.org>
      83337e54
  11. 10 12月, 2016 1 次提交
    • B
      target: Minimize #include directives · 8dcf07be
      Bart Van Assche 提交于
      Remove superfluous #include directives from the include/target/*.h
      files. Add missing #include directives to other *.h and *.c files.
      Use forward declarations for structures where possible. This
      change reduces the build time for make M=drivers/target on my
      laptop from 27.1s to 18.7s or by about 30%.
      Signed-off-by: NBart Van Assche <bart.vanassche@sandisk.com>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Bryant G. Ly <bryantly@linux.vnet.ibm.com>
      8dcf07be
  12. 17 5月, 2016 2 次提交
    • N
      cxgbit: Use type ISCSI_CXGBIT + cxgbit tpg_np attribute · ff7199b0
      Nicholas Bellinger 提交于
      Instead of having cxgbit use type ISCSI_HW_OFFLOAD + 'hw_offload'
      tpg_np attribute, it should be using it's own driver specific
      type + attribute
      
      Cc: Varun Prakash <varun@chelsio.com>
      Cc: Hariprasad Shenai <hariprasad@chelsio.com>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Sagi Grimberg <sagi@grimberg.me>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      ff7199b0
    • N
      iscsi-target: Make iscsi_tpg_np driver show/store use generic code · d4b3fa4b
      Nicholas Bellinger 提交于
      Go ahead and fold the duplicate iscsi_tpg_np driver attribute
      show/store functions into generic callers, invoked by current
      driver specific functions.
      
      This allows for future v4.8+ changes to have iscsi_target_mod
      use tpg_np driver attributes at runtime, instead of having
      the defaults hardcoded in iscsi_target_configfs.c.
      
      Also, drop the unused/legacy 'sctp' attribute for non standard
      RFC-3720 operation with IPPROTO_SCTP.
      
      Cc: Varun Prakash <varun@chelsio.com>
      Cc: Hariprasad Shenai <hariprasad@chelsio.com>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Sagi Grimberg <sagi@grimberg.me>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      d4b3fa4b
  13. 10 5月, 2016 2 次提交
  14. 31 3月, 2016 2 次提交
  15. 06 3月, 2016 1 次提交
  16. 20 1月, 2016 2 次提交
    • N
      target: Convert ACL change queue_depth se_session reference usage · d36ad77f
      Nicholas Bellinger 提交于
      This patch converts core_tpg_set_initiator_node_queue_depth()
      to use struct se_node_acl->acl_sess_list when performing
      explicit se_tpg_tfo->shutdown_session() for active sessions,
      in order for new se_node_acl->queue_depth to take effect.
      
      This follows how core_tpg_del_initiator_node_acl() currently
      works when invoking se_tpg_tfo->shutdown-session(), and ahead
      of the next patch to take se_node_acl->acl_kref during lookup,
      the extra get_initiator_node_acl() can go away. In order to
      achieve this, go ahead and change target_get_session() to use
      kref_get_unless_zero() and propigate up the return value
      to know when a session is already being released.
      
      This is because se_node_acl->acl_group is already protecting
      se_node_acl->acl_group reference via configfs, and shutdown
      within core_tpg_del_initiator_node_acl() won't occur until
      sys_write() to core_tpg_set_initiator_node_queue_depth()
      attribute returns back to user-space.
      
      Also, drop the left-over iscsi-target hack, and obtain
      se_portal_group->session_lock in lio_tpg_shutdown_session()
      internally. Remove iscsi-target wrapper and unused se_tpg +
      force parameters and associated code.
      Reported-by: NChristoph Hellwig <hch@lst.de>
      Cc: Sagi Grimberg <sagig@mellanox.com>
      Cc: Hannes Reinecke <hare@suse.de>
      Cc: Andy Grover <agrover@redhat.com>
      Cc: Mike Christie <michaelc@cs.wisc.edu>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      d36ad77f
    • N
      iscsi-target: Fix potential dead-lock during node acl delete · 26a99c19
      Nicholas Bellinger 提交于
      This patch is a iscsi-target specific bug-fix for a dead-lock
      that can occur during explicit struct se_node_acl->acl_group
      se_session deletion via configfs rmdir(2), when iscsi-target
      time2retain timer is still active.
      
      It changes iscsi-target to obtain se_portal_group->session_lock
      internally using spin_in_locked() to check for the specific
      se_node_acl configfs shutdown rmdir(2) case.
      
      Note this patch is intended for stable, and the subsequent
      v4.5-rc patch converts target_core_tpg.c to use proper
      se_sess->sess_kref reference counting for both se_node_acl
      deletion + se_node_acl->queue_depth se_session restart.
      Reported-by: N: Sagi Grimberg <sagig@mellanox.com>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Hannes Reinecke <hare@suse.de>
      Cc: Andy Grover <agrover@redhat.com>
      Cc: Mike Christie <michaelc@cs.wisc.edu>
      Cc: stable@vger.kernel.org # 3.10+
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      26a99c19
  17. 14 10月, 2015 1 次提交
  18. 27 8月, 2015 4 次提交
  19. 03 8月, 2015 2 次提交
  20. 16 6月, 2015 1 次提交
    • N
      target: Drop unnecessary core_tpg_register TFO parameter · bc0c94b1
      Nicholas Bellinger 提交于
      This patch drops unnecessary target_core_fabric_ops parameter usage
      for core_tpg_register() during fabric driver TFO->fabric_make_tpg()
      se_portal_group creation callback execution.
      
      Instead, use the existing se_wwn->wwn_tf->tf_ops pointer to ensure
      fabric driver is really using the same TFO provided at module_init
      time.
      
      Also go ahead and drop the forward TFO declarations tree-wide, and
      handling the special case for iscsi-target discovery TPG.
      
      Cc: Christoph Hellwig <hch@lst.de>
      Reviewed-by: NHannes Reinecke <hare@suse.de>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      bc0c94b1
  21. 31 5月, 2015 9 次提交
  22. 15 4月, 2015 1 次提交
    • 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