1. 31 5月, 2015 7 次提交
  2. 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
  3. 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
  4. 07 3月, 2015 1 次提交
  5. 31 1月, 2015 1 次提交
  6. 16 1月, 2015 1 次提交
  7. 18 9月, 2014 1 次提交
  8. 07 4月, 2014 2 次提交
    • 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
    • S
      Target/configfs: Expose iSCSI network portal group T10-PI support · 8085176f
      Sagi Grimberg 提交于
      User may enable T10-PI support per network portal group. any connection
      established on top of it, will be required to serve protected transactions.
      Signed-off-by: NSagi Grimberg <sagig@mellanox.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      8085176f
  9. 12 12月, 2013 1 次提交
  10. 21 11月, 2013 1 次提交
  11. 13 11月, 2013 1 次提交
    • N
      iscsi-target: Fix mutex_trylock usage in iscsit_increment_maxcmdsn · 5e8e6b4b
      Nicholas Bellinger 提交于
      This patch fixes a >= v3.10 regression bug with mutex_trylock() usage
      within iscsit_increment_maxcmdsn(), that was originally added to allow
      for a special case where ->cmdsn_mutex was already held from the
      iscsit_execute_cmd() exception path for ib_isert.
      
      When !mutex_trylock() was occuring under contention during normal RX/TX
      process context codepaths, the bug was manifesting itself as the following
      protocol error:
      
        Received CmdSN: 0x000fcbb7 is greater than MaxCmdSN: 0x000fcbb6, protocol error.
        Received CmdSN: 0x000fcbb8 is greater than MaxCmdSN: 0x000fcbb6, protocol error.
      
      This patch simply avoids the direct ib_isert callback in lio_queue_status()
      for the special iscsi_execute_cmd() exception cases, that allows the problematic
      mutex_trylock() usage in iscsit_increment_maxcmdsn() to go away.
      Reported-by: NMoussa Ba <moussaba@micron.com>
      Tested-by: NMoussa Ba <moussaba@micron.com>
      Cc: <stable@vger.kernel.org> # v3.10+
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      5e8e6b4b
  12. 24 10月, 2013 1 次提交
  13. 17 10月, 2013 2 次提交
  14. 11 9月, 2013 1 次提交
  15. 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
  16. 13 8月, 2013 1 次提交
  17. 08 7月, 2013 4 次提交
  18. 04 7月, 2013 1 次提交
    • N
      iscsi-target: Add demo-mode TPG authentication context support · c3e51442
      Nicholas Bellinger 提交于
      This patch adds a auth configfs group context following existing
      explict NodeACL and discovery auth within:
      
        /sys/kernel/config/target/iscsi/$TARGETNAME/$TPGT/auth/
      
      This patch allows these attributes to be used for CHAP authentication
      an TPG is configured in demo-mode (generate_node_acl=1).
      
      Note this authentication information takes precedence over NodeACL
      authentication when struct se_node_acl->dynamic_node_acl is present.
      
      Cc: Dax Kelson <dkelson@gurulabs.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      c3e51442
  19. 21 6月, 2013 2 次提交
  20. 25 4月, 2013 4 次提交
    • N
      iscsi-target: Add iser network portal attribute · 72438cdd
      Nicholas Bellinger 提交于
      This patch adds a new network portal attribute for iser, that lives
      under existing iscsi-target configfs layout at:
      
         /sys/kernel/config/target/iscsi/$TARGETNAME/$TPGT/np/$PORTAL/iser
      
      When lio_target_np_store_iser() is enabled, iscsit_tpg_add_network_portal()
      will attempt to start an rdma_cma network portal for iser-target, only if
      the external ib_isert module transport has been loaded.
      
      When disabled, iscsit_tpg_del_network_portal() will cease iser login service
      on the network portal, and release any external ib_isert module reference.
      
      v4 changes:
      
      - Add request_module for ib_isert to lio_target_np_store_iser()
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      72438cdd
    • N
      iscsi-target: Refactor TX queue logic + export response PDU creation · 2ec5a8c1
      Nicholas Bellinger 提交于
      This patch refactors TX immediate + response queue handling to use
      the new iscsit_transport API callers, and exports the necessary
      traditional iscsi PDU response creation functions for iser-target
      to utilize.
      
      This includes:
      
      - Add iscsit_build_datain_pdu() for DATAIN PDU init + convert
        iscsit_build_datain_pdu()
      - Add iscsit_build_logout_rsp() for LOGOUT_RSP PDU init + convert
        iscsit_send_logout()
      - Add iscsit_build_nopin_rsp() for NOPIN_RSP PDU init + convert
        iscsit_send_nopin()
      - Add iscsit_build_rsp_pdu() for SCSI_RSP PDU init + convert
        iscsit_send_response()
      - Add iscsit_build_task_mgt_rsp for TM_RSP PDU init + convert
        iscsit_send_task_mgt_rsp()
      - Refactor immediate queue state switch into iscsit_immediate_queue()
      - Convert handle_immediate_queue() to use iscsit_transport caller
      - Refactor response queue state switch into iscsit_response_queue()
      - Convert handle_response_queue to use iscsit_transport caller
      - Export iscsit_logout_post_handler(), iscsit_increment_maxcmdsn()
        and iscsit_tmr_post_handler() for external transport module usage
      
      v5 changes:
      
      - Fix solicited NopIN handling with RDMAExtensions=No (nab)
      
      v3 changes:
      - Add iscsit_build_reject for REJECT PDU init + convert
        iscsit_send_reject()
      
      v2 changes:
      
      - Add iscsit_queue_rsp() for iscsit_transport->iscsit_queue_data_in()
        and iscsit_transport->iscsit_queue_status()
      - Update lio_queue_data_in() to use ->iscsit_queue_data_in()
      - Update lio_queue_status() to use ->iscsit_queue_status()
      - Use mutex_trylock() in iscsit_increment_maxcmdsn()
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      2ec5a8c1
    • N
      iscsi-target: Refactor RX PDU logic + export request PDU handling · 3e1c81a9
      Nicholas Bellinger 提交于
      This patch refactors existing traditional iscsi RX side PDU handling
      to use iscsit_transport, and exports the necessary logic for external
      transport modules.
      
      This includes:
      
      - Refactor iscsit_handle_scsi_cmd() into PDU setup / processing
      - Add updated iscsit_handle_scsi_cmd() for tradtional iscsi code
      - Add iscsit_set_unsoliticed_dataout() wrapper
      - Refactor iscsit_handle_data_out() into PDU check / processing
      - Add updated iscsit_handle_data_out() for tradtional iscsi code
      - Add iscsit_handle_nop_out() + iscsit_handle_task_mgt_cmd() to
        accept pre-allocated struct iscsi_cmd
      - Add iscsit_build_r2ts_for_cmd() caller for iscsi_target_transport
        to handle ISTATE_SEND_R2T for TX immediate queue
      - Refactor main traditional iscsi iscsi_target_rx_thread() PDU switch
        into iscsi_target_rx_opcode() using iscsit_allocate_cmd()
      - Turn iscsi_target_rx_thread() process context into NOP for
        ib_isert side work-queue.
      
      v5 changes:
      
      - Make iscsit_handle_scsi_cmd() static (Fengguang)
      - Fix iscsit_handle_scsi_cmd() exception se_cmd leak (nab)
      
      v3 changes:
      - Add extra target_put_sess_cmd call in iscsit_add_reject_from_cmd
        after completion
      
      v2 changes:
      
      - Disable iscsit_ack_from_expstatsn() usage for RDMAExtentions=Yes
      - Disable iscsit_allocate_datain_req() usage for RDMAExtentions=Yes
      - Add target_get_sess_cmd() reference counting to
        iscsit_setup_scsi_cmd()
      - Add TFO->lio_check_stop_free() fabric API caller
      - Add export of iscsit_stop_dataout_timer() symbol
      - Add iscsit_build_r2ts_for_cmd() for iscsit_transport->iscsit_get_dataout()
      - Convert existing usage of iscsit_build_r2ts_for_cmd() to
        ->iscsit_get_dataout()
      - Drop RDMAExtentions=Yes specific check in iscsit_build_r2ts_for_cmd()
      - Fix RDMAExtentions -> RDMAExtensions typo (andy)
      - Pass correct dump_payload value into iscsit_get_immediate_data()
        for iscsit_handle_scsi_cmd()
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      3e1c81a9
    • N
      iscsi-target: Add per transport iscsi_cmd alloc/free · cdb72665
      Nicholas Bellinger 提交于
      This patch converts struct iscsi_cmd memory allocation + free to use
      ->iscsit_alloc_cmd() iscsit_transport API caller, and export
      iscsit_allocate_cmd() symbols
      
      Also add iscsi_cmd->release_cmd() to be used seperately from
      iscsit_transport for connection/session shutdown.
      
      v2 changes:
      
      - Remove unnecessary checks in iscsit_alloc_cmd (asias)
      - Drop iscsit_transport->iscsit_free_cmd() usage
      - Drop iscsit_transport->iscsit_unmap_cmd() usage
      - Add iscsi_cmd->release_cmd()
      - Convert lio_release_cmd() to use iscsi_cmd->release_cmd()
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      cdb72665
  21. 14 12月, 2012 1 次提交
    • A
      target/iscsi_target: Add NodeACL tags for initiator group support · 79e62fc3
      Andy Grover 提交于
      Thanks for reviews, looking a lot better.
      
      ---- 8< ----
      
      Initiator access config could be easier. The way other storage vendors
      have addressed this is to support initiator groups: the admin adds
      initiator WWNs to the group, and then LUN permissions can be granted for
      the entire group at once.
      
      Instead of changing ktarget's configfs interface, this patch keeps
      the configfs interface per-initiator-wwn and just adds a 'tag' field
      for each. This should be enough for user tools like targetcli to group
      initiator ACLs and sync their configurations.
      
      acl_tag is not used internally, but needs to be kept in configfs so that
      all user tools can avoid dependencies on each other.
      
      Code tested to work, although userspace pieces still to be implemented.
      Signed-off-by: NAndy Grover <agrover@redhat.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      79e62fc3
  22. 28 11月, 2012 2 次提交
  23. 19 11月, 2012 1 次提交
  24. 04 10月, 2012 1 次提交