1. 15 3月, 2018 1 次提交
    • C
      scsi: lpfc: make several unions static, fix non-ANSI prototype · fab2e466
      Colin Ian King 提交于
      There are several unions that are local to the source and do not need to
      be in global scope, so make them static. Also add in a missing void
      parameter to functions lpfc_nvme_cmd_template and
      lpfc_nvmet_cmd_template to clean up non-ANSI warning.
      
      Cleans up sparse warnings:
      drivers/scsi/lpfc/lpfc_nvme.c:68:19: warning: symbol
      'lpfc_iread_cmd_template' was not declared. Should it be static?
      drivers/scsi/lpfc/lpfc_nvme.c:69:19: warning: symbol
      'lpfc_iwrite_cmd_template' was not declared. Should it be static?
      drivers/scsi/lpfc/lpfc_nvme.c:70:19: warning: symbol
      'lpfc_icmnd_cmd_template' was not declared. Should it be static?
      drivers/scsi/lpfc/lpfc_nvme.c:74:24: warning: non-ANSI function
      'lpfc_tsend_cmd_template' was not declared. Should it be static?
      drivers/scsi/lpfc/lpfc_nvmet.c:78:19: warning: symbol
      'lpfc_treceive_cmd_template' was not declared. Should it be static?
      drivers/scsi/lpfc/lpfc_nvmet.c:79:19: warning: symbol
      'lpfc_trsp_cmd_template' was not declared. Should it be static?
      drivers/scsi/lpfc/lpfc_nvmet.c:83:25: warning: non-ANSI function
      declaration of function 'lpfc_nvmet_cmd_template'
      Signed-off-by: NColin Ian King <colin.king@canonical.com>
      Acked-by: NJames Smart <james.smart@broadcom.com>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      fab2e466
  2. 13 3月, 2018 2 次提交
  3. 23 2月, 2018 3 次提交
  4. 13 2月, 2018 3 次提交
    • J
      scsi: lpfc: Update 11.4.0.7 modified files for 2018 Copyright · 128bddac
      James Smart 提交于
      Updated Copyright in files updated 11.4.0.7
      Signed-off-by: NDick Kennedy <dick.kennedy@broadcom.com>
      Signed-off-by: NJames Smart <james.smart@broadcom.com>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      128bddac
    • J
      scsi: lpfc: Fix nonrecovery of NVME controller after cable swap. · 815a9c43
      James Smart 提交于
      In a test that is doing large numbers of cable swaps on the target, the
      nvme controllers wouldn't reconnect.
      
      During the cable swaps, the targets n_port_id would change. This
      information was passed to the nvme-fc transport, in the new remoteport
      registration. However, the nvme-fc transport didn't update the n_port_id
      value in the remoteport struct when it reused an existing structure.
      Later, when a new association was attempted on the remoteport, the
      driver's NVME LS routine would use the stale n_port_id from the
      remoteport struct to address the LS. As the device is no longer at that
      address, the LS would go into never never land.
      
      Separately, the nvme-fc transport will be corrected to update the
      n_port_id value on a re-registration.
      
      However, for now, there's no reason to use the transports values.  The
      private pointer points to the drivers node structure and the node
      structure is up to date. Therefore, revise the LS routine to use the
      drivers data structures for the LS. Augmented the debug message for
      better debugging in the future.
      
      Also removed a duplicate if check that seems to have slipped in.
      Signed-off-by: NDick Kennedy <dick.kennedy@broadcom.com>
      Signed-off-by: NJames Smart <james.smart@broadcom.com>
      Reviewed-by: NHannes Reinecke <hare@suse.com>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      815a9c43
    • J
      scsi: lpfc: Fix IO failure during hba reset testing with nvme io. · 91455b85
      James Smart 提交于
      A stress test repeatedly resetting the adapter while performing io would
      eventually report I/O failures and missing nvme namespaces.
      
      The driver was setting the nvmefc_fcp_req->private pointer to NULL
      during the IO completion routine before upcalling done().  If the
      transport was also running an abort for that IO, the driver would fail
      the abort with message 6140. Failing the abort is not allowed by the
      nvme-fc transport, as it mandates that the io must be returned back to
      the transport. As that does not happen, the transport controller delete
      has an outstanding reference and can't complete teardown.
      
      The NULL-ing of the private pointer should be done only when the io is
      considered complete. It's complete when the adapter returns the exchange
      with the "exchange busy" flag clear.
      
      Move the NULL'ing of the structure to the done case. This leaves the io
      contexts set while it is busy and until the subsequent XRI_ABORTED
      completion which returns the exchange is received.
      Signed-off-by: NDick Kennedy <dick.kennedy@broadcom.com>
      Signed-off-by: NJames Smart <james.smart@broadcom.com>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      91455b85
  5. 21 12月, 2017 3 次提交
  6. 05 12月, 2017 5 次提交
  7. 17 10月, 2017 1 次提交
  8. 03 10月, 2017 7 次提交
  9. 26 9月, 2017 1 次提交
  10. 25 9月, 2017 1 次提交
  11. 25 8月, 2017 4 次提交
  12. 08 8月, 2017 1 次提交
  13. 27 6月, 2017 1 次提交
  14. 13 6月, 2017 3 次提交
    • J
      scsi: lpfc: Fix counters so outstandng NVME IO count is accurate · 2cee7808
      James Smart 提交于
      NVME FC counters don't reflect actual results
      
      Since counters are not atomic, or protected by a lock, the values often
      get screwed up.
      
      Make them atomic, like NVMET.  Fix up sysfs and debugfs display
      accordingly Added Outstanding IOs to stats display
      Signed-off-by: NDick Kennedy <dick.kennedy@broadcom.com>
      Signed-off-by: NJames Smart <james.smart@broadcom.com>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      2cee7808
    • J
      scsi: lpfc: Fix transition nvme-i rport handling to nport only. · 80cc0043
      James Smart 提交于
      As the devloss API was implemented in the nvmei driver, an evaluation of
      the nvme transport and the lpfc driver showed dual management of the
      rports.  This creates a bug possibility when the thread count and SAN
      size increases.
      
      The nvmei driver code was based on a very early transport and was not
      revisited until the devloss API was introduced.
      
      Remove the listhead in the driver's rport data structure and the
      listhead in the driver's lport data structure.  Remove all rport_list
      traversal.  Convert the driver to use the nrport (nvme rport) pointer
      that is now NULL or nonNULL depending on a devloss action.  Convert
      debugfs and nvme_info in sysfs to use the fc_nodes list in the vport.
      Signed-off-by: NDick Kennedy <dick.kennedy@broadcom.com>
      Signed-off-by: NJames Smart <james.smart@broadcom.com>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      80cc0043
    • J
      scsi: lpfc: Add nvme initiator devloss support · 7a06dcd3
      James Smart 提交于
      Add nvme initiator devloss support
      
      The existing implementation was based on no devloss behavior in the
      transport (e.g. immediate teardown) so code didn't properly handle
      delayed nvme rport device unregister calls.  In addition, the driver was
      not correctly cycling the rport port role for each
      register-unregister-reregister process.
      
      This patch does the following:
      
      Rework the code to properly handle rport device unregister calls and
      potential re-allocation of the remoteport structure if the port comes
      back in under dev_loss_tmo.
      
      Correct code that was incorrectly cycling the rport port role for each
      register-unregister-reregister process.
      
      Prep the code to enable calling the nvme_fc transport api to dynamically
      update dev_loss_tmo when the scsi sysfs interface changes it.
      
      Memset the rpinfo structure in the registration call to enforce "accept
      nvme transport defaults" in the registration call.  Driver parameters do
      influence the dev_loss_tmo transport setting dynamically.
      
      Simplifies the register function: the driver was incorrectly searching
      its local rport list to determine resume or new semantics, which is not
      valid as the transport already handles this.  The rport was resumed if
      the rport handed back matches the ndlp->nrport pointer.  Otherwise,
      devloss fired and the ndlp's nrport is NULL.
      Signed-off-by: NDick Kennedy <dick.kennedy@broadcom.com>
      Signed-off-by: NJames Smart <james.smart@broadcom.com>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      7a06dcd3
  15. 26 4月, 2017 1 次提交
    • J
      lpfc: Fix memory corruption of the lpfc_ncmd->list pointers · bbe3012b
      James Smart 提交于
      lpfc was changing the private pointer that is set/maintained by
      the nvme_fc transport. This caused two issues: a) the transport, on
      teardown may erroneous attempt to free whatever address was set;
      and b) lfpc uses any value set in lpfc_nvme_fcp_abort() and
      assumes its a valid io request.
      
      Correct issue by properly defining a context structure for lpfc.
      Lpfc also updated to clear the private context structure on io
      completion.
      
      Since this bug caused scrutiny of the way lpfc moves local request
      structures between lists, also cleaned up list_del()'s to
      list_del_inits()'s.
      
      This is a nvme-specific bug. The patch was cut against the
      linux-block tree, for-4.12/block tree. It should be pulled in through
      that tree.
      Signed-off-by: NDick Kennedy <dick.kennedy@broadcom.com>
      Signed-off-by: NJames Smart <james.smart@broadcom.com>
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      bbe3012b
  16. 24 4月, 2017 3 次提交
    • J
      Update ABORT processing for NVMET. · 86c67379
      James Smart 提交于
      The driver with nvme had this routine stubbed.
      
      Right now XRI_ABORTED_CQE is not handled and the FC NVMET
      Transport has a new API for the driver.
      
      Missing code path, new NVME abort API
      Update ABORT processing for NVMET
      
      There are 3 new FC NVMET Transport API/ template routines for NVMET:
      
      lpfc_nvmet_xmt_fcp_release
      This NVMET template callback routine called to release context
      associated with an IO This routine is ALWAYS called last, even
      if the IO was aborted or completed in error.
      
      lpfc_nvmet_xmt_fcp_abort
      This NVMET template callback routine called to abort an exchange that
      has an IO in progress
      
      nvmet_fc_rcv_fcp_req
      When the lpfc driver receives an ABTS, this NVME FC transport layer
      callback routine is called. For this case there are 2 paths thru the
      driver: the driver either has an outstanding exchange / context for the
      XRI to be aborted or not.  If not, a BA_RJT is issued otherwise a BA_ACC
      
      NVMET Driver abort paths:
      
      There are 2 paths for aborting an IO. The first one is we receive an IO and
      decide not to process it because of lack of resources. An unsolicated ABTS
      is immediately sent back to the initiator as a response.
      lpfc_nvmet_unsol_fcp_buffer
                  lpfc_nvmet_unsol_issue_abort  (XMIT_SEQUENCE_WQE)
      
      The second one is we sent the IO up to the NVMET transport layer to
      process, and for some reason the NVME Transport layer decided to abort the
      IO before it completes all its phases. For this case there are 2 paths
      thru the driver:
      the driver either has an outstanding TSEND/TRECEIVE/TRSP WQE or no
      outstanding WQEs are present for the exchange / context.
      lpfc_nvmet_xmt_fcp_abort
          if (LPFC_NVMET_IO_INP)
              lpfc_nvmet_sol_fcp_issue_abort  (ABORT_WQE)
                      lpfc_nvmet_sol_fcp_abort_cmp
          else
              lpfc_nvmet_unsol_fcp_issue_abort
                      lpfc_nvmet_unsol_issue_abort  (XMIT_SEQUENCE_WQE)
                              lpfc_nvmet_unsol_fcp_abort_cmp
      
      Context flags:
      LPFC_NVMET_IOP - his flag signifies an IO is in progress on the exchange.
      LPFC_NVMET_XBUSY  - this flag indicates the IO completed but the firmware
      is still busy with the corresponding exchange. The exchange should not be
      reused until after a XRI_ABORTED_CQE is received for that exchange.
      LPFC_NVMET_ABORT_OP - this flag signifies an ABORT_WQE was issued on the
      exchange.
      LPFC_NVMET_CTX_RLS  - this flag signifies a context free was requested,
      but we are deferring it due to an XBUSY or ABORT in progress.
      
      A ctxlock is added to the context structure that is used whenever these
      flags are set/read  within the context of an IO.
      The LPFC_NVMET_CTX_RLS flag is only set in the defer_relase routine when
      the transport has resolved all IO associated with the buffer. The flag is
      cleared when the CTX is associated with a new IO.
      
      An exchange can has both an LPFC_NVMET_XBUSY and a LPFC_NVMET_ABORT_OP
      condition active simultaneously. Both conditions must complete before the
      exchange is freed.
      When the abort callback (lpfc_nvmet_xmt_fcp_abort) is envoked:
      If there is an outstanding IO, the driver will issue an ABORT_WQE. This
      should result in 3 completions for the exchange:
      1) IO cmpl with XB bit set
      2) Abort WQE cmpl
      3) XRI_ABORTED_CQE cmpl
      For this scenerio, after completion #1, the NVMET Transport IO rsp
      callback is called.  After completion #2, no action is taken with respect
      to the exchange / context.  After completion #3, the exchange context is
      free for re-use on another IO.
      
      If there is no outstanding activity on the exchange, the driver will send a
      ABTS to the Initiator. Upon completion of this WQE, the exchange / context
      is freed for re-use on another IO.
      Signed-off-by: NDick Kennedy <dick.kennedy@broadcom.com>
      Signed-off-by: NJames Smart <james.smart@broadcom.com>
      Reviewed-by: NJohannes Thumshirn <jthumshirn@suse.de>
      86c67379
    • J
      Fix max_sgl_segments settings for NVME / NVMET · 4d4c4a4a
      James Smart 提交于
      Cannot set NVME segment counts to a large number
      
      The existing module parameter lpfc_sg_seg_cnt is used for both
      SCSI and NVME.
      
      Limit the module parameter lpfc_sg_seg_cnt to 128 with the
      default being 64 for both NVME and NVMET, assuming NVME is enabled in the
      driver for that port. The driver will set max_sgl_segments in the
      NVME/NVMET template to lpfc_sg_seg_cnt + 1.
      Signed-off-by: NDick Kennedy <dick.kennedy@broadcom.com>
      Signed-off-by: NJames Smart <james.smart@broadcom.com>
      Reviewed-by: NJohannes Thumshirn <jthumshirn@suse.de>
      4d4c4a4a
    • J
      Fix driver load issues when MRQ=8 · 2b7824d0
      James Smart 提交于
      The symptom is that the driver will fail to login to the fabric.
      The reason is because it is out of iocb resources.
      
      There is a one to one relationship between MRQs
      (receive buffers for NVMET-FC) and iocbs and the default number of
      IOCBs was not accounting for the number of MRQs that were being created.
      
      This fix aligns the number of MRQ resources with the total resources so
      that it can handle fabric events when needed.
      
      Also the initialization of ctxlock to be on FCP commands, NOT LS commands.
      And modified log messages so that the log output can be correlated with
      the analyzer trace.
      Signed-off-by: NDick Kennedy <dick.kennedy@broadcom.com>
      Signed-off-by: NJames Smart <james.smart@broadcom.com>
      Reviewed-by: NJohannes Thumshirn <jthumshirn@suse.de>
      2b7824d0