1. 02 6月, 2015 1 次提交
    • 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
  2. 16 4月, 2015 1 次提交
  3. 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
  4. 21 1月, 2015 1 次提交
  5. 04 12月, 2014 1 次提交
  6. 29 10月, 2014 1 次提交
  7. 14 10月, 2014 1 次提交
  8. 13 8月, 2014 1 次提交
  9. 11 8月, 2014 1 次提交
  10. 12 4月, 2014 1 次提交
  11. 07 4月, 2014 2 次提交
    • 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
    • N
      target: Add TFO->abort_task for aborted task resources release · 131e6abc
      Nicholas Bellinger 提交于
      Now that TASK_ABORTED status is not generated for all cases by
      TMR ABORT_TASK + LUN_RESET, a new TFO->abort_task() caller is
      necessary in order to give fabric drivers a chance to unmap
      hardware / software resources before the se_cmd descriptor is
      released via the normal TFO->release_cmd() codepath.
      
      This patch adds TFO->aborted_task() in core_tmr_abort_task()
      in place of the original transport_send_task_abort(), and
      also updates all fabric drivers to implement this caller.
      
      The fabric drivers that include changes to perform cleanup
      via ->aborted_task() are:
      
        - iscsi-target
        - iser-target
        - srpt
        - tcm_qla2xxx
      
      The fabric drivers that currently set ->aborted_task() to
      NOPs are:
      
        - loopback
        - tcm_fc
        - usb-gadget
        - sbp-target
        - vhost-scsi
      
      For the latter five, there appears to be no additional cleanup
      required before invoking TFO->release_cmd() to release the
      se_cmd descriptor.
      
      v2 changes:
        - Move ->aborted_task() call into transport_cmd_finish_abort (Alex)
      
      Cc: Alex Leung <amleung21@yahoo.com>
      Cc: Mark Rustad <mark.d.rustad@intel.com>
      Cc: Roland Dreier <roland@kernel.org>
      Cc: Vu Pham <vu@mellanox.com>
      Cc: Chris Boot <bootc@bootc.net>
      Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
      Cc: Michael S. Tsirkin <mst@redhat.com>
      Cc: Giridhar Malavali <giridhar.malavali@qlogic.com>
      Cc: Saurav Kashyap <saurav.kashyap@qlogic.com>
      Cc: Quinn Tran <quinn.tran@qlogic.com>
      Cc: Sagi Grimberg <sagig@mellanox.com>
      Cc: Or Gerlitz <ogerlitz@mellanox.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      131e6abc
  12. 13 2月, 2014 1 次提交
  13. 08 11月, 2013 1 次提交
  14. 03 10月, 2013 1 次提交
  15. 02 10月, 2013 1 次提交
    • N
      ib_srpt: Destroy cm_id before destroying QP. · 0b41d6ca
      Nicholas Bellinger 提交于
      This patch fixes a bug where ib_destroy_cm_id() was incorrectly being called
      after srpt_destroy_ch_ib() had destroyed the active QP.
      
      This would result in the following failed SRP_LOGIN_REQ messages:
      
      Received SRP_LOGIN_REQ with i_port_id 0x0:0x2590ffff1762bd, t_port_id 0x2c903009f8f40:0x2c903009f8f40 and it_iu_len 260 on port 1 (guid=0xfe80000000000000:0x2c903009f8f41)
      Received SRP_LOGIN_REQ with i_port_id 0x0:0x2590ffff1758f9, t_port_id 0x2c903009f8f40:0x2c903009f8f40 and it_iu_len 260 on port 2 (guid=0xfe80000000000000:0x2c903009f8f42)
      Received SRP_LOGIN_REQ with i_port_id 0x0:0x2590ffff175941, t_port_id 0x2c903009f8f40:0x2c903009f8f40 and it_iu_len 260 on port 2 (guid=0xfe80000000000000:0x2c90300a3cfb2)
      Received SRP_LOGIN_REQ with i_port_id 0x0:0x2590ffff176299, t_port_id 0x2c903009f8f40:0x2c903009f8f40 and it_iu_len 260 on port 1 (guid=0xfe80000000000000:0x2c90300a3cfb1)
      mlx4_core 0000:84:00.0: command 0x19 failed: fw status = 0x9
      rejected SRP_LOGIN_REQ because creating a new RDMA channel failed.
      Received SRP_LOGIN_REQ with i_port_id 0x0:0x2590ffff176299, t_port_id 0x2c903009f8f40:0x2c903009f8f40 and it_iu_len 260 on port 1 (guid=0xfe80000000000000:0x2c90300a3cfb1)
      mlx4_core 0000:84:00.0: command 0x19 failed: fw status = 0x9
      rejected SRP_LOGIN_REQ because creating a new RDMA channel failed.
      Received SRP_LOGIN_REQ with i_port_id 0x0:0x2590ffff176299, t_port_id 0x2c903009f8f40:0x2c903009f8f40 and it_iu_len 260 on port 1 (guid=0xfe80000000000000:0x2c90300a3cfb1)
      Reported-by: NNavin Ahuja <navin.ahuja@saratoga-speed.com>
      Cc: stable@vger.kernel.org # 3.3+
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      0b41d6ca
  16. 08 7月, 2013 1 次提交
  17. 30 5月, 2013 1 次提交
    • N
      ib_srpt: Call target_sess_cmd_list_set_waiting during shutdown_session · 1d19f780
      Nicholas Bellinger 提交于
      Given that srpt_release_channel_work() calls target_wait_for_sess_cmds()
      to allow outstanding se_cmd_t->cmd_kref a change to complete, the call
      to perform target_sess_cmd_list_set_waiting() needs to happen in
      srpt_shutdown_session()
      
      Also, this patch adds an explicit call to srpt_shutdown_session() within
      srpt_drain_channel() so that target_sess_cmd_list_set_waiting() will be
      called in the cases where TFO->shutdown_session() is not triggered
      directly by TCM.
      
      Cc: Joern Engel <joern@logfs.org>
      Cc: Roland Dreier <roland@kernel.org>
      Cc: stable@vger.kernel.org
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      1d19f780
  18. 21 5月, 2013 1 次提交
  19. 17 4月, 2013 1 次提交
  20. 29 11月, 2012 1 次提交
  21. 28 11月, 2012 1 次提交
    • N
      ib_srpt: Convert I/O path to target_submit_cmd + drop legacy ioctx->kref · 9474b043
      Nicholas Bellinger 提交于
      This patch converts the main srpt_handle_cmd() I/O path to use modern
      target_submit_cmd() with TARGET_SCF_ACK_KREF flag usage.  This includes
      dropping the original internal ioctx->kref + srpt_put_send_ioctx() usage
      in favor of target_put_sess_cmd() w/ se_cmd_t->cmd_kref within ib_srpt
      response callbacks.
      
      It also updates srpt_abort_cmd() to call target_put_sess_cmd() for
      completion of aborted commands, and adds target_wait_for_sess_cmds() into
      srpt_release_channel_work() to allow outstanding I/O to complete during
      session shutdown.
      
      Also, go ahead and update srpt_handle_tsk_mgmt() to make the remaining
      transport_init_se_cmd() to setup the ioctx->cmd with se_tmr_req.
      
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Bart Van Assche <bvanassche@acm.org>
      Cc: Roland Dreier <roland@kernel.org>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      9474b043
  22. 07 11月, 2012 1 次提交
    • C
      target: pass sense_reason as a return value · de103c93
      Christoph Hellwig 提交于
      Pass the sense reason as an explicit return value from the I/O submission
      path instead of storing it in struct se_cmd and using negative return
      values.  This cleans up a lot of the code pathes, and with the sparse
      annotations for the new sense_reason_t type allows for much better
      error checking.
      
      (nab: Convert spc_emulate_modesense + spc_emulate_modeselect to use
            sense_reason_t with Roland's MODE SELECT changes)
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Cc: Roland Dreier <roland@purestorage.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      de103c93
  23. 18 9月, 2012 2 次提交
  24. 16 8月, 2012 1 次提交
  25. 17 7月, 2012 1 次提交
  26. 15 4月, 2012 2 次提交
  27. 12 4月, 2012 1 次提交
    • R
      IB/srpt: Set srq_type to IB_SRQT_BASIC · 6f360336
      Roland Dreier 提交于
      Since commit 96104eda ("RDMA/core: Add SRQ type field"), kernel
      users of SRQs need to specify srq_type = IB_SRQT_BASIC in struct
      ib_srq_init_attr, or else most low-level drivers will fail in
      when srpt_add_one() calls ib_create_srq() and gets -ENOSYS.
      
      (mlx4_ib works OK nearly all of the time, because it just needs
      srq_type != IB_SRQT_XRC.  And apparently nearly everyone using
      ib_srpt is using mlx4 hardware)
      Reported-by: NAlexey Shvetsov <alexxy@gentoo.org>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NRoland Dreier <roland@purestorage.com>
      6f360336
  28. 18 3月, 2012 1 次提交
    • N
      ib_srpt: Fix srpt_handle_cmd send_ioctx->ioctx_kref leak on exception · 187e70a5
      Nicholas Bellinger 提交于
      This patch addresses a bug in srpt_handle_cmd() failure handling where
      send_ioctx->kref is being leaked with the local extra reference after init,
      causing the expected kref_put() in srpt_handle_send_comp() to not be the final
      call to invoke srpt_put_send_ioctx_kref() -> transport_generic_free_cmd() and
      perform se_cmd descriptor memory release.
      
      It also fixes a SCF_SCSI_RESERVATION_CONFLICT handling bug where this code
      is incorrectly falling through to transport_handle_cdb_direct() after
      invoking srpt_queue_status() to send SAM_STAT_RESERVATION_CONFLICT status.
      
      Note this patch is for >= v3.3 mainline code, and current lio-core.git
      code has already been converted to target_submit_cmd() + se_cmd->cmd_kref usage,
      and internal ioctx->kref usage has been removed.  I'm including this patch
      now into target-pending/for-next with a CC' for v3.3 stable.
      
      Cc: Bart Van Assche <bvanassche@acm.org>
      Cc: Roland Dreier <roland@purestorage.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      187e70a5
  29. 11 3月, 2012 1 次提交
  30. 26 2月, 2012 3 次提交
  31. 10 2月, 2012 1 次提交
  32. 07 2月, 2012 1 次提交
  33. 04 2月, 2012 1 次提交
  34. 03 2月, 2012 2 次提交