History

Merge tag 'for-5.8/drivers-2020-06-01' of git://git.kernel.dk/linux-block

Pull block driver updates from Jens Axboe: "On top of the core changes, here are the block driver changes for this merge window: - NVMe changes: - NVMe over Fibre Channel protocol updates, which also reach over to drivers/scsi/lpfc (James Smart) - namespace revalidation support on the target (Anthony Iliopoulos) - gcc zero length array fix (Arnd Bergmann) - nvmet cleanups (Chaitanya Kulkarni) - misc cleanups and fixes (me, Keith Busch, Sagi Grimberg) - use a SRQ per completion vector (Max Gurtovoy) - fix handling of runtime changes to the queue count (Weiping Zhang) - t10 protection information support for nvme-rdma and nvmet-rdma (Israel Rukshin and Max Gurtovoy) - target side AEN improvements (Chaitanya Kulkarni) - various fixes and minor improvements all over, icluding the nvme part of the lpfc driver" - Floppy code cleanup series (Willy, Denis) - Floppy contention fix (Jiri) - Loop CONFIGURE support (Martijn) - bcache fixes/improvements (Coly, Joe, Colin) - q->queuedata cleanups (Christoph) - Get rid of ioctl_by_bdev (Christoph, Stefan) - md/raid5 allocation fixes (Coly) - zero length array fixes (Gustavo) - swim3 task state fix (Xu)" * tag 'for-5.8/drivers-2020-06-01' of git://git.kernel.dk/linux-block: (166 commits) bcache: configure the asynchronous registertion to be experimental bcache: asynchronous devices registration bcache: fix refcount underflow in bcache_device_free() bcache: Convert pr_<level> uses to a more typical style bcache: remove redundant variables i and n lpfc: Fix return value in __lpfc_nvme_ls_abort lpfc: fix axchg pointer reference after free and double frees lpfc: Fix pointer checks and comments in LS receive refactoring nvme: set dma alignment to qword nvmet: cleanups the loop in nvmet_async_events_process nvmet: fix memory leak when removing namespaces and controllers concurrently nvmet-rdma: add metadata/T10-PI support nvmet: add metadata support for block devices nvmet: add metadata/T10-PI support nvme: add Metadata Capabilities enumerations nvmet: rename nvmet_check_data_len to nvmet_check_transfer_len nvmet: rename nvmet_rw_len to nvmet_rw_data_len nvmet: add metadata characteristics for a namespace nvme-rdma: add metadata/T10-PI support nvme-rdma: introduce nvme_rdma_sgl structure ...

Linus Torvalds committed 6 years ago

Commit bce159d2 parents 750a02a 0c8d3fc81 files · +5429 −2353Browse files

Showing the changes to include/linux (6 of 81 files). Show all

Unified · Split

6 files
  1. include/linux/dasd_mod.h +9 −0
  2. include/linux/fs.h +0 −1
  3. include/linux/genhd.h +0 −4
  4. include/linux/nvme-fc-driver.h +270 −98
  5. include/linux/nvme-fc.h +6 −5
  6. include/linux/nvme.h +15 −1
