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
7extern 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
2646extern const struct file_operations def_blk_fops;2646extern const struct file_operations def_blk_fops;
2647extern const struct file_operations def_chr_fops;2647extern const struct file_operations def_chr_fops;
2648#ifdef CONFIG_BLOCK2648#ifdef CONFIG_BLOCK
2649extern int ioctl_by_bdev(struct block_device *, unsigned, unsigned long);
2650extern int blkdev_ioctl(struct block_device *, fmode_t, unsigned, unsigned long);2649extern int blkdev_ioctl(struct block_device *, fmode_t, unsigned, unsigned long);
2651extern long compat_blkdev_ioctl(struct file *, unsigned, unsigned long);2650extern long compat_blkdev_ioctl(struct file *, unsigned, unsigned long);
2652extern int blkdev_get(struct block_device *bdev, fmode_t mode, void *holder);2651extern 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
159struct disk_events;159struct disk_events;
160struct badblocks;160struct badblocks;
161 161
162#if defined(CONFIG_BLK_DEV_INTEGRITY)
163
164struct blk_integrity {162struct blk_integrity {
165 const struct blk_integrity_profile *profile;163 const struct blk_integrity_profile *profile;
166 unsigned char flags;164 unsigned char flags;
@@ -169,8 +167,6 @@ struct blk_integrity { · 2 unmodified lines
169 unsigned char tag_size;167 unsigned char tag_size;
170};168};
171 169
172#endif /* CONFIG_BLK_DEV_INTEGRITY */
173
174struct gendisk {170struct gendisk {
175 /* major, first_minor and minors are input parameters only,171 /* major, first_minor and minors are input parameters only,
176 * don't use directly. Use disk_devt() and disk_max_parts().172 * 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
10 10
11 11
12/*12/*
13 * ********************** LLDD FC-NVME Host API ********************13 * ********************** FC-NVME LS API ********************
14 *14 *
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.
16 *18 *
17 * ******************************************************************19 * ***********************************************************
18 */20 */
19 21
20
21
22/**22/**
23 * struct nvme_fc_port_info - port-specific ids and FC connection-specific23 * struct nvmefc_ls_req - Request structure passed from the transport
24 * data element used during NVME Host role24 * to the LLDD to perform a NVME-FC LS request and obtain
25 * registrations25 * a response.
26 *26 * Used by nvme-fc transport (host) to send LS's such as
27 * Static fields describing the port being registered:27 * Create Association, Create Connection and Disconnect
28 * @node_name: FC WWNN for the port28 * Association.
29 * @port_name: FC WWPN for the port29 * Used by the nvmet-fc transport (controller) to send
30 * @port_role: What NVME roles are supported (see FC_PORT_ROLE_xxx)30 * LS's such as Disconnect Association.
31 * @dev_loss_tmo: maximum delay for reconnects to an association on
32 * this device. Used only on a remoteport.
33 *31 *
34 * Initialization values for dynamic port fields:32 * Values set by the requestor prior to calling the LLDD ls_req entrypoint:
35 * @port_id: FC N_Port_ID currently assigned the port. Upper 8 bits must
36 * be set to 0.
37 */
38struct 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.
54 * @rqstaddr: pointer to request buffer33 * @rqstaddr: pointer to request buffer
55 * @rqstdma: PCI DMA address of request buffer34 * @rqstdma: PCI DMA address of request buffer
56 * @rqstlen: Length, in bytes, of request buffer35 * @rqstlen: Length, in bytes, of request buffer
@@ -63,8 +42,8 @@ struct nvme_fc_port_info { · 6 unmodified lines
63 * @private: pointer to memory allocated alongside the ls request structure42 * @private: pointer to memory allocated alongside the ls request structure
64 * that is specifically for the LLDD to use while processing the43 * that is specifically for the LLDD to use while processing the
65 * request. The length of the buffer corresponds to the44 * request. The length of the buffer corresponds to the
66 * lsrqst_priv_sz value specified in the nvme_fc_port_template45 * lsrqst_priv_sz value specified in the xxx_template supplied
67 * supplied by the LLDD.46 * by the LLDD.
68 * @done: The callback routine the LLDD is to invoke upon completion of47 * @done: The callback routine the LLDD is to invoke upon completion of
69 * the LS request. req argument is the pointer to the original LS48 * the LS request. req argument is the pointer to the original LS
70 * request structure. Status argument must be 0 upon success, a49 * request structure. Status argument must be 0 upon success, a
@@ -86,6 +65,101 @@ struct nvmefc_ls_req { · 15 unmodified lines
86} __aligned(sizeof(u64)); /* alignment for other things alloc'd with */65} __aligned(sizeof(u64)); /* alignment for other things alloc'd with */
87 66
88 67
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 */
119struct 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 */
155struct 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
89enum nvmefc_fcp_datadir {163enum nvmefc_fcp_datadir {
90 NVMEFC_FCP_NODATA, /* payload_length and sg_cnt will be zero */164 NVMEFC_FCP_NODATA, /* payload_length and sg_cnt will be zero */
91 NVMEFC_FCP_WRITE,165 NVMEFC_FCP_WRITE,
@@ -337,6 +411,21 @@ struct nvme_fc_remote_port { · 245 unmodified lines
337 * indicating an FC transport Aborted status.411 * indicating an FC transport Aborted status.
338 * Entrypoint is Mandatory.412 * Entrypoint is Mandatory.
339 *413 *
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 *
340 * @max_hw_queues: indicates the maximum number of hw queues the LLDD429 * @max_hw_queues: indicates the maximum number of hw queues the LLDD
341 * supports for cpu affinitization.430 * supports for cpu affinitization.
342 * Value is Mandatory. Must be at least 1.431 * Value is Mandatory. Must be at least 1.
@@ -371,7 +460,7 @@ struct nvme_fc_remote_port { · 28 unmodified lines
371 * @lsrqst_priv_sz: The LLDD sets this field to the amount of additional460 * @lsrqst_priv_sz: The LLDD sets this field to the amount of additional
372 * memory that it would like fc nvme layer to allocate on the LLDD's461 * memory that it would like fc nvme layer to allocate on the LLDD's
373 * behalf whenever a ls request structure is allocated. The additional462 * behalf whenever a ls request structure is allocated. The additional
374 * memory area solely for the of the LLDD and its location is463 * memory area is solely for use by the LLDD and its location is
375 * specified by the ls_request->private pointer.464 * specified by the ls_request->private pointer.
376 * Value is Mandatory. Allowed to be zero.465 * Value is Mandatory. Allowed to be zero.
377 *466 *
@@ -405,6 +494,9 @@ struct nvme_fc_port_template { · 27 unmodified lines
405 struct nvme_fc_remote_port *,494 struct nvme_fc_remote_port *,
406 void *hw_queue_handle,495 void *hw_queue_handle,
407 struct nvmefc_fcp_req *);496 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);
408 500
409 u32 max_hw_queues;501 u32 max_hw_queues;
410 u16 max_sgl_segments;502 u16 max_sgl_segments;
@@ -441,6 +533,34 @@ void nvme_fc_rescan_remoteport(struct nvme_fc_remote_port *remoteport); · 30 unmodified lines
441int nvme_fc_set_remoteport_devloss(struct nvme_fc_remote_port *remoteport,533int nvme_fc_set_remoteport_devloss(struct nvme_fc_remote_port *remoteport,
442 u32 dev_loss_tmo);534 u32 dev_loss_tmo);
443 535
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 */
559int 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
444 564
445/*565/*
446 * *************** LLDD FC-NVME Target/Subsystem API ***************566 * *************** LLDD FC-NVME Target/Subsystem API ***************
@@ -470,55 +590,6 @@ struct nvmet_fc_port_info { · 23 unmodified lines
470};590};
471 591
472 592
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 */
513struct 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
522/* Operations that NVME-FC layer may request the LLDD to perform for FCP */593/* Operations that NVME-FC layer may request the LLDD to perform for FCP */
523enum {594enum {
524 NVMET_FCOP_READDATA = 1, /* xmt data to initiator */595 NVMET_FCOP_READDATA = 1, /* xmt data to initiator */
@@ -693,17 +764,19 @@ struct nvmet_fc_target_port { · 168 unmodified lines
693 * Entrypoint is Mandatory.764 * Entrypoint is Mandatory.
694 *765 *
695 * @xmt_ls_rsp: Called to transmit the response to a FC-NVME FC-4 LS service.766 * @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 exchange767 * The nvmefc_ls_rsp structure is the same LLDD-supplied exchange
697 * structure specified in the nvmet_fc_rcv_ls_req() call made when768 * structure specified in the nvmet_fc_rcv_ls_req() call made when
698 * the LS request was received. The structure will fully describe769 * the LS request was received. The structure will fully describe
699 * the buffers for the response payload and the dma address of the770 * 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-zero771 * payload. The LLDD is to transmit the response (or return a
701 * errno status), and upon completion of the transmit, call the772 * non-zero errno status), and upon completion of the transmit, call
702 * "done" routine specified in the nvmefc_tgt_ls_req structure773 * the "done" routine specified in the nvmefc_ls_rsp structure
703 * (argument to done is the ls reqwuest structure itself).774 * (argument to done is the address of the nvmefc_ls_rsp structure
704 * After calling the done routine, the LLDD shall consider the775 * itself). Upon the completion of the done() routine, the LLDD shall
705 * LS handling complete and the nvmefc_tgt_ls_req structure may776 * consider the LS handling complete and the nvmefc_ls_rsp structure
706 * be freed/released.777 * may be freed/released.
778 * The transport will always call the xmt_ls_rsp() routine for any
779 * LS received.
707 * Entrypoint is Mandatory.780 * Entrypoint is Mandatory.
708 *781 *
709 * @fcp_op: Called to perform a data transfer or transmit a response.782 * @fcp_op: Called to perform a data transfer or transmit a response.
@@ -798,6 +871,39 @@ struct nvmet_fc_target_port { · 88 unmodified lines
798 * should cause the initiator to rescan the discovery controller871 * should cause the initiator to rescan the discovery controller
799 * on the targetport.872 * on the targetport.
800 *873 *
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 *
801 * @max_hw_queues: indicates the maximum number of hw queues the LLDD907 * @max_hw_queues: indicates the maximum number of hw queues the LLDD
802 * supports for cpu affinitization.908 * supports for cpu affinitization.
803 * Value is Mandatory. Must be at least 1.909 * Value is Mandatory. Must be at least 1.
@@ -826,11 +932,19 @@ struct nvmet_fc_target_port { · 22 unmodified lines
826 * area solely for the of the LLDD and its location is specified by932 * area solely for the of the LLDD and its location is specified by
827 * the targetport->private pointer.933 * the targetport->private pointer.
828 * Value is Mandatory. Allowed to be zero.934 * 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 *
829 */943 */
830struct nvmet_fc_target_template {944struct nvmet_fc_target_template {
831 void (*targetport_delete)(struct nvmet_fc_target_port *tgtport);945 void (*targetport_delete)(struct nvmet_fc_target_port *tgtport);
832 int (*xmt_ls_rsp)(struct nvmet_fc_target_port *tgtport,946 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);
834 int (*fcp_op)(struct nvmet_fc_target_port *tgtport,948 int (*fcp_op)(struct nvmet_fc_target_port *tgtport,
835 struct nvmefc_tgt_fcp_req *fcpreq);949 struct nvmefc_tgt_fcp_req *fcpreq);
836 void (*fcp_abort)(struct nvmet_fc_target_port *tgtport,950 void (*fcp_abort)(struct nvmet_fc_target_port *tgtport,
@@ -840,6 +954,11 @@ struct nvmet_fc_target_template { · 3 unmodified lines
840 void (*defer_rcv)(struct nvmet_fc_target_port *tgtport,954 void (*defer_rcv)(struct nvmet_fc_target_port *tgtport,
841 struct nvmefc_tgt_fcp_req *fcpreq);955 struct nvmefc_tgt_fcp_req *fcpreq);
842 void (*discovery_event)(struct nvmet_fc_target_port *tgtport);956 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);
843 962
844 u32 max_hw_queues;963 u32 max_hw_queues;
845 u16 max_sgl_segments;964 u16 max_sgl_segments;
@@ -848,7 +967,9 @@ struct nvmet_fc_target_template { · 2 unmodified lines
848 967
849 u32 target_features;968 u32 target_features;
850 969
970 /* sizes of additional private data for data structures */
851 u32 target_priv_sz;971 u32 target_priv_sz;
972 u32 lsrqst_priv_sz;
852};973};
853 974
854 975
@@ -859,10 +980,61 @@ int nvmet_fc_register_targetport(struct nvmet_fc_port_info *portinfo, · 4 unmodified lines
859 980
860int nvmet_fc_unregister_targetport(struct nvmet_fc_target_port *tgtport);981int nvmet_fc_unregister_targetport(struct nvmet_fc_target_port *tgtport);
861 982
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 */
862int nvmet_fc_rcv_ls_req(struct nvmet_fc_target_port *tgtport,1006int 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,
864 void *lsreqbuf, u32 lsreqbuf_len);1009 void *lsreqbuf, u32 lsreqbuf_len);
865 1010
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 */
1031void 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 */
866int nvmet_fc_rcv_fcp_req(struct nvmet_fc_target_port *tgtport,1038int nvmet_fc_rcv_fcp_req(struct nvmet_fc_target_port *tgtport,
867 struct nvmefc_tgt_fcp_req *fcpreq,1039 struct nvmefc_tgt_fcp_req *fcpreq,
868 void *cmdiubuf, u32 cmdiubuf_len);1040 void *cmdiubuf, u32 cmdiubuf_len);
include/linux/nvme-fc.h+6−5
@@ -4,8 +4,8 @@ · 3 unmodified lines
4 */4 */
5 5
6/*6/*
7 * This file contains definitions relative to FC-NVME-2 r1.067 * This file contains definitions relative to FC-NVME-2 r1.08
8 * (T11-2019-00210-v001).8 * (T11-2019-00210-v004).
9 */9 */
10 10
11#ifndef _NVME_FC_H11#ifndef _NVME_FC_H
@@ -81,7 +81,8 @@ struct nvme_fc_ersp_iu { · 69 unmodified lines
81};81};
82 82
83 83
84#define FCNVME_NVME_SR_OPCODE 0x0184#define FCNVME_NVME_SR_OPCODE 0x01
85#define FCNVME_NVME_SR_RSP_OPCODE 0x02
85 86
86struct nvme_fc_nvme_sr_iu {87struct nvme_fc_nvme_sr_iu {
87 __u8 fc_id;88 __u8 fc_id;
@@ -94,7 +95,7 @@ struct nvme_fc_nvme_sr_iu { · 6 unmodified lines
94 95
95enum {96enum {
96 FCNVME_SRSTAT_ACC = 0x0,97 FCNVME_SRSTAT_ACC = 0x0,
97 FCNVME_SRSTAT_INV_FCID = 0x1,98 /* reserved 0x1 */
98 /* reserved 0x2 */99 /* reserved 0x2 */
99 FCNVME_SRSTAT_LOGICAL_ERR = 0x3,100 FCNVME_SRSTAT_LOGICAL_ERR = 0x3,
100 FCNVME_SRSTAT_INV_QUALIF = 0x4,101 FCNVME_SRSTAT_INV_QUALIF = 0x4,
@@ -397,7 +398,7 @@ struct fcnvme_ls_disconnect_conn_rqst { · 296 unmodified lines
397 struct fcnvme_ls_rqst_w0 w0;398 struct fcnvme_ls_rqst_w0 w0;
398 __be32 desc_list_len;399 __be32 desc_list_len;
399 struct fcnvme_lsdesc_assoc_id associd;400 struct fcnvme_lsdesc_assoc_id associd;
400 struct fcnvme_lsdesc_disconn_cmd connectid;401 struct fcnvme_lsdesc_conn_id connectid;
401};402};
402 403
403struct fcnvme_ls_disconnect_conn_acc {404struct fcnvme_ls_disconnect_conn_acc {
include/linux/nvme.h+15−1
@@ -38,6 +38,8 @@ enum { · 37 unmodified lines
38 NVMF_ADDR_FAMILY_IP6 = 2, /* IP6 */38 NVMF_ADDR_FAMILY_IP6 = 2, /* IP6 */
39 NVMF_ADDR_FAMILY_IB = 3, /* InfiniBand */39 NVMF_ADDR_FAMILY_IB = 3, /* InfiniBand */
40 NVMF_ADDR_FAMILY_FC = 4, /* Fibre Channel */40 NVMF_ADDR_FAMILY_FC = 4, /* Fibre Channel */
41 NVMF_ADDR_FAMILY_LOOP = 254, /* Reserved for host usage */
42 NVMF_ADDR_FAMILY_MAX,
41};43};
42 44
43/* Transport Type codes for Discovery Log Page entry TRTYPE field */45/* Transport Type codes for Discovery Log Page entry TRTYPE field */
@@ -299,6 +301,8 @@ struct nvme_id_ctrl { · 255 unmodified lines
299};301};
300 302
301enum {303enum {
304 NVME_CTRL_CMIC_MULTI_CTRL = 1 << 1,
305 NVME_CTRL_CMIC_ANA = 1 << 3,
302 NVME_CTRL_ONCS_COMPARE = 1 << 0,306 NVME_CTRL_ONCS_COMPARE = 1 << 0,
303 NVME_CTRL_ONCS_WRITE_UNCORRECTABLE = 1 << 1,307 NVME_CTRL_ONCS_WRITE_UNCORRECTABLE = 1 << 1,
304 NVME_CTRL_ONCS_DSM = 1 << 2,308 NVME_CTRL_ONCS_DSM = 1 << 2,
@@ -394,8 +398,12 @@ enum { · 89 unmodified lines
394 398
395enum {399enum {
396 NVME_NS_FEAT_THIN = 1 << 0,400 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,
397 NVME_NS_FLBAS_LBA_MASK = 0xf,404 NVME_NS_FLBAS_LBA_MASK = 0xf,
398 NVME_NS_FLBAS_META_EXT = 0x10,405 NVME_NS_FLBAS_META_EXT = 0x10,
406 NVME_NS_NMIC_SHARED = 1 << 0,
399 NVME_LBAF_RP_BEST = 0,407 NVME_LBAF_RP_BEST = 0,
400 NVME_LBAF_RP_BETTER = 1,408 NVME_LBAF_RP_BETTER = 1,
401 NVME_LBAF_RP_GOOD = 2,409 NVME_LBAF_RP_GOOD = 2,
@@ -412,6 +420,12 @@ enum { · 10 unmodified lines
412 NVME_NS_DPS_PI_TYPE3 = 3,420 NVME_NS_DPS_PI_TYPE3 = 3,
413};421};
414 422
423/* Identify Namespace Metadata Capabilities (MC): */
424enum {
425 NVME_MC_EXTENDED_LBA = (1 << 0),
426 NVME_MC_METADATA_PTR = (1 << 1),
427};
428
415struct nvme_ns_id_desc {429struct nvme_ns_id_desc {
416 __u8 nidt;430 __u8 nidt;
417 __u8 nidl;431 __u8 nidl;
@@ -1177,7 +1191,7 @@ struct nvmf_disc_rsp_page_hdr { · 759 unmodified lines
1177 __le64 numrec;1191 __le64 numrec;
1178 __le16 recfmt;1192 __le16 recfmt;
1179 __u8 resv14[1006];1193 __u8 resv14[1006];
1180 struct nvmf_disc_rsp_page_entry entries[0];1194 struct nvmf_disc_rsp_page_entry entries[];
1181};1195};
1182 1196
1183enum {1197enum {

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