1. 07 4月, 2014 10 次提交
    • 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
    • N
      iser-target: Match FRMR descriptors to available session tags · f46d6a8a
      Nicholas Bellinger 提交于
      This patch changes isert_conn_create_fastreg_pool() to follow
      logic in iscsi_target_locate_portal() for determining how many
      FRMR descriptors to allocate based upon the number of possible
      per-session command slots that are available.
      
      This addresses an OOPs in isert_reg_rdma() where due to the
      use of ISCSI_DEF_XMIT_CMDS_MAX could end up returning a bogus
      fast_reg_descriptor when the number of active tags exceeded
      the original hardcoded max.
      
      Note this also includes moving isert_conn_create_fastreg_pool()
      from isert_connect_request() to isert_put_login_tx() before
      posting the final Login Response PDU in order to determine the
      se_nacl->queue_depth (eg: number of tags) per session the target
      will be enforcing.
      
      v2 changes:
        - Move isert_conn->conn_fr_pool list_head init into
          isert_conn_request()
      v3 changes:
        - Drop unnecessary list_empty() check in isert_reg_rdma()
          (Sagi)
      
      Cc: Sagi Grimberg <sagig@mellanox.com>
      Cc: Or Gerlitz <ogerlitz@mellanox.com>
      Cc: <stable@vger.kernel.org> #3.12+
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      f46d6a8a
    • S
      Target/iser: Fail SCSI WRITE command if device detected integrity error · 5bac4b1a
      Sagi Grimberg 提交于
      If during data-transfer a data-integrity error was detected we
      must fail the command with CHECK_CONDITION and not execute
      the command.
      Signed-off-by: NSagi Grimberg <sagig@mellanox.com>
      Reported-by: NOr Gerlitz <ogerlitz@mellanox.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      5bac4b1a
    • S
      Target/iser: Move check signature status to a function · 96b7973e
      Sagi Grimberg 提交于
      Remove code duplication from RDMA_READ and RDMA_WRITE
      completions that do basically the same check.
      Signed-off-by: NSagi Grimberg <sagig@mellanox.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      96b7973e
    • S
      Target/iser: Consider DIF and RDMA_READ completions when calculating post_send counter · 897bb2c9
      Sagi Grimberg 提交于
      If protection is involved, iSER target must wait for
      completion of RDMA_READ before sending SCSI response.
      So we must consider that when calculating post_send_buf_count
      additions, also when processing good/error completions.
      Signed-off-by: NSagi Grimberg <sagig@mellanox.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      897bb2c9
    • S
      Target/iser: Fix signature work requests accounting · c2caa207
      Sagi Grimberg 提交于
      As REG_SIG_MR work request and it's LOCAL_INVALIDATE are
      not accounted in post_send_buf_count we must color these
      with ISER_FASTREG_LI_WRID in order to process their error
      completions when the QP flushes.
      Signed-off-by: NSagi Grimberg <sagig@mellanox.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      c2caa207
    • S
      IB/isert: Support T10-PI protected transactions · 9e961ae7
      Sagi Grimberg 提交于
      In case the Target core passed transport T10 protection
      operation:
      
      1. Register data buffer (data memory region)
      2. Register protection buffer if exsists (prot memory region)
      3. Register signature region (signature memory region)
         - use work request IB_WR_REG_SIG_MR
      4. Execute RDMA
      5. Upon RDMA completion check the signature status
         - if succeeded send good SCSI response
         - if failed send SCSI bad response with appropriate sense buffer
      
      (Fix up compile error in isert_reg_sig_mr, and fix up incorrect
       se_cmd->prot_type -> TARGET_PROT_NORMAL comparision - nab)
      (Fix failed sector assignment in isert_completion_rdma_* - Sagi + nab)
      (Fix enum assignements for protection type - Sagi)
      (Fix devision on 32-bit in isert_completion_rdma_* - Sagi + Fengguang)
      (Fix context change for v3.14-rc6 code - nab)
      (Fix iscsit_build_rsp_pdu inc_statsn flag usage - nab)
      Signed-off-by: NSagi Grimberg <sagig@mellanox.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      9e961ae7
    • S
      IB/isert: Accept RDMA_WRITE completions · f93f3a70
      Sagi Grimberg 提交于
      In case of protected transactions, we will need to check the
      protection status of the transaction before sending SCSI response.
      So be ready for RDMA_WRITE completions. currently we don't ask
      for these completions, but for T10-PI we will.
      Signed-off-by: NSagi Grimberg <sagig@mellanox.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      f93f3a70
    • S
      IB/isert: Initialize T10-PI resources · d3e125da
      Sagi Grimberg 提交于
      Introduce pi_context to hold relevant RDMA protection resources.
      We eliminate data_key_valid boolean and replace it with indicators
      container to indicate:
      - Is the descriptor protected (registered via signature MR)
      - Is the data_mr key valid (can spare LOCAL_INV WR)
      - Is the prot_mr key valid (can spare LOCAL_INV WR)
      - Is the sig_mr key valid (can spare LOCAL_INV WR)
      
      Upon connection establishment check if network portal is T10-PI
      enabled and allocate T10-PI resources if necessary, allocate
      signature enabled memory regions and mark connection queue-pair
      as signature enabled.
      
      (Fix context change for v3.14-rc6 code - nab)
      Signed-off-by: NSagi Grimberg <sagig@mellanox.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      d3e125da
    • S
      IB/isert: Introduce isert_map/unmap_data_buf · e3d7e4c3
      Sagi Grimberg 提交于
      export map/unmap data buffer to a routine that may
      be used in various places in the code and keep the
      mapping data in a designated descriptor. Also, let
      isert_fast_reg_mr to decide weather to use global
      MR or do fast registration.
      
      This commit does not change any functionality.
      
      (Fix context change for v3.14-rc6 code - nab)
      Signed-off-by: NSagi Grimberg <sagig@mellanox.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      e3d7e4c3
  2. 05 3月, 2014 5 次提交
    • N
      iser-target: Fix command leak for tx_desc->comp_llnode_batch · ebbe4421
      Nicholas Bellinger 提交于
      This patch addresses a number of active I/O shutdown issues
      related to isert_cmd descriptors being leaked that are part
      of a completion interrupt coalescing batch.
      
      This includes adding logic in isert_cq_tx_comp_err() to
      drain any associated tx_desc->comp_llnode_batch, as well
      as isert_cq_drain_comp_llist() to drain any associated
      isert_conn->conn_comp_llist.
      
      Also, set tx_desc->llnode_active in isert_init_send_wr()
      in order to determine when work requests need to be skipped
      in isert_cq_tx_work() exception path code.
      
      Finally, update isert_init_send_wr() to only allow interrupt
      coalescing when ISER_CONN_UP.
      Acked-by: NSagi Grimberg <sagig@mellanox.com>
      Cc: Or Gerlitz <ogerlitz@mellanox.com>
      Cc: <stable@vger.kernel.org> #3.13+
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      ebbe4421
    • N
      iser-target: Ignore completions for FRWRs in isert_cq_tx_work · 9bb4ca68
      Nicholas Bellinger 提交于
      This patch changes IB_WR_FAST_REG_MR + IB_WR_LOCAL_INV related
      work requests to include a ISER_FRWR_LI_WRID value in order to
      signal isert_cq_tx_work() that these requests should be ignored.
      
      This is necessary because even though IB_SEND_SIGNALED is not
      set for either work request, during a QP failure event the work
      requests will be returned with exception status from the TX
      completion queue.
      
      v2 changes:
       - Rename ISER_FRWR_LI_WRID -> ISER_FASTREG_LI_WRID (Sagi)
      Acked-by: NSagi Grimberg <sagig@mellanox.com>
      Cc: Or Gerlitz <ogerlitz@mellanox.com>
      Cc: <stable@vger.kernel.org> #3.12+
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      9bb4ca68
    • N
      iser-target: Fix post_send_buf_count for RDMA READ/WRITE · b6b87a1d
      Nicholas Bellinger 提交于
      This patch fixes the incorrect setting of ->post_send_buf_count
      related to RDMA WRITEs + READs where isert_rdma_rw->send_wr_num
      was not being taken into account.
      
      This includes incrementing ->post_send_buf_count within
      isert_put_datain() + isert_get_dataout(), decrementing within
      __isert_send_completion() + isert_response_completion(), and
      clearing wr->send_wr_num within isert_completion_rdma_read()
      
      This is necessary because even though IB_SEND_SIGNALED is
      not set for RDMA WRITEs + READs, during a QP failure event
      the work requests will be returned with exception status
      from the TX completion queue.
      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>
      b6b87a1d
    • 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
    • N
      iscsi/iser-target: Use list_del_init for ->i_conn_node · 5159d763
      Nicholas Bellinger 提交于
      There are a handful of uses of list_empty() for cmd->i_conn_node
      within iser-target code that expect to return false once a cmd
      has been removed from the per connect list.
      
      This patch changes all uses of list_del -> list_del_init in order
      to ensure that list_empty() returns false as expected.
      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>
      5159d763
  3. 13 2月, 2014 1 次提交
    • N
      iser-target: Fix leak on failure in isert_conn_create_fastreg_pool · a80e21b3
      Nicholas Bellinger 提交于
      This patch fixes a memory leak for fr_desc upon failure of
      isert_create_fr_desc() in isert_conn_create_fastreg_pool()
      code.
      
      As reported by Coverity 1166659:
      
      *** CID 1166659:  Resource leak  (RESOURCE_LEAK)
      /drivers/infiniband/ulp/isert/ib_isert.c: 470 in isert_conn_create_fastreg_pool()
      464                      isert_conn, isert_conn->conn_fr_pool_size);
      465
      466             return 0;
      467
      468     err:
      469             isert_conn_free_fastreg_pool(isert_conn);
      >>>     CID 1166659:  Resource leak  (RESOURCE_LEAK)
      >>>     Variable "fr_desc" going out of scope leaks the storage it points to.
      470             return ret;
      471     }
      472
      473     static int
      474     isert_connect_request(struct rdma_cm_id *cma_id, struct rdma_cm_event *event)
      475     {
      
      Cc: Sagi Grimberg <sagig@mellanox.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      a80e21b3
  4. 25 1月, 2014 1 次提交
  5. 19 1月, 2014 4 次提交
  6. 19 12月, 2013 1 次提交
  7. 12 12月, 2013 1 次提交
  8. 13 11月, 2013 2 次提交
  9. 07 11月, 2013 1 次提交
    • N
      ib_isert: Add support for completion interrupt coalescing · 95b60f07
      Nicholas Bellinger 提交于
      This patch adds support for completion interrupt coalescing that
      allows only every ISERT_COMP_BATCH_COUNT (8) to set IB_SEND_SIGNALED,
      thus avoiding completion interrupts for every posted iser_tx_desc.
      
      The batch processing is done using a per isert_conn llist that once
      IB_SEND_SIGNALED has been set is saved to tx_desc->comp_llnode_batch,
      and completion processing of previously posted iser_tx_descs is done
      in a single shot from within isert_send_completion() code.
      
      Note this is only done for response PDUs from ISCSI_OP_SCSI_CMD, and
      all other control type of PDU responses will force an implicit batch
      drain to occur.
      
      Cc: Or Gerlitz <ogerlitz@mellanox.com>
      Cc: Sagi Grimberg <sagig@mellanox.com>
      Cc: Kent Overstreet <kmo@daterainc.com>
      Cc: Roland Dreier <roland@purestorage.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      95b60f07
  10. 24 10月, 2013 1 次提交
  11. 11 9月, 2013 4 次提交
  12. 10 9月, 2013 2 次提交
    • 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
    • N
      iser-target: Updates for login negotiation multi-plexing support · 6faaa85f
      Nicholas Bellinger 提交于
      This patch updates iser-target code to support login negotiation
      multi-plexing.  This includes only using isert_conn->conn_login_comp
      for the first login request PDU, pushing the subsequent processing
      to iscsi_conn->login_work -> iscsi_target_do_login_rx(), and turning
      isert_get_login_rx() into a NOP.
      
      v3 changes:
         - Drop unnecessary LOGIN_FLAGS_READ_ACTIVE bit set in
           isert_rx_login_req()
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      6faaa85f
  13. 08 7月, 2013 5 次提交
  14. 07 7月, 2013 2 次提交
    • N
      iscsi-target: Fix ISCSI_OP_SCSI_TMFUNC handling for iser · 186a9647
      Nicholas Bellinger 提交于
      This patch adds target_get_sess_cmd reference counting for
      iscsit_handle_task_mgt_cmd(), and adds a target_put_sess_cmd()
      for the failure case.
      
      It also fixes a bug where ISCSI_OP_SCSI_TMFUNC type commands
      where leaking iscsi_cmd->i_conn_node and eventually triggering
      an OOPs during struct isert_conn shutdown.
      
      Cc: stable@vger.kernel.org  # 3.10+
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      186a9647
    • 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