Skip to content

nvme-fc/nvmet-fc: Add FC-NVME-2 disconnect association support

James Smart linux-nvme 2 versions – Applied

Status from this message: applied to nvme-5.8.

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest26 patches 1 replyApplied
  2. v129 patches 50 repliesSuperseded

Changes in v2 from the cover letter

Split out 2 fixes into patches sent separately
a typo & fcloop deallocation of context
Patches slightly reordered
Include fix to Connection disconnect LS spotted by Hannes (patch1) Combined header/nvme-fc/nvmet-fc/lpfc sync to api name change into
1 patch (patch2)
Convert assoc_active patch converted to use test_and_set/clear.
Converted other flag field to use same bit routines. (patch 6)
Split common definitions patch into host and target patches

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/26nvme-fc: Sync header to FC-NVME-2 rev 1.08include/linux/nvme-fc.h+6 -50 replies
2/26nvme-fc and nvmet-fc: revise LLDD api for LS reception and LS requestdrivers/nvme/host/fc.c drivers/nvme/target/fc.c drivers/nvme/target/fcloop.c +3 more+378 -1340 replies
3/26nvme-fc nvmet-fc: refactor for common LS definitionsdrivers/nvme/host/fc.c drivers/nvme/host/fc.h drivers/nvme/target/fc.c+143 -1410 replies
4/26nvmet-fc: Better size LS buffersdrivers/nvme/host/fc.h drivers/nvme/target/fc.c+38 -300 replies
5/26nvme-fc: Ensure private pointers are NULL if no datadrivers/nvme/host/fc.c drivers/nvme/target/fc.c+54 -320 replies
6/26nvme-fc: convert assoc_active flag to bit opdrivers/nvme/host/fc.c+13 -240 replies
7/26nvme-fc: Update header and host for common definitions for LS handlingdrivers/nvme/host/fc.c drivers/nvme/host/fc.h+81 -230 replies
8/26nvmet-fc: Update target for common definitions for LS handlingdrivers/nvme/target/fc.c+2 -260 replies
9/26nvme-fc: Add Disconnect Association Rcv supportdrivers/nvme/host/fc.c+359 -40 replies
10/26nvmet-fc: add LS failure messagesdrivers/nvme/target/fc.c+19 -30 replies
11/26nvmet-fc: perform small cleanups on unneeded checksdrivers/nvme/target/fc.c+5 -80 replies
12/26nvmet-fc: track hostport handle for associationsdrivers/nvme/target/fc.c+170 -70 replies
13/26nvmet-fc: rename ls_list to ls_rcv_listdrivers/nvme/target/fc.c+11 -110 replies
14/26nvmet-fc: Add Disconnect Association Xmt supportdrivers/nvme/target/fc.c+286 -100 replies
15/26nvme-fcloop: refactor to enable target to host LSdrivers/nvme/target/fcloop.c+13 -60 replies
16/26nvme-fcloop: add target to host LS request supportdrivers/nvme/target/fcloop.c+118 -120 replies
17/26lpfc: Refactor lpfc nvme headersdrivers/scsi/lpfc/lpfc_attr.c drivers/scsi/lpfc/lpfc_ct.c drivers/scsi/lpfc/lpfc_debugfs.c +9 more+147 -1870 replies
18/26lpfc: Refactor nvmet_rcv_ctx to create lpfc_async_xchg_ctxdrivers/scsi/lpfc/lpfc.h drivers/scsi/lpfc/lpfc_crtn.h drivers/scsi/lpfc/lpfc_debugfs.c +4 more+63 -620 replies
19/26lpfc: Commonize lpfc_async_xchg_ctx state and flag definitionsdrivers/scsi/lpfc/lpfc_init.c drivers/scsi/lpfc/lpfc_nvme.h drivers/scsi/lpfc/lpfc_nvmet.c+100 -970 replies
20/26lpfc: Refactor NVME LS receive handlingdrivers/scsi/lpfc/lpfc_crtn.h drivers/scsi/lpfc/lpfc_nvme.c drivers/scsi/lpfc/lpfc_nvme.h +2 more+184 -1300 replies
21/26lpfc: Refactor Send LS Request supportdrivers/scsi/lpfc/lpfc_nvme.c drivers/scsi/lpfc/lpfc_nvme.h+184 -1180 replies
22/26lpfc: Refactor Send LS Abort supportdrivers/scsi/lpfc/lpfc_nvme.c drivers/scsi/lpfc/lpfc_nvme.h+77 -500 replies
23/26lpfc: Refactor Send LS Response supportdrivers/scsi/lpfc/lpfc_nvme.h drivers/scsi/lpfc/lpfc_nvmet.c+184 -780 replies
24/26lpfc: nvme: Add Receive LS Request and Send LS Response support to nvmedrivers/scsi/lpfc/lpfc_nvme.c+71 -00 replies
25/26lpfc: nvmet: Add support for NVME LS request hosthandledrivers/scsi/lpfc/lpfc_crtn.h drivers/scsi/lpfc/lpfc_hbadisc.c drivers/scsi/lpfc/lpfc_nportdisc.c +2 more+74 -10 replies
26/26lpfc: nvmet: Add Send LS Request and Abort LS Request supportdrivers/scsi/lpfc/lpfc_nvmet.c+95 -00 replies