include/linux/dasd_mod.h+9−0
@@ -0,0 +1,9 @@
1+/* SPDX-License-Identifier: GPL-2.0 */
2+#ifndef DASD_MOD_H
3+#define DASD_MOD_H
4+
5+#include <asm/dasd.h>
6+
7+extern int dasd_biodasdinfo(struct gendisk *disk, dasd_information2_t *info);
8+
9+#endif
include/linux/fs.h+0−1
@@ -2646,7 +2646,6 @@ extern int sync_filesystem(struct super_block *); · 2645 unmodified lines
26462646 extern const struct file_operations def_blk_fops;
26472647 extern const struct file_operations def_chr_fops;
26482648 #ifdef CONFIG_BLOCK
2649−extern int ioctl_by_bdev(struct block_device *, unsigned, unsigned long);
26502649 extern int blkdev_ioctl(struct block_device *, fmode_t, unsigned, unsigned long);
26512650 extern long compat_blkdev_ioctl(struct file *, unsigned, unsigned long);
26522651 extern int blkdev_get(struct block_device *bdev, fmode_t mode, void *holder);
include/linux/genhd.h+0−4
@@ -159,8 +159,6 @@ struct disk_part_tbl { · 158 unmodified lines
159159 struct disk_events;
160160 struct badblocks;
161161
162−#if defined(CONFIG_BLK_DEV_INTEGRITY)
163−
164162 struct blk_integrity {
165163 const struct blk_integrity_profile *profile;
166164 unsigned char flags;
@@ -169,8 +167,6 @@ struct blk_integrity { · 2 unmodified lines
169167 unsigned char tag_size;
170168 };
171169
172−#endif /* CONFIG_BLK_DEV_INTEGRITY */
173−
174170 struct gendisk {
175171 /* major, first_minor and minors are input parameters only,
176172 * don't use directly. Use disk_devt() and disk_max_parts().
include/linux/nvme-fc-driver.h+270−98
@@ -10,47 +10,26 @@ · 9 unmodified lines
1010
1111
1212 /*
13− * ********************** LLDD FC-NVME Host API ********************
13+ * ********************** FC-NVME LS API ********************
1414 *
15− * For FC LLDD's that are the NVME Host role.
15+ * Data structures used by both FC-NVME hosts and FC-NVME
16+ * targets to perform FC-NVME LS requests or transmit
17+ * responses.
1618 *
17− * ******************************************************************
19+ * ***********************************************************
1820 */
1921
20−
21−
2222 /**
23− * struct nvme_fc_port_info - port-specific ids and FC connection-specific
24− * data element used during NVME Host role
25− * registrations
26− *
27− * Static fields describing the port being registered:
28− * @node_name: FC WWNN for the port
29− * @port_name: FC WWPN for the port
30− * @port_role: What NVME roles are supported (see FC_PORT_ROLE_xxx)
31− * @dev_loss_tmo: maximum delay for reconnects to an association on
32− * this device. Used only on a remoteport.
23+ * struct nvmefc_ls_req - Request structure passed from the transport
24+ * to the LLDD to perform a NVME-FC LS request and obtain
25+ * a response.
26+ * Used by nvme-fc transport (host) to send LS's such as
27+ * Create Association, Create Connection and Disconnect
28+ * Association.
29+ * Used by the nvmet-fc transport (controller) to send
30+ * LS's such as Disconnect Association.
3331 *
34− * Initialization values for dynamic port fields:
35− * @port_id: FC N_Port_ID currently assigned the port. Upper 8 bits must
36− * be set to 0.
37− */
38−struct nvme_fc_port_info {
39− u64 node_name;
40− u64 port_name;
41− u32 port_role;
42− u32 port_id;
43− u32 dev_loss_tmo;
44−};
45−
46−
47−/**
48− * struct nvmefc_ls_req - Request structure passed from NVME-FC transport
49− * to LLDD in order to perform a NVME FC-4 LS
50− * request and obtain a response.
51− *
52− * Values set by the NVME-FC layer prior to calling the LLDD ls_req
53− * entrypoint.
32+ * Values set by the requestor prior to calling the LLDD ls_req entrypoint:
5433 * @rqstaddr: pointer to request buffer
5534 * @rqstdma: PCI DMA address of request buffer
5635 * @rqstlen: Length, in bytes, of request buffer
@@ -63,8 +42,8 @@ struct nvme_fc_port_info { · 6 unmodified lines
6342 * @private: pointer to memory allocated alongside the ls request structure
6443 * that is specifically for the LLDD to use while processing the
6544 * request. The length of the buffer corresponds to the
66− * lsrqst_priv_sz value specified in the nvme_fc_port_template
67− * supplied by the LLDD.
45+ * lsrqst_priv_sz value specified in the xxx_template supplied
46+ * by the LLDD.
6847 * @done: The callback routine the LLDD is to invoke upon completion of
6948 * the LS request. req argument is the pointer to the original LS
7049 * request structure. Status argument must be 0 upon success, a
@@ -86,6 +65,101 @@ struct nvmefc_ls_req { · 15 unmodified lines
8665 } __aligned(sizeof(u64)); /* alignment for other things alloc'd with */
8766
8867
68+/**
69+ * struct nvmefc_ls_rsp - Structure passed from the transport to the LLDD
70+ * to request the transmit the NVME-FC LS response to a
71+ * NVME-FC LS request. The structure originates in the LLDD
72+ * and is given to the transport via the xxx_rcv_ls_req()
73+ * transport routine. As such, the structure represents the
74+ * FC exchange context for the NVME-FC LS request that was
75+ * received and which the response is to be sent for.
76+ * Used by the LLDD to pass the nvmet-fc transport (controller)
77+ * received LS's such as Create Association, Create Connection
78+ * and Disconnect Association.
79+ * Used by the LLDD to pass the nvme-fc transport (host)
80+ * received LS's such as Disconnect Association or Disconnect
81+ * Connection.
82+ *
83+ * The structure is allocated by the LLDD whenever a LS Request is received
84+ * from the FC link. The address of the structure is passed to the nvmet-fc
85+ * or nvme-fc layer via the xxx_rcv_ls_req() transport routines.
86+ *
87+ * The address of the structure is to be passed back to the LLDD
88+ * when the response is to be transmit. The LLDD will use the address to
89+ * map back to the LLDD exchange structure which maintains information such
90+ * the remote N_Port that sent the LS as well as any FC exchange context.
91+ * Upon completion of the LS response transmit, the LLDD will pass the
92+ * address of the structure back to the transport LS rsp done() routine,
93+ * allowing the transport release dma resources. Upon completion of
94+ * the done() routine, no further access to the structure will be made by
95+ * the transport and the LLDD can de-allocate the structure.
96+ *
97+ * Field initialization:
98+ * At the time of the xxx_rcv_ls_req() call, there is no content that
99+ * is valid in the structure.
100+ *
101+ * When the structure is used for the LLDD->xmt_ls_rsp() call, the
102+ * transport layer will fully set the fields in order to specify the
103+ * response payload buffer and its length as well as the done routine
104+ * to be called upon completion of the transmit. The transport layer
105+ * will also set a private pointer for its own use in the done routine.
106+ *
107+ * Values set by the transport layer prior to calling the LLDD xmt_ls_rsp
108+ * entrypoint:
109+ * @rspbuf: pointer to the LS response buffer
110+ * @rspdma: PCI DMA address of the LS response buffer
111+ * @rsplen: Length, in bytes, of the LS response buffer
112+ * @done: The callback routine the LLDD is to invoke upon completion of
113+ * transmitting the LS response. req argument is the pointer to
114+ * the original ls request.
115+ * @nvme_fc_private: pointer to an internal transport-specific structure
116+ * used as part of the transport done() processing. The LLDD is
117+ * not to access this pointer.
118+ */
119+struct nvmefc_ls_rsp {
120+ void *rspbuf;
121+ dma_addr_t rspdma;
122+ u16 rsplen;
123+
124+ void (*done)(struct nvmefc_ls_rsp *rsp);
125+ void *nvme_fc_private; /* LLDD is not to access !! */
126+};
127+
128+
129+
130+/*
131+ * ********************** LLDD FC-NVME Host API ********************
132+ *
133+ * For FC LLDD's that are the NVME Host role.
134+ *
135+ * ******************************************************************
136+ */
137+
138+
139+/**
140+ * struct nvme_fc_port_info - port-specific ids and FC connection-specific
141+ * data element used during NVME Host role
142+ * registrations
143+ *
144+ * Static fields describing the port being registered:
145+ * @node_name: FC WWNN for the port
146+ * @port_name: FC WWPN for the port
147+ * @port_role: What NVME roles are supported (see FC_PORT_ROLE_xxx)
148+ * @dev_loss_tmo: maximum delay for reconnects to an association on
149+ * this device. Used only on a remoteport.
150+ *
151+ * Initialization values for dynamic port fields:
152+ * @port_id: FC N_Port_ID currently assigned the port. Upper 8 bits must
153+ * be set to 0.
154+ */
155+struct nvme_fc_port_info {
156+ u64 node_name;
157+ u64 port_name;
158+ u32 port_role;
159+ u32 port_id;
160+ u32 dev_loss_tmo;
161+};
162+
89163 enum nvmefc_fcp_datadir {
90164 NVMEFC_FCP_NODATA, /* payload_length and sg_cnt will be zero */
91165 NVMEFC_FCP_WRITE,
@@ -337,6 +411,21 @@ struct nvme_fc_remote_port { · 245 unmodified lines
337411 * indicating an FC transport Aborted status.
338412 * Entrypoint is Mandatory.
339413 *
414+ * @xmt_ls_rsp: Called to transmit the response to a FC-NVME FC-4 LS service.
415+ * The nvmefc_ls_rsp structure is the same LLDD-supplied exchange
416+ * structure specified in the nvme_fc_rcv_ls_req() call made when
417+ * the LS request was received. The structure will fully describe
418+ * the buffers for the response payload and the dma address of the
419+ * payload. The LLDD is to transmit the response (or return a
420+ * non-zero errno status), and upon completion of the transmit, call
421+ * the "done" routine specified in the nvmefc_ls_rsp structure
422+ * (argument to done is the address of the nvmefc_ls_rsp structure
423+ * itself). Upon the completion of the done routine, the LLDD shall
424+ * consider the LS handling complete and the nvmefc_ls_rsp structure
425+ * may be freed/released.
426+ * Entrypoint is mandatory if the LLDD calls the nvme_fc_rcv_ls_req()
427+ * entrypoint.
428+ *
340429 * @max_hw_queues: indicates the maximum number of hw queues the LLDD
341430 * supports for cpu affinitization.
342431 * Value is Mandatory. Must be at least 1.
@@ -371,7 +460,7 @@ struct nvme_fc_remote_port { · 28 unmodified lines
371460 * @lsrqst_priv_sz: The LLDD sets this field to the amount of additional
372461 * memory that it would like fc nvme layer to allocate on the LLDD's
373462 * behalf whenever a ls request structure is allocated. The additional
374− * memory area solely for the of the LLDD and its location is
463+ * memory area is solely for use by the LLDD and its location is
375464 * specified by the ls_request->private pointer.
376465 * Value is Mandatory. Allowed to be zero.
377466 *
@@ -405,6 +494,9 @@ struct nvme_fc_port_template { · 27 unmodified lines
405494 struct nvme_fc_remote_port *,
406495 void *hw_queue_handle,
407496 struct nvmefc_fcp_req *);
497+ int (*xmt_ls_rsp)(struct nvme_fc_local_port *localport,
498+ struct nvme_fc_remote_port *rport,
499+ struct nvmefc_ls_rsp *ls_rsp);
408500
409501 u32 max_hw_queues;
410502 u16 max_sgl_segments;
@@ -441,6 +533,34 @@ void nvme_fc_rescan_remoteport(struct nvme_fc_remote_port *remoteport); · 30 unmodified lines
441533 int nvme_fc_set_remoteport_devloss(struct nvme_fc_remote_port *remoteport,
442534 u32 dev_loss_tmo);
443535
536+/*
537+ * Routine called to pass a NVME-FC LS request, received by the lldd,
538+ * to the nvme-fc transport.
539+ *
540+ * If the return value is zero: the LS was successfully accepted by the
541+ * transport.
542+ * If the return value is non-zero: the transport has not accepted the
543+ * LS. The lldd should ABTS-LS the LS.
544+ *
545+ * Note: if the LLDD receives and ABTS for the LS prior to the transport
546+ * calling the ops->xmt_ls_rsp() routine to transmit a response, the LLDD
547+ * shall mark the LS as aborted, and when the xmt_ls_rsp() is called: the
548+ * response shall not be transmit and the struct nvmefc_ls_rsp() done
549+ * routine shall be called. The LLDD may transmit the ABTS response as
550+ * soon as the LS was marked or can delay until the xmt_ls_rsp() call is
551+ * made.
552+ * Note: if an RCV LS was successfully posted to the transport and the
553+ * remoteport is then unregistered before xmt_ls_rsp() was called for
554+ * the lsrsp structure, the transport will still call xmt_ls_rsp()
555+ * afterward to cleanup the outstanding lsrsp structure. The LLDD should
556+ * noop the transmission of the rsp and call the lsrsp->done() routine
557+ * to allow the lsrsp structure to be released.
558+ */
559+int nvme_fc_rcv_ls_req(struct nvme_fc_remote_port *remoteport,
560+ struct nvmefc_ls_rsp *lsrsp,
561+ void *lsreqbuf, u32 lsreqbuf_len);
562+
563+
444564
445565 /*
446566 * *************** LLDD FC-NVME Target/Subsystem API ***************
@@ -470,55 +590,6 @@ struct nvmet_fc_port_info { · 23 unmodified lines
470590 };
471591
472592
473−/**
474− * struct nvmefc_tgt_ls_req - Structure used between LLDD and NVMET-FC
475− * layer to represent the exchange context for
476− * a FC-NVME Link Service (LS).
477− *
478− * The structure is allocated by the LLDD whenever a LS Request is received
479− * from the FC link. The address of the structure is passed to the nvmet-fc
480− * layer via the nvmet_fc_rcv_ls_req() call. The address of the structure
481− * will be passed back to the LLDD when the response is to be transmit.
482− * The LLDD is to use the address to map back to the LLDD exchange structure
483− * which maintains information such as the targetport the LS was received
484− * on, the remote FC NVME initiator that sent the LS, and any FC exchange
485− * context. Upon completion of the LS response transmit, the address of the
486− * structure will be passed back to the LS rsp done() routine, allowing the
487− * nvmet-fc layer to release dma resources. Upon completion of the done()
488− * routine, no further access will be made by the nvmet-fc layer and the
489− * LLDD can de-allocate the structure.
490− *
491− * Field initialization:
492− * At the time of the nvmet_fc_rcv_ls_req() call, there is no content that
493− * is valid in the structure.
494− *
495− * When the structure is used for the LLDD->xmt_ls_rsp() call, the nvmet-fc
496− * layer will fully set the fields in order to specify the response
497− * payload buffer and its length as well as the done routine to be called
498− * upon compeletion of the transmit. The nvmet-fc layer will also set a
499− * private pointer for its own use in the done routine.
500− *
501− * Values set by the NVMET-FC layer prior to calling the LLDD xmt_ls_rsp
502− * entrypoint.
503− * @rspbuf: pointer to the LS response buffer
504− * @rspdma: PCI DMA address of the LS response buffer
505− * @rsplen: Length, in bytes, of the LS response buffer
506− * @done: The callback routine the LLDD is to invoke upon completion of
507− * transmitting the LS response. req argument is the pointer to
508− * the original ls request.
509− * @nvmet_fc_private: pointer to an internal NVMET-FC layer structure used
510− * as part of the NVMET-FC processing. The LLDD is not to access
511− * this pointer.
512− */
513−struct nvmefc_tgt_ls_req {
514− void *rspbuf;
515− dma_addr_t rspdma;
516− u16 rsplen;
517−
518− void (*done)(struct nvmefc_tgt_ls_req *req);
519− void *nvmet_fc_private; /* LLDD is not to access !! */
520−};
521−
522593 /* Operations that NVME-FC layer may request the LLDD to perform for FCP */
523594 enum {
524595 NVMET_FCOP_READDATA = 1, /* xmt data to initiator */
@@ -693,17 +764,19 @@ struct nvmet_fc_target_port { · 168 unmodified lines
693764 * Entrypoint is Mandatory.
694765 *
695766 * @xmt_ls_rsp: Called to transmit the response to a FC-NVME FC-4 LS service.
696− * The nvmefc_tgt_ls_req structure is the same LLDD-supplied exchange
767+ * The nvmefc_ls_rsp structure is the same LLDD-supplied exchange
697768 * structure specified in the nvmet_fc_rcv_ls_req() call made when
698− * the LS request was received. The structure will fully describe
769+ * the LS request was received. The structure will fully describe
699770 * the buffers for the response payload and the dma address of the
700− * payload. The LLDD is to transmit the response (or return a non-zero
701− * errno status), and upon completion of the transmit, call the
702− * "done" routine specified in the nvmefc_tgt_ls_req structure
703− * (argument to done is the ls reqwuest structure itself).
704− * After calling the done routine, the LLDD shall consider the
705− * LS handling complete and the nvmefc_tgt_ls_req structure may
706− * be freed/released.
771+ * payload. The LLDD is to transmit the response (or return a
772+ * non-zero errno status), and upon completion of the transmit, call
773+ * the "done" routine specified in the nvmefc_ls_rsp structure
774+ * (argument to done is the address of the nvmefc_ls_rsp structure
775+ * itself). Upon the completion of the done() routine, the LLDD shall
776+ * consider the LS handling complete and the nvmefc_ls_rsp structure
777+ * may be freed/released.
778+ * The transport will always call the xmt_ls_rsp() routine for any
779+ * LS received.
707780 * Entrypoint is Mandatory.
708781 *
709782 * @fcp_op: Called to perform a data transfer or transmit a response.
@@ -798,6 +871,39 @@ struct nvmet_fc_target_port { · 88 unmodified lines
798871 * should cause the initiator to rescan the discovery controller
799872 * on the targetport.
800873 *
874+ * @ls_req: Called to issue a FC-NVME FC-4 LS service request.
875+ * The nvme_fc_ls_req structure will fully describe the buffers for
876+ * the request payload and where to place the response payload.
877+ * The targetport that is to issue the LS request is identified by
878+ * the targetport argument. The remote port that is to receive the
879+ * LS request is identified by the hosthandle argument. The nvmet-fc
880+ * transport is only allowed to issue FC-NVME LS's on behalf of an
881+ * association that was created prior by a Create Association LS.
882+ * The hosthandle will originate from the LLDD in the struct
883+ * nvmefc_ls_rsp structure for the Create Association LS that
884+ * was delivered to the transport. The transport will save the
885+ * hosthandle as an attribute of the association. If the LLDD
886+ * loses connectivity with the remote port, it must call the
887+ * nvmet_fc_invalidate_host() routine to remove any references to
888+ * the remote port in the transport.
889+ * The LLDD is to allocate an exchange, issue the LS request, obtain
890+ * the LS response, and call the "done" routine specified in the
891+ * request structure (argument to done is the ls request structure
892+ * itself).
893+ * Entrypoint is Optional - but highly recommended.
894+ *
895+ * @ls_abort: called to request the LLDD to abort the indicated ls request.
896+ * The call may return before the abort has completed. After aborting
897+ * the request, the LLDD must still call the ls request done routine
898+ * indicating an FC transport Aborted status.
899+ * Entrypoint is Mandatory if the ls_req entry point is specified.
900+ *
901+ * @host_release: called to inform the LLDD that the request to invalidate
902+ * the host port indicated by the hosthandle has been fully completed.
903+ * No associations exist with the host port and there will be no
904+ * further references to hosthandle.
905+ * Entrypoint is Mandatory if the lldd calls nvmet_fc_invalidate_host().
906+ *
801907 * @max_hw_queues: indicates the maximum number of hw queues the LLDD
802908 * supports for cpu affinitization.
803909 * Value is Mandatory. Must be at least 1.
@@ -826,11 +932,19 @@ struct nvmet_fc_target_port { · 22 unmodified lines
826932 * area solely for the of the LLDD and its location is specified by
827933 * the targetport->private pointer.
828934 * Value is Mandatory. Allowed to be zero.
935+ *
936+ * @lsrqst_priv_sz: The LLDD sets this field to the amount of additional
937+ * memory that it would like nvmet-fc layer to allocate on the LLDD's
938+ * behalf whenever a ls request structure is allocated. The additional
939+ * memory area is solely for use by the LLDD and its location is
940+ * specified by the ls_request->private pointer.
941+ * Value is Mandatory. Allowed to be zero.
942+ *
829943 */
830944 struct nvmet_fc_target_template {
831945 void (*targetport_delete)(struct nvmet_fc_target_port *tgtport);
832946 int (*xmt_ls_rsp)(struct nvmet_fc_target_port *tgtport,
833− struct nvmefc_tgt_ls_req *tls_req);
947+ struct nvmefc_ls_rsp *ls_rsp);
834948 int (*fcp_op)(struct nvmet_fc_target_port *tgtport,
835949 struct nvmefc_tgt_fcp_req *fcpreq);
836950 void (*fcp_abort)(struct nvmet_fc_target_port *tgtport,
@@ -840,6 +954,11 @@ struct nvmet_fc_target_template { · 3 unmodified lines
840954 void (*defer_rcv)(struct nvmet_fc_target_port *tgtport,
841955 struct nvmefc_tgt_fcp_req *fcpreq);
842956 void (*discovery_event)(struct nvmet_fc_target_port *tgtport);
957+ int (*ls_req)(struct nvmet_fc_target_port *targetport,
958+ void *hosthandle, struct nvmefc_ls_req *lsreq);
959+ void (*ls_abort)(struct nvmet_fc_target_port *targetport,
960+ void *hosthandle, struct nvmefc_ls_req *lsreq);
961+ void (*host_release)(void *hosthandle);
843962
844963 u32 max_hw_queues;
845964 u16 max_sgl_segments;
@@ -848,7 +967,9 @@ struct nvmet_fc_target_template { · 2 unmodified lines
848967
849968 u32 target_features;
850969
970+ /* sizes of additional private data for data structures */
851971 u32 target_priv_sz;
972+ u32 lsrqst_priv_sz;
852973 };
853974
854975
@@ -859,10 +980,61 @@ int nvmet_fc_register_targetport(struct nvmet_fc_port_info *portinfo, · 4 unmodified lines
859980
860981 int nvmet_fc_unregister_targetport(struct nvmet_fc_target_port *tgtport);
861982
983+/*
984+ * Routine called to pass a NVME-FC LS request, received by the lldd,
985+ * to the nvmet-fc transport.
986+ *
987+ * If the return value is zero: the LS was successfully accepted by the
988+ * transport.
989+ * If the return value is non-zero: the transport has not accepted the
990+ * LS. The lldd should ABTS-LS the LS.
991+ *
992+ * Note: if the LLDD receives and ABTS for the LS prior to the transport
993+ * calling the ops->xmt_ls_rsp() routine to transmit a response, the LLDD
994+ * shall mark the LS as aborted, and when the xmt_ls_rsp() is called: the
995+ * response shall not be transmit and the struct nvmefc_ls_rsp() done
996+ * routine shall be called. The LLDD may transmit the ABTS response as
997+ * soon as the LS was marked or can delay until the xmt_ls_rsp() call is
998+ * made.
999+ * Note: if an RCV LS was successfully posted to the transport and the
1000+ * targetport is then unregistered before xmt_ls_rsp() was called for
1001+ * the lsrsp structure, the transport will still call xmt_ls_rsp()
1002+ * afterward to cleanup the outstanding lsrsp structure. The LLDD should
1003+ * noop the transmission of the rsp and call the lsrsp->done() routine
1004+ * to allow the lsrsp structure to be released.
1005+ */
8621006 int nvmet_fc_rcv_ls_req(struct nvmet_fc_target_port *tgtport,
863− struct nvmefc_tgt_ls_req *lsreq,
1007+ void *hosthandle,
1008+ struct nvmefc_ls_rsp *rsp,
8641009 void *lsreqbuf, u32 lsreqbuf_len);
8651010
1011+/*
1012+ * Routine called by the LLDD whenever it has a logout or loss of
1013+ * connectivity to a NVME-FC host port which there had been active
1014+ * NVMe controllers for. The host port is indicated by the
1015+ * hosthandle. The hosthandle is given to the nvmet-fc transport
1016+ * when a NVME LS was received, typically to create a new association.
1017+ * The nvmet-fc transport will cache the hostport value with the
1018+ * association for use in LS requests for the association.
1019+ * When the LLDD calls this routine, the nvmet-fc transport will
1020+ * immediately terminate all associations that were created with
1021+ * the hosthandle host port.
1022+ * The LLDD, after calling this routine and having control returned,
1023+ * must assume the transport may subsequently utilize hosthandle as
1024+ * part of sending LS's to terminate the association. The LLDD
1025+ * should reject the LS's if they are attempted.
1026+ * Once the last association has terminated for the hosthandle host
1027+ * port, the nvmet-fc transport will call the ops->host_release()
1028+ * callback. As of the callback, the nvmet-fc transport will no
1029+ * longer reference hosthandle.
1030+ */
1031+void nvmet_fc_invalidate_host(struct nvmet_fc_target_port *tgtport,
1032+ void *hosthandle);
1033+
1034+/*
1035+ * If nvmet_fc_rcv_fcp_req returns non-zero, the transport has not accepted
1036+ * the FCP cmd. The lldd should ABTS-LS the cmd.
1037+ */
8661038 int nvmet_fc_rcv_fcp_req(struct nvmet_fc_target_port *tgtport,
8671039 struct nvmefc_tgt_fcp_req *fcpreq,
8681040 void *cmdiubuf, u32 cmdiubuf_len);
include/linux/nvme-fc.h+6−5
@@ -4,8 +4,8 @@ · 3 unmodified lines
44 */
55
66 /*
7− * This file contains definitions relative to FC-NVME-2 r1.06
8− * (T11-2019-00210-v001).
7+ * This file contains definitions relative to FC-NVME-2 r1.08
8+ * (T11-2019-00210-v004).
99 */
1010
1111 #ifndef _NVME_FC_H
@@ -81,7 +81,8 @@ struct nvme_fc_ersp_iu { · 69 unmodified lines
8181 };
8282
8383
84−#define FCNVME_NVME_SR_OPCODE 0x01
84+#define FCNVME_NVME_SR_OPCODE 0x01
85+#define FCNVME_NVME_SR_RSP_OPCODE 0x02
8586
8687 struct nvme_fc_nvme_sr_iu {
8788 __u8 fc_id;
@@ -94,7 +95,7 @@ struct nvme_fc_nvme_sr_iu { · 6 unmodified lines
9495
9596 enum {
9697 FCNVME_SRSTAT_ACC = 0x0,
97− FCNVME_SRSTAT_INV_FCID = 0x1,
98+ /* reserved 0x1 */
9899 /* reserved 0x2 */
99100 FCNVME_SRSTAT_LOGICAL_ERR = 0x3,
100101 FCNVME_SRSTAT_INV_QUALIF = 0x4,
@@ -397,7 +398,7 @@ struct fcnvme_ls_disconnect_conn_rqst { · 296 unmodified lines
397398 struct fcnvme_ls_rqst_w0 w0;
398399 __be32 desc_list_len;
399400 struct fcnvme_lsdesc_assoc_id associd;
400− struct fcnvme_lsdesc_disconn_cmd connectid;
401+ struct fcnvme_lsdesc_conn_id connectid;
401402 };
402403
403404 struct fcnvme_ls_disconnect_conn_acc {
include/linux/nvme.h+15−1
@@ -38,6 +38,8 @@ enum { · 37 unmodified lines
3838 NVMF_ADDR_FAMILY_IP6 = 2, /* IP6 */
3939 NVMF_ADDR_FAMILY_IB = 3, /* InfiniBand */
4040 NVMF_ADDR_FAMILY_FC = 4, /* Fibre Channel */
41+ NVMF_ADDR_FAMILY_LOOP = 254, /* Reserved for host usage */
42+ NVMF_ADDR_FAMILY_MAX,
4143 };
4244
4345 /* Transport Type codes for Discovery Log Page entry TRTYPE field */
@@ -299,6 +301,8 @@ struct nvme_id_ctrl { · 255 unmodified lines
299301 };
300302
301303 enum {
304+ NVME_CTRL_CMIC_MULTI_CTRL = 1 << 1,
305+ NVME_CTRL_CMIC_ANA = 1 << 3,
302306 NVME_CTRL_ONCS_COMPARE = 1 << 0,
303307 NVME_CTRL_ONCS_WRITE_UNCORRECTABLE = 1 << 1,
304308 NVME_CTRL_ONCS_DSM = 1 << 2,
@@ -394,8 +398,12 @@ enum { · 89 unmodified lines
394398
395399 enum {
396400 NVME_NS_FEAT_THIN = 1 << 0,
401+ NVME_NS_FEAT_ATOMICS = 1 << 1,
402+ NVME_NS_FEAT_IO_OPT = 1 << 4,
403+ NVME_NS_ATTR_RO = 1 << 0,
397404 NVME_NS_FLBAS_LBA_MASK = 0xf,
398405 NVME_NS_FLBAS_META_EXT = 0x10,
406+ NVME_NS_NMIC_SHARED = 1 << 0,
399407 NVME_LBAF_RP_BEST = 0,
400408 NVME_LBAF_RP_BETTER = 1,
401409 NVME_LBAF_RP_GOOD = 2,
@@ -412,6 +420,12 @@ enum { · 10 unmodified lines
412420 NVME_NS_DPS_PI_TYPE3 = 3,
413421 };
414422
423+/* Identify Namespace Metadata Capabilities (MC): */
424+enum {
425+ NVME_MC_EXTENDED_LBA = (1 << 0),
426+ NVME_MC_METADATA_PTR = (1 << 1),
427+};
428+
415429 struct nvme_ns_id_desc {
416430 __u8 nidt;
417431 __u8 nidl;
@@ -1177,7 +1191,7 @@ struct nvmf_disc_rsp_page_hdr { · 759 unmodified lines
11771191 __le64 numrec;
11781192 __le16 recfmt;
11791193 __u8 resv14[1006];
1180− struct nvmf_disc_rsp_page_entry entries[0];
1194+ struct nvmf_disc_rsp_page_entry entries[];
11811195 };
11821196
11831197 enum {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t