1. 23 6月, 2015 3 次提交
  2. 16 6月, 2015 3 次提交
  3. 02 6月, 2015 2 次提交
    • B
      target: Minimize SCSI header #include directives · ba929992
      Bart Van Assche 提交于
      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: NBart Van Assche <bart.vanassche@sandisk.com>
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NJames Bottomley <JBottomley@Odin.com>
      ba929992
    • B
      target: Correct a comment · 8d3a8248
      Bart Van Assche 提交于
      Correct the comment above the definition of TCM_MAX_COMMAND_SIZE.
      A quote from Christoph:
      
          There aren't any legacy issues, we just decided to handle >
          16 byte CDBs in the slow path.
      Signed-off-by: NBart Van Assche <bart.vanassche@sandisk.com>
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      Reviewed-by: NHannes Reinecke <hare@suse.de>
      Signed-off-by: NJames Bottomley <JBottomley@Odin.com>
      8d3a8248
  4. 01 6月, 2015 12 次提交
    • N
      target: Drop se_lun->lun_active for existing percpu lun_ref · 9e37d042
      Nicholas Bellinger 提交于
      With se_port_t and t10_alua_tg_pt_gp_member being absored into se_lun,
      there is no need for an extra atomic_t based reference count for PR
      ALL_TG_PT=1 and ALUA access state transition.
      
      Go ahead and use the existing percpu se_lun->lun_ref instead, and
      convert the two special cases to percpu_ref_tryget_live() to avoid
      se_lun if transport_clear_lun_ref() has already been invoked to
      shutdown the se_lun.
      
      Cc: Christoph Hellwig <hch@lst.de>
      Reviewed-by: NHannes Reinecke <hare@suse.de>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      9e37d042
    • N
      target: Drop lun_sep_lock for se_lun->lun_se_dev RCU usage · 4cc987ea
      Nicholas Bellinger 提交于
      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: NChristoph Hellwig <hch@lst.de>
      Reviewed-by: NHannes Reinecke <hare@suse.de>
      Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
      Cc: Chris Boot <bootc@bootc.net>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      4cc987ea
    • C
      target: Subsume se_port + t10_alua_tg_pt_gp_member into se_lun · adf653f9
      Christoph Hellwig 提交于
      This patch eliminates all se_port + t10_alua_tg_pt_gp_member usage,
      and converts current users to direct se_lun pointer dereference.
      
      This includes the removal of core_export_port(), core_release_port()
      core_dev_export() and core_dev_unexport().  Along with conversion
      of special case se_lun pointer dereference within PR ALL_TG_PT=1
      and ALUA access state transition UNIT_ATTENTION handling.
      
      Also, update core_enable_device_list_for_node() to reference the
      new per se_lun->lun_deve_list when creating a new entry, or
      replacing an existing one via RCU.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Reviewed-by: NHannes Reinecke <hare@suse.de>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      adf653f9
    • B
      target: Simplify LUN shutdown code · b3eeea66
      Bart Van Assche 提交于
      Instead of starting a thread from transport_clear_lun_ref() that
      waits for LUN shutdown, wait in that function for LUN shutdown
      to finish. Additionally, change the return type of
      transport_clear_lun_ref() from int to void.
      Signed-off-by: NBart Van Assche <bart.vanassche@sandisk.com>
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      b3eeea66
    • C
      target: simplify backend driver registration · 0a06d430
      Christoph Hellwig 提交于
      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: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      0a06d430
    • N
      target: Drop left-over se_lun->lun_status · 46247737
      Nicholas Bellinger 提交于
      Now that se_portal_group->tpg_lun_hlist is a RCU protected hlist,
      go ahead and drop the left-over lun->lun_status usage.
      Reported-by: NChristoph Hellwig <hch@lst.de>
      Reviewed-by: NHannes Reinecke <hare@suse.de>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      46247737
    • N
      target: Drop unused se_lun->lun_acl_list · 84786546
      Nicholas Bellinger 提交于
      Reviewed-by: NHannes Reinecke <hare@suse.de>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Sagi Grimberg <sagig@mellanox.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      84786546
    • N
      target: Convert se_tpg->acl_node_lock to ->acl_node_mutex · 403edd78
      Nicholas Bellinger 提交于
      This patch converts se_tpg->acl_node_lock to struct mutex, so that
      ->acl_node_acl walkers in core_clear_lun_from_tpg() can block when
      calling core_disable_device_list_for_node().
      
      It also updates core_dev_add_lun() to hold ->acl_node_mutex when
      calling core_tpg_add_node_to_devs() to build ->lun_entry_hlist
      for dynamically generated se_node_acl.
      Reviewed-by: NHannes Reinecke <hare@suse.de>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Sagi Grimberg <sagig@mellanox.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      403edd78
    • N
      target: Convert se_portal_group->tpg_lun_list[] to RCU hlist · 6bb82612
      Nicholas Bellinger 提交于
      This patch converts the fixed size se_portal_group->tpg_lun_list[]
      to use modern RCU with hlist_head in order to support an arbitary
      number of se_lun ports per target endpoint.
      
      It includes dropping core_tpg_alloc_lun() from core_dev_add_lun(),
      and calling it directly from target_fabric_make_lun() to allocate
      a new se_lun.  And add a new target_fabric_port_release() configfs
      item callback to invoke kfree_rcu() to release memory during
      se_lun->lun_group shutdown.
      
      Also now that se_node_acl->lun_entry_hlist is using RCU, convert
      existing tpg_lun_lock to struct mutex so core_tpg_add_node_to_devs()
      can perform RCU updater logic without releasing ->tpg_lun_mutex.
      
      Also, drop core_tpg_clear_object_luns() and it's single consumer
      in iscsi-target, which is duplicating TPG LUN shutdown logic and
      is current code results in a NOP.
      
      Finally, sbp-target and xen-scsiback fabric driver conversions are
      included, which are required due to the non-standard way they use
      ->tpg_lun_hlist.
      Reviewed-by: NHannes 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>
      Cc: Chris Boot <bootc@bootc.net>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      6bb82612
    • N
      target/pr: Change alloc_registration to avoid pr_reg_tg_pt_lun · 79dc9c9e
      Nicholas Bellinger 提交于
      This patch changes __core_scsi3_do_alloc_registration() code to
      drop pr_reg->pr_reg_tg_pt_lun pointer usage in favor of a new
      pr_reg RPTI + existing pr_reg->pr_aptpl_target_lun used by
      APTPL metadata logic.
      
      It also includes changes to REGISTER, REGISTER_AND_MOVE and APTPL
      feature bit codepaths to use rcu_dereference_check() with the
      expected non-zero se_dev_entry->pr_kref reference held.
      Reviewed-by: NHannes Reinecke <hare@suse.de>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Sagi Grimberg <sagig@mellanox.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      79dc9c9e
    • N
      target/pr: Use atomic bitop for se_dev_entry->deve_flags reservation check · 80bfdfa9
      Nicholas Bellinger 提交于
      This patch converts the core_scsi3_pr_seq_non_holder() check for non
      reservation holding registrations to use an atomic bitop in ->deve_flags
      to determine if a registration is currently active.
      
      It also includes associated a set_bit() in __core_scsi3_add_registration()
      and clear_bit() in __core_scsi3_free_registration(), if se_dev_entry still
      exists, and has not already been released via se_dev_entry shutdown path
      in core_disable_device_list_for_node().
      
      Also, clear_bit in core_disable_device_list_for_node as well to ensure
      the read-critical path in core_scsi3_pr_seq_non_holder() picks up the
      new state, preceeding the final kfree_rcu() call.
      Reported-by: NChristoph Hellwig <hch@lst.de>
      Reviewed-by: NHannes Reinecke <hare@suse.de>
      Cc: Sagi Grimberg <sagig@mellanox.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      80bfdfa9
    • N
      target: Convert se_node_acl->device_list[] to RCU hlist · 29a05dee
      Nicholas Bellinger 提交于
      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: NHannes 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: NNicholas Bellinger <nab@linux-iscsi.org>
      29a05dee
  5. 31 5月, 2015 4 次提交
    • B
      target: Move task tag into struct se_cmd + support 64-bit tags · 649ee054
      Bart Van Assche 提交于
      Simplify target core and target drivers by storing the task tag
      a.k.a. command identifier inside struct se_cmd.
      
      For several transports (e.g. SRP) tags are 64 bits wide.
      Hence add support for 64-bit tags.
      
      (Fix core_tmr_abort_task conversion spec warnings - nab)
      (Fix up usb-gadget to use 16-bit tags - HCH + bart)
      Signed-off-by: NBart Van Assche <bart.vanassche@sandisk.com>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Andy Grover <agrover@redhat.com>
      Cc: Sagi Grimberg <sagig@mellanox.com>
      Cc: <qla2xxx-upstream@qlogic.com>
      Cc: Felipe Balbi <balbi@ti.com>
      Cc: Michael S. Tsirkin <mst@redhat.com>
      Cc: Juergen Gross <jgross@suse.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      649ee054
    • C
      target: change core_tpg_register prototype · e4aae5af
      Christoph Hellwig 提交于
      Remove the unneeded fabric_ptr argument, and change the type argument
      to pass in a SPC protocol identifier.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      e4aae5af
    • A
      target: ensure se_cmd->t_prot_sg is allocated when required · 5835812f
      Akinobu Mita 提交于
      Even if the device backend is initialized with protection info is
      enabled, some requests don't have the protection info attached for
      WRITE SAME command issued by block device helpers, WRITE command with
      WRPROTECT=0 by SG_IO ioctl, etc.
      
      So when TCM loopback fabric module is used, se_cmd->t_prot_sg is NULL
      for these requests and performing WRITE_INSERT of PI using software
      emulation by sbc_dif_generate() causes kernel crash.
      
      To fix this, introduce SCF_PASSTHROUGH_PROT_SG_TO_MEM_NOALLOC for
      se_cmd_flags, which is used to determine that se_cmd->t_prot_sg needs
      to be allocated or use pre-allocated protection information by scsi
      mid-layer.
      Signed-off-by: NAkinobu Mita <akinobu.mita@gmail.com>
      Cc: Nicholas Bellinger <nab@linux-iscsi.org>
      Cc: Sagi Grimberg <sagig@mellanox.com>
      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: NNicholas Bellinger <nab@linux-iscsi.org>
      5835812f
    • C
      target: fix DPO and FUA bit checks · 814e5b45
      Christoph Hellwig 提交于
      Drivers may override the WCE flag, in which case the DPOFUA flag in
      MODE SENSE might differ from the check used to reject invalid FUA
      bits in sbc_check_dpofua.  Also now that we reject invalid FUA
      bits early there is no need to duplicate the same buggy check
      down in the fileio code.
      
      As the DPOFUA flag controls th support for FUA bits on read and
      write commands as well as DPO key off all the checks off a single
      helper, and deprecate the emulate_dpo and emulate_fua_read attributs.
      
      This fixes various failures in the libiscsi testsuite.
      
      Personally I'd prefer to also remove the emulate_fua_write attribute
      as there is no good reason to disable it, but I'll leave that for
      a separate discussion.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      814e5b45
  6. 16 4月, 2015 1 次提交
  7. 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
  8. 08 4月, 2015 2 次提交
    • C
    • 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
  9. 13 2月, 2015 1 次提交
    • 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
  10. 10 1月, 2015 1 次提交
  11. 04 12月, 2014 1 次提交
  12. 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
  13. 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
  14. 07 4月, 2014 4 次提交
    • N
      target: Pass in transport supported PI at session initialization · e70beee7
      Nicholas Bellinger 提交于
      In order to support local WRITE_INSERT + READ_STRIP operations for
      non PI enabled fabrics, the fabric driver needs to be able signal
      what protection offload operations are supported.
      
      This is done at session initialization time so the modes can be
      signaled by individual se_wwn + se_portal_group endpoints, as well
      as optionally across different transports on the same endpoint.
      
      For iser-target, set TARGET_PROT_ALL if the underlying ib_device
      has already signaled PI offload support, and allow this to be
      exposed via a new iscsit_transport->iscsit_get_sup_prot_ops()
      callback.
      
      For loopback, set TARGET_PROT_ALL to signal SCSI initiator mode
      operation.
      
      For all other drivers, set TARGET_PROT_NORMAL to disable fabric
      level PI.
      
      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: NNicholas Bellinger <nab@linux-iscsi.org>
      e70beee7
    • A
      target: Fix Task Aborted Status (TAS) handling · 68259b5a
      Alex Leung 提交于
      This patch addresses three of long standing issues wrt to Task
      Aborted Status (TAS) handling.
      
      The first is the incorrect assumption in core_tmr_handle_tas_abort()
      that TASK_ABORTED status is sent for the task referenced by TMR
      ABORT_TASK, and sending TASK_ABORTED status for TMR LUN_RESET on
      the same nexus the LUN_RESET was received.
      
      The second is to ensure the lun reference count is dropped within
      transport_cmd_finish_abort() by calling transport_lun_remove_cmd()
      before invoking transport_cmd_check_stop_to_fabric().
      
      The last is to fix the delayed TAS handling to allow outstanding
      WRITEs to complete before sending the TASK_ABORTED status. This
      includes changing transport_check_aborted_status() to avoid
      processing when SCF_SEND_DELAYED_TAS has not be set, and updating
      transport_send_task_abort() to drop the SCF_SENT_DELAYED_TAS
      check.
      Signed-off-by: NAlex Leung <amleung21@yahoo.com>
      Cc: Alex Leung <amleung21@yahoo.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      68259b5a
    • S
      Target/core: Remove prot_handover use for now · 48f5e7b3
      Sagi Grimberg 提交于
      This is not going to be supported soon - so drop it.
      Signed-off-by: NSagi Grimberg <sagig@mellanox.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      48f5e7b3
    • S
      Target/dif: Introduce protection-passthough-only mode · b5b8e298
      Sagi Grimberg 提交于
      Some transports (iSCSI/iSER/SRP/FC) support hardware INSERT/STRIP
      capabilities while other transports like loopback/vhost-scsi need
      perform this is software.
      
      This patch allows fabrics using SCF_PASSTHROUGH_SG_TO_MEM_NOALLOC
      to signal the early LUN scan handling case where PROTECT CDB bits
      are set, but no fabric buffer has been provided.
      
      For transports which use generic new command these buffers have yet
      to be allocated.
      
      Also this way, target may support protection information
      against legacy initiators (writes are inserted and reads
      are stripped).
      
      (Only set prot_pto for loopback during early special case - nab)
      Signed-off-by: NSagi Grimberg <sagig@mellanox.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      b5b8e298
  15. 14 3月, 2014 1 次提交