Reviews trailers per patch

21 of 26 patches have a Reviewed-by or Acked-by.

PatchSagi GrimbergHimanshu MadhaniHannes Reinecke
1/26R-b R-b R-b
2/26R-b R-b
3/26R-b R-b
4/26R-b R-b
5/26R-b R-b R-b
6/26
7/26R-b R-b
8/26R-b R-b
9/26R-b
10/26R-b
11/26
12/26R-b
13/26R-b
14/26
15/26R-b
16/26R-b
17/26R-b
18/26R-b
19/26R-b
20/26R-b
21/26R-b
22/26R-b
23/26R-b
24/26
25/26R-b
26/26

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v2 thread

Cover letter [PATCH v2 00/26] nvme-fc/nvmet-fc: Add FC-NVME-2 disconnect association support

At the tail end of FC-NVME (1) standardization, the process for terminating an association was changed requiring interlock using FC-NVME Disconnect Assocation LS's between both the host port and target port. This was immediately relaxed with an ammendment to FC-NVME (1) and with wording put into FC-NVME-2. The interlock was removed, but it still required both the host port and target port to initiate Disconnect Association LS's and respond to LS's.

The linux nvme-fc and nvmet-fc implementations were interoperable with standards but the linux-driver api did not support all the functionality needed. It was missing:
- nvme-fc: didn't support the reception of NVME LS's and the ability to transmit responses to an LS.
- nvmet-fc: didn't support the ability to send an NVME LS request. It also did not support a method for the transport to specify a remote port for an LS.

This patch adds the missing functionality. Specifically the patch set:
- Updates the header with the FC-NVME-2 standard out for final approval.
- Refactors data structure names that used to be dependent on role (ls requests were specific to nvme; ls responses were specific to nvmet) to generic names that can be used by both nvme-fc and nvmet-fc.
- Modifies the nvme-fc transport template with interfaces to receive NVME LS's and for the transport to then request LS responses to be sent.
- Modifies the nvmet-fc transport template with:
- The current NVME LS receive interface was modified to supply a handle to indentify the remote port the LS as received from. If the LS creates an association, the handle may be used to initiate NVME LS requests to the remote port. An interface was put in place to invalidate the handle on connectivity losses.
- Interfaces for the transport to request an NVME LS request to be performed as well as to abort that LS in cases of error/teardown.
- The nvme-fc transport was modified to follow the standard:
- Disconnect association logic was revised to send Disconnect LS as soon as all ABTS's were transmit rather than waiting for the ABTS process to fully complete.
- Disconnect LS reception is supported, with reception initiating controller reset and reconnect.
- Disconnect LS responses will not be transmit until association termination has transmit the Disconnect LS.
- The nvmet-fc transport was modified to follow the standard:
- Disconnect assocation logic was revised to transmit a Disconnect LS request as soon as all ABTS's have been transmit. In the past, no Disconnect LS had been transmit.
- Disconnect LS responses will not be sent until the Disconnect LS request has been transmit.
- nvme-fcloop: was updated with interfaces to allow testing of the transports.
- Along the way, cleanups and slight corrections were made to the transports.
- The lpfc driver was modified to support the new transport interfaces for both the nvme and nvmet transports. As much of the functionality was already present, but specific to one side of the transport, existing code was refactored to create common routines. Addition of the new interfaces was able to slip in rather easily with the common routines.

This code was cut against the for-5.7 branch.

