1. 10 5月, 2016 7 次提交
  2. 27 1月, 2016 1 次提交
  3. 27 8月, 2015 4 次提交
  4. 03 8月, 2015 2 次提交
  5. 25 7月, 2015 1 次提交
    • N
      iscsi-target: Fix iscsit_start_kthreads failure OOPs · e5419865
      Nicholas Bellinger 提交于
      This patch fixes a regression introduced with the following commit
      in v4.0-rc1 code, where a iscsit_start_kthreads() failure triggers
      a NULL pointer dereference OOPs:
      
          commit 88dcd2da
          Author: Nicholas Bellinger <nab@linux-iscsi.org>
          Date:   Thu Feb 26 22:19:15 2015 -0800
      
              iscsi-target: Convert iscsi_thread_set usage to kthread.h
      
      To address this bug, move iscsit_start_kthreads() immediately
      preceeding the transmit of last login response, before signaling
      a successful transition into full-feature-phase within existing
      iscsi_target_do_tx_login_io() logic.
      
      This ensures that no target-side resource allocation failures can
      occur after the final login response has been successfully sent.
      
      Also, it adds a iscsi_conn->rx_login_comp to allow the RX thread
      to sleep to prevent other socket related failures until the final
      iscsi_post_login_handler() call is able to complete.
      
      Cc: Sagi Grimberg <sagig@mellanox.com>
      Cc: <stable@vger.kernel.org> # v3.10+
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      e5419865
  6. 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
  7. 31 5月, 2015 2 次提交
    • C
      144bc4c2
    • C
      iscsi-target: remove support for obsolete markers · c04a6091
      Christophe Vu-Brugier 提交于
      Support for markers is currently broken because of a bug in
      iscsi_enforce_integrity_rules(): the "IFMarkInt_Reject" and
      "OFMarkInt_Reject" variables are always equal to 1 in
      iscsi_enforce_integrity_rules().
      
      Moreover, fixed interval markers keys (IFMarker, OFMarker, IFMarkInt
      and OFMarkInt) are obsolete according to iSCSI RFC 7143:
      
      >From http://tools.ietf.org/html/rfc7143#section-13.25:
      
         13.25.  Obsoleted Keys
      
         This document obsoletes the following keys defined in [RFC3720]:
         IFMarker, OFMarker, OFMarkInt, and IFMarkInt.  However, iSCSI
         implementations compliant to this document may still receive these
         obsoleted keys -- i.e., in a responder role -- in a text negotiation.
      
         When an IFMarker or OFMarker key is received, a compliant iSCSI
         implementation SHOULD respond with the constant "Reject" value.  The
         implementation MAY alternatively respond with a "No" value.
      
         However, the implementation MUST NOT respond with a "NotUnderstood"
         value for either of these keys.
      
         When an IFMarkInt or OFMarkInt key is received, a compliant iSCSI
         implementation MUST respond with the constant "Reject" value.  The
         implementation MUST NOT respond with a "NotUnderstood" value for
         either of these keys.
      
      This patch disables markers by turning the corresponding parameters to
      read-only. The default value of IFMarker and OFMarker remains "No" but
      the user cannot change it to "Yes" anymore. The new value of IFMarkInt
      and OFMarkInt is "Reject".
      
      (Drop left-over iscsi_get_value_from_number_range + make configfs
       parameters attrs R/W nops - nab)
      Signed-off-by: NChristophe Vu-Brugier <cvubrugier@fastmail.fm>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      c04a6091
  8. 08 4月, 2015 1 次提交
    • 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
  9. 27 3月, 2015 2 次提交
  10. 13 2月, 2015 1 次提交
  11. 05 2月, 2015 1 次提交
  12. 31 1月, 2015 1 次提交
  13. 12 6月, 2014 1 次提交
  14. 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
  15. 05 3月, 2014 1 次提交
    • N
      iscsi/iser-target: Fix isert_conn->state hung shutdown issues · defd8848
      Nicholas Bellinger 提交于
      This patch addresses a couple of different hug shutdown issues
      related to wait_event() + isert_conn->state.  First, it changes
      isert_conn->conn_wait + isert_conn->conn_wait_comp_err from
      waitqueues to completions, and sets ISER_CONN_TERMINATING from
      within isert_disconnect_work().
      
      Second, it splits isert_free_conn() into isert_wait_conn() that
      is called earlier in iscsit_close_connection() to ensure that
      all outstanding commands have completed before continuing.
      
      Finally, it breaks isert_cq_comp_err() into seperate TX / RX
      related code, and adds logic in isert_cq_rx_comp_err() to wait
      for outstanding commands to complete before setting ISER_CONN_DOWN
      and calling complete(&isert_conn->conn_wait_comp_err).
      Acked-by: NSagi Grimberg <sagig@mellanox.com>
      Cc: Or Gerlitz <ogerlitz@mellanox.com>
      Cc: <stable@vger.kernel.org> #3.10+
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      defd8848
  16. 25 1月, 2014 1 次提交
  17. 10 9月, 2013 1 次提交
    • N
      iscsi/iser-target: Convert to command priv_size usage · d703ce2f
      Nicholas Bellinger 提交于
      This command converts iscsi/isert-target to use allocations based on
      iscsit_transport->priv_size within iscsit_allocate_cmd(), instead of
      using an embedded isert_cmd->iscsi_cmd.
      
      This includes removing iscsit_transport->alloc_cmd() usage, along
      with updating isert-target code to use iscsit_priv_cmd().
      
      Also, remove left-over iscsit_transport->release_cmd() usage for
      direct calls to iscsit_release_cmd(), and drop the now unused
      lio_cmd_cache and isert_cmd_cache.
      
      Cc: Or Gerlitz <ogerlitz@mellanox.com>
      Cc: Kent Overstreet <kmo@daterainc.com>
      Signed-off-by: NNicholas Bellinger <nab@daterainc.com>
      d703ce2f
  18. 08 7月, 2013 1 次提交
    • N
      iser-target: Fix session reset bug with RDMA_CM_EVENT_DISCONNECTED · b2cb9649
      Nicholas Bellinger 提交于
      This patch addresses a bug where RDMA_CM_EVENT_DISCONNECTED may occur
      before the connection shutdown has been completed by rx/tx threads,
      that causes isert_free_conn() to wait indefinately on ->conn_wait.
      
      This patch allows isert_disconnect_work code to invoke rdma_disconnect
      when isert_disconnect_work() process context is started by client
      session reset before isert_free_conn() code has been reached.
      
      It also adds isert_conn->conn_mutex protection for ->state within
      isert_disconnect_work(), isert_cq_comp_err() and isert_free_conn()
      code, along with isert_check_state() for wait_event usage.
      
      (v2: Add explicit iscsit_cause_connection_reinstatement call
           during isert_disconnect_work() to force conn reset)
      
      Cc: stable@vger.kernel.org  # 3.10+
      Cc: Or Gerlitz <ogerlitz@mellanox.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      b2cb9649
  19. 07 7月, 2013 2 次提交
    • N
      iscsi-target: Fix iscsit_sequence_cmd reject handling for iser · 561bf158
      Nicholas Bellinger 提交于
      This patch moves ISCSI_OP_REJECT failures into iscsit_sequence_cmd()
      in order to avoid external iscsit_reject_cmd() reject usage for all
      PDU types.
      
      It also updates PDU specific handlers for traditional iscsi-target
      code to not reset the session after posting a ISCSI_OP_REJECT during
      setup.
      
      (v2: Fix CMDSN_LOWER_THAN_EXP for ISCSI_OP_SCSI to call
           target_put_sess_cmd() after iscsit_sequence_cmd() failure)
      
      Cc: Or Gerlitz <ogerlitz@mellanox.com>
      Cc: Mike Christie <michaelc@cs.wisc.edu>
      Cc: stable@vger.kernel.org  # 3.10+
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      561bf158
    • N
      iscsi-target: Fix iscsit_add_reject* usage for iser · ba159914
      Nicholas Bellinger 提交于
      This patch changes iscsit_add_reject() + iscsit_add_reject_from_cmd()
      usage to not sleep on iscsi_cmd->reject_comp to address a free-after-use
      usage bug in v3.10 with iser-target code.
      
      It saves ->reject_reason for use within iscsit_build_reject() so the
      correct value for both transport cases.  It also drops the legacy
      fail_conn parameter usage throughput iscsi-target code and adds
      two iscsit_add_reject_cmd() and iscsit_reject_cmd helper functions,
      along with various small cleanups.
      
      (v2: Re-enable target_put_sess_cmd() to be called from
           iscsit_add_reject_from_cmd() for rejects invoked after
           target_get_sess_cmd() has been called)
      
      Cc: Or Gerlitz <ogerlitz@mellanox.com>
      Cc: Mike Christie <michaelc@cs.wisc.edu>
      Cc: stable@vger.kernel.org  # 3.10+
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      ba159914
  20. 26 6月, 2013 1 次提交
    • N
      iscsi-target: Refactor ISCSI_OP_TEXT_RSP TX handling · 889c8a68
      Nicholas Bellinger 提交于
      This patch refactoring existing iscsit_send_text_rsp() in order
      to handle iscsi_text_rsp payloads in a transport specific manner.
      
      This includes the addition of iscsit_build_text_rsp() to build
      the response payload and initialize ISCSI_OP_TEXT_RSP.
      
      v2: Make iscsit_build_text_rsp() determine extra padding bytes, and
          drop legacy padding calculation for traditional iSCSI text
          responses within iscsit_send_text_rsp()
      Reported-by: NOr Gerlitz <ogerlitz@mellanox.com>
      Cc: Or Gerlitz <ogerlitz@mellanox.com>
      Cc: Mike Christie <michaelc@cs.wisc.edu>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      889c8a68
  21. 25 6月, 2013 2 次提交
    • N
      iscsi-target: Refactor ISCSI_OP_TEXT RX handling · 64534aa7
      Nicholas Bellinger 提交于
      This patch refactors ISCSI_OP_TEXT handling within iscsi-target in
      order to handle iscsi_text payloads in a transport specific manner.
      
      This includes splitting current iscsit_handle_text_cmd() into
      iscsit_setup_text_cmd() and iscsit_process_text_cmd() calls, and
      makes iscsit_handle_text_cmd be only used internally by traditional
      iscsi socket calls.
      
      Cc: Or Gerlitz <ogerlitz@mellanox.com>
      Cc: Mike Christie <michaelc@cs.wisc.edu>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      64534aa7
    • N
      iscsi/isert-target: Refactor ISCSI_OP_NOOP RX handling · 778de368
      Nicholas Bellinger 提交于
      This patch refactors ISCSI_OP_NOOP handling within iscsi-target in
      order to handle iscsi_nopout payloads in a transport specific manner.
      
      This includes splitting existing iscsit_handle_nop_out() into
      iscsit_setup_nop_out() and iscsit_process_nop_out() calls, and
      makes iscsit_handle_nop_out() be only used internally by traditional
      iscsi socket calls.
      
      Next update iser-target code to use new callers and add FIXME for
      the handling iscsi_nopout payloads.  Also fix reject response handling
      in iscsit_setup_nop_out() to use proper iscsit_add_reject_from_cmd().
      
      v2: Fix uninitialized iscsit_handle_nop_out() payload_length usage (Fengguang)
      v3: Remove left-over dead code in iscsit_setup_nop_out() (DanC)
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      778de368
  22. 25 4月, 2013 1 次提交
    • N
      iscsi-target: Add iscsit_transport API template · 3f993063
      Nicholas Bellinger 提交于
      Add basic struct iscsit_transport API template to allow iscsi-target for
      running with external transport modules using existing iscsi_target_core.h
      code.
      
      For all external modules, this calls try_module_get() and module_put()
      to obtain + release an external iscsit_transport module reference count.
      
      Also include the iscsi-target symbols necessary in iscsi_transport.h to
      allow external transport modules to function.
      
      v3 changes:
      - Add iscsit_build_reject export for ISTATE_SEND_REJECT usage
      
      v2 changes:
      
      - Drop unnecessary export of iscsit_get_transport + iscsit_put_transport (roland)
      - Add ->iscsit_queue_data_in() to remove extra context switch on RDMA_WRITE
      - Add ->iscsit_queue_status() to remove extra context switch on IB_SEND status
      - Add ->iscsit_get_dataout() to remove extra context switch on RDMA_READ
      - Drop ->iscsit_free_cmd()
      - Drop ->iscsit_unmap_cmd()
      - Rename iscsit_create_transport() -> iscsit_register_transport() (andy)
      - Rename iscsit_destroy_transport() -> iscsit_unregister_transport() (andy)
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      3f993063