I'll work with Martin to minimize any work to merge these lpfc mods with lpfc changes in the scsi tree.

V2 changes:
Split out 2 fixes into patches sent separately
a typo & fcloop deallocation of context
Patches slightly reordered
Include fix to Connection disconnect LS spotted by Hannes (patch1) Combined header/nvme-fc/nvmet-fc/lpfc sync to api name change into
1 patch (patch2)
Convert assoc_active patch converted to use test_and_set/clear.
Converted other flag field to use same bit routines. (patch 6)
Split common definitions patch into host and target patches

    (patches 8 & 9)
  Remove unused local variable writedataactive (patch 11)
  Replaced c++ style comment (patch 14)
  Moved location of lsdir field (patch 15)
  Removed atomic stats from lpfc that aren't necessary
    (patches 24 & 26)

Add reviewed by's from Sagi, Hannes, Himanshu

-- james

James Smart (26):
nvme-fc: Sync header to FC-NVME-2 rev 1.08
nvme-fc and nvmet-fc: revise LLDD api for LS reception and LS request nvme-fc nvmet-fc: refactor for common LS definitions
nvmet-fc: Better size LS buffers
nvme-fc: Ensure private pointers are NULL if no data
nvme-fc: convert assoc_active flag to bit op
nvme-fc: Update header and host for common definitions for LS handling
nvmet-fc: Update target for common definitions for LS handling
nvme-fc: Add Disconnect Association Rcv support
nvmet-fc: add LS failure messages
nvmet-fc: perform small cleanups on unneeded checks
nvmet-fc: track hostport handle for associations
nvmet-fc: rename ls_list to ls_rcv_list
nvmet-fc: Add Disconnect Association Xmt support
nvme-fcloop: refactor to enable target to host LS
nvme-fcloop: add target to host LS request support
lpfc: Refactor lpfc nvme headers
lpfc: Refactor nvmet_rcv_ctx to create lpfc_async_xchg_ctx
lpfc: Commonize lpfc_async_xchg_ctx state and flag definitions
lpfc: Refactor NVME LS receive handling
lpfc: Refactor Send LS Request support
lpfc: Refactor Send LS Abort support
lpfc: Refactor Send LS Response support
lpfc: nvme: Add Receive LS Request and Send LS Response support to
nvme
lpfc: nvmet: Add support for NVME LS request hosthandle
lpfc: nvmet: Add Send LS Request and Abort LS Request support

 drivers/nvme/host/fc.c             | 569 ++++++++++++++++++++------
 drivers/nvme/host/fc.h             | 227 +++++++++++
 drivers/nvme/target/fc.c           | 798 ++++++++++++++++++++++++++----------
 drivers/nvme/target/fcloop.c       | 155 ++++++-
 drivers/scsi/lpfc/lpfc.h           |   2 +-
 drivers/scsi/lpfc/lpfc_attr.c      |   3 -
 drivers/scsi/lpfc/lpfc_crtn.h      |   9 +-
 drivers/scsi/lpfc/lpfc_ct.c        |   1 -
 drivers/scsi/lpfc/lpfc_debugfs.c   |   5 +-
 drivers/scsi/lpfc/lpfc_hbadisc.c   |   8 +-
 drivers/scsi/lpfc/lpfc_init.c      |   7 +-
 drivers/scsi/lpfc/lpfc_mem.c       |   4 -
 drivers/scsi/lpfc/lpfc_nportdisc.c |  13 +-
 drivers/scsi/lpfc/lpfc_nvme.c      | 491 ++++++++++++++--------
 drivers/scsi/lpfc/lpfc_nvme.h      | 181 +++++++++
 drivers/scsi/lpfc/lpfc_nvmet.c     | 804 ++++++++++++++++++++++---------------
 drivers/scsi/lpfc/lpfc_nvmet.h     | 158 --------
 drivers/scsi/lpfc/lpfc_sli.c       | 126 +++++-
 include/linux/nvme-fc-driver.h     | 368 ++++++++++++-----
 include/linux/nvme-fc.h            |  11 +-
 20 files changed, 2808 insertions(+), 1132 deletions(-)
 create mode 100644 drivers/nvme/host/fc.h
 delete mode 100644 drivers/scsi/lpfc/lpfc_nvmet.h
Signature · 7 lines
2.16.4


_______________________________________________
linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme