xref: /illumos-gate/usr/src/uts/common/io/nvme/nvme_var.h (revision 1c02c6c85edfeb48df1fe18511a8779bf9d6c6ed)
1 /*
2  * This file and its contents are supplied under the terms of the
3  * Common Development and Distribution License ("CDDL"), version 1.0.
4  * You may only use this file in accordance with the terms of version
5  * 1.0 of the CDDL.
6  *
7  * A full copy of the text of the CDDL should have accompanied this
8  * source.  A copy of the CDDL is also available via the Internet at
9  * http://www.illumos.org/license/CDDL.
10  */
11 
12 /*
13  * Copyright 2016 The MathWorks, Inc. All rights reserved.
14  * Copyright 2019 Joyent, Inc.
15  * Copyright 2019 Unix Software Ltd.
16  * Copyright 2024 Oxide Computer Company.
17  * Copyright 2022 OmniOS Community Edition (OmniOSce) Association.
18  * Copyright 2022 Tintri by DDN, Inc. All rights reserved.
19  */
20 
21 #ifndef _NVME_VAR_H
22 #define	_NVME_VAR_H
23 
24 #include <sys/ddi.h>
25 #include <sys/sunddi.h>
26 #include <sys/blkdev.h>
27 #include <sys/taskq_impl.h>
28 #include <sys/list.h>
29 #include <sys/ddi_ufm.h>
30 #include <nvme_common.h>
31 
32 /*
33  * NVMe driver state
34  */
35 
36 #ifdef __cplusplus
37 extern "C" {
38 #endif
39 
40 #define	NVME_MODULE_NAME		"nvme"
41 
42 typedef enum {
43 	NVME_PCI_CONFIG			= 1 << 0,
44 	NVME_FMA_INIT			= 1 << 1,
45 	NVME_REGS_MAPPED		= 1 << 2,
46 	NVME_ADMIN_QUEUE		= 1 << 3,
47 	NVME_CTRL_LIMITS		= 1 << 4,
48 	NVME_INTERRUPTS			= 1 << 5,
49 	NVME_UFM_INIT			= 1 << 6,
50 	NVME_MUTEX_INIT			= 1 << 7,
51 	NVME_MGMT_INIT			= 1 << 8,
52 	NVME_STAT_INIT			= 1 << 9
53 } nvme_progress_t;
54 
55 typedef enum {
56 	NVME_NS_LOCK	= 1 << 0
57 } nvme_ns_progress_t;
58 
59 typedef enum {
60 	/*
61 	 * The controller fails to properly process commands on the admin queue
62 	 * if the first one has CID 0. Subsequent use of CID 0 doesn't present
63 	 * a problem.
64 	 */
65 	NVME_QUIRK_START_CID		= 1 << 0,
66 } nvme_quirk_t;
67 
68 #define	NVME_MIN_ADMIN_QUEUE_LEN	16
69 #define	NVME_MIN_IO_QUEUE_LEN		16
70 #define	NVME_DEFAULT_ADMIN_QUEUE_LEN	256
71 #define	NVME_DEFAULT_IO_QUEUE_LEN	1024
72 #define	NVME_DEFAULT_ASYNC_EVENT_LIMIT	10
73 #define	NVME_MIN_ASYNC_EVENT_LIMIT	1
74 #define	NVME_DEFAULT_MIN_BLOCK_SIZE	512
75 
76 typedef struct nvme nvme_t;
77 typedef struct nvme_namespace nvme_namespace_t;
78 typedef struct nvme_minor nvme_minor_t;
79 typedef struct nvme_lock nvme_lock_t;
80 typedef struct nvme_minor_lock_info nvme_minor_lock_info_t;
81 typedef struct nvme_dma nvme_dma_t;
82 typedef struct nvme_cmd nvme_cmd_t;
83 typedef struct nvme_cq nvme_cq_t;
84 typedef struct nvme_qpair nvme_qpair_t;
85 typedef struct nvme_task_arg nvme_task_arg_t;
86 typedef struct nvme_device_stat nvme_device_stat_t;
87 typedef struct nvme_admin_stat nvme_admin_stat_t;
88 
89 /*
90  * These states represent the minor's perspective. That is, of a minor's
91  * namespace and controller lock, where is it?
92  */
93 typedef enum {
94 	NVME_LOCK_STATE_UNLOCKED	= 0,
95 	NVME_LOCK_STATE_BLOCKED,
96 	NVME_LOCK_STATE_ACQUIRED
97 } nvme_minor_lock_state_t;
98 
99 struct nvme_minor_lock_info {
100 	list_node_t nli_node;
101 	nvme_lock_t *nli_lock;
102 	nvme_minor_lock_state_t nli_state;
103 	nvme_lock_level_t nli_curlevel;
104 	/*
105 	 * While the minor points back to itself and the nvme_t should always
106 	 * point to the current controller, the namespace should only point to
107 	 * one if this is a particular namespace lock. The former two are
108 	 * initialized at minor initialization time.
109 	 */
110 	nvme_minor_t *nli_minor;
111 	nvme_t *nli_nvme;
112 	nvme_namespace_t *nli_ns;
113 	/*
114 	 * This is the common ioctl information that should be filled in when
115 	 * we're being woken up for any reason other than an interrupted signal.
116 	 * This should only be set while blocking.
117 	 */
118 	nvme_ioctl_common_t *nli_ioc;
119 	/*
120 	 * The following are provided for debugging purposes. In particular,
121 	 * information like the kthread_t and related that performed this should
122 	 * be considered suspect as it represents who took the operation, not
123 	 * who performed the operation (unless we're actively blocking).
124 	 */
125 	hrtime_t nli_last_change;
126 	uintptr_t nli_acq_kthread;
127 	pid_t nli_acq_pid;
128 };
129 
130 struct nvme_minor {
131 	/*
132 	 * The following three fields are set when this is created.
133 	 */
134 	id_t nm_minor;
135 	nvme_t *nm_ctrl;
136 	nvme_namespace_t *nm_ns;
137 	/*
138 	 * This link is used to index this minor on the global list of active
139 	 * open-related minors. This is only manipulated under the
140 	 * nvme_open_minors_mutex.
141 	 */
142 	avl_node_t nm_avl;
143 	/*
144 	 * Information related to locking. Note, there is no pointer to a locked
145 	 * controller as the only one can be the one specified here. This data
146 	 * is protected by the controller's n_minor_mutex.
147 	 */
148 	kcondvar_t nm_cv;
149 	nvme_minor_lock_info_t nm_ctrl_lock;
150 	nvme_minor_lock_info_t nm_ns_lock;
151 };
152 
153 struct nvme_lock {
154 	nvme_minor_lock_info_t *nl_writer;
155 	list_t nl_readers;
156 	list_t nl_pend_readers;
157 	list_t nl_pend_writers;
158 	/*
159 	 * The following are stats to indicate how often certain locking
160 	 * activities have occurred for debugging purposes.
161 	 */
162 	uint32_t nl_nwrite_locks;
163 	uint32_t nl_nread_locks;
164 	uint32_t nl_npend_writes;
165 	uint32_t nl_npend_reads;
166 	uint32_t nl_nnonblock;
167 	uint32_t nl_nsignals;
168 	uint32_t nl_nsig_unlock;
169 	uint32_t nl_nsig_blocks;
170 	uint32_t nl_nsig_acq;
171 };
172 
173 struct nvme_dma {
174 	ddi_dma_handle_t nd_dmah;
175 	ddi_acc_handle_t nd_acch;
176 	ddi_dma_cookie_t nd_cookie;
177 	uint_t nd_ncookie;
178 	caddr_t nd_memp;
179 	size_t nd_len;
180 	boolean_t nd_cached;
181 };
182 
183 typedef enum {
184 	NVME_CMD_ALLOCATED = 0,
185 	NVME_CMD_SUBMITTED,
186 	NVME_CMD_QUEUED,
187 	NVME_CMD_COMPLETED,
188 	NVME_CMD_LOST
189 } nvme_cmd_state_t;
190 
191 typedef enum {
192 	NVME_CMD_F_DONTPANIC	= 1 << 0,
193 	NVME_CMD_F_USELOCK	= 1 << 1,
194 } nvme_cmd_flag_t;
195 
196 /*
197  * This command structure is shared between admin and I/O commands. When used
198  * for an admin command, nc_mutex and nc_cv are used to synchronise access to
199  * various fields, and to signal command completion. NVME_CMD_F_USELOCK in
200  * nc_flags indicates whether the lock and CV are in use. For I/O commands,
201  * these are neither initialised nor used.
202  */
203 struct nvme_cmd {
204 	struct list_node nc_list;
205 
206 	nvme_sqe_t nc_sqe;
207 	nvme_cqe_t nc_cqe;
208 
209 	void (*nc_callback)(void *);
210 	bd_xfer_t *nc_xfer;
211 
212 	uint32_t nc_timeout;
213 	nvme_cmd_flag_t nc_flags;
214 	nvme_cmd_state_t nc_state; /* Protected by nc_mutex iff F_USELOCK */
215 	uint16_t nc_sqid;
216 
217 	hrtime_t nc_submit_ts;
218 	hrtime_t nc_queue_ts;
219 
220 	nvme_dma_t *nc_dma;
221 	nvme_dma_t *nc_prp; /* DMA for PRP lists */
222 
223 	kmutex_t nc_mutex;
224 	kcondvar_t nc_cv;
225 
226 	taskq_ent_t nc_tqent;
227 	nvme_t *nc_nvme;
228 };
229 
230 struct nvme_cq {
231 	size_t ncq_nentry;
232 	uint16_t ncq_id;
233 
234 	nvme_dma_t *ncq_dma;
235 	nvme_cqe_t *ncq_cq;
236 	uint_t ncq_head;
237 	uintptr_t ncq_hdbl;
238 	int ncq_phase;
239 
240 	taskq_t *ncq_cmd_taskq;
241 
242 	kmutex_t ncq_mutex;
243 };
244 
245 struct nvme_qpair {
246 	size_t nq_nentry;
247 
248 	/* submission fields */
249 	nvme_dma_t *nq_sqdma;
250 	nvme_sqe_t *nq_sq;
251 	uint_t nq_sqhead;
252 	uint_t nq_sqtail;
253 	uintptr_t nq_sqtdbl;
254 
255 	/* completion */
256 	nvme_cq_t *nq_cq;
257 
258 	/* shared structures for completion and submission */
259 	nvme_cmd_t **nq_cmd;	/* active command array */
260 	uint16_t nq_next_cmd;	/* next potential empty queue slot */
261 	uint_t nq_active_cmds;	/* number of active cmds */
262 	uint32_t nq_active_timeout; /* sum of the timeouts of active cmds */
263 
264 	kmutex_t nq_mutex;	/* protects shared state */
265 	ksema_t nq_sema; /* semaphore to ensure q always has >= 1 empty slot */
266 };
267 
268 typedef struct nvme_mgmt_lock {
269 	kmutex_t nml_lock;
270 	kcondvar_t nml_cv;
271 	uintptr_t nml_bd_own;
272 } nvme_mgmt_lock_t;
273 
274 struct nvme_device_stat {
275 	/* Errors detected by driver */
276 	kstat_named_t nds_dma_bind_err;
277 	kstat_named_t nds_abort_timeout;
278 	kstat_named_t nds_abort_failed;
279 	kstat_named_t nds_abort_successful;
280 	kstat_named_t nds_abort_unsuccessful;
281 	kstat_named_t nds_cmd_timeout;
282 	kstat_named_t nds_wrong_logpage;
283 	kstat_named_t nds_unknown_logpage;
284 	kstat_named_t nds_too_many_cookies;
285 	kstat_named_t nds_unknown_cid;
286 
287 	/* Errors detected by hardware */
288 	kstat_named_t nds_inv_cmd_err;
289 	kstat_named_t nds_inv_field_err;
290 	kstat_named_t nds_inv_nsfmt_err;
291 	kstat_named_t nds_data_xfr_err;
292 	kstat_named_t nds_internal_err;
293 	kstat_named_t nds_abort_rq_err;
294 	kstat_named_t nds_abort_pwrloss_err;
295 	kstat_named_t nds_abort_sq_del;
296 	kstat_named_t nds_nvm_cap_exc;
297 	kstat_named_t nds_nvm_ns_notrdy;
298 	kstat_named_t nds_nvm_ns_formatting;
299 	kstat_named_t nds_inv_cq_err;
300 	kstat_named_t nds_inv_qid_err;
301 	kstat_named_t nds_max_qsz_exc;
302 	kstat_named_t nds_inv_int_vect;
303 	kstat_named_t nds_inv_log_page;
304 	kstat_named_t nds_inv_format;
305 	kstat_named_t nds_inv_q_del;
306 	kstat_named_t nds_cnfl_attr;
307 	kstat_named_t nds_inv_prot;
308 	kstat_named_t nds_readonly;
309 	kstat_named_t nds_inv_fwslot;
310 	kstat_named_t nds_inv_fwimg;
311 	kstat_named_t nds_fwact_creset;
312 	kstat_named_t nds_fwact_nssr;
313 	kstat_named_t nds_fwact_reset;
314 	kstat_named_t nds_fwact_mtfa;
315 	kstat_named_t nds_fwact_prohibited;
316 	kstat_named_t nds_fw_overlap;
317 	kstat_named_t nds_inv_cmdseq_err;
318 
319 	/* Errors reported by asynchronous events */
320 	kstat_named_t nds_diagfail_event;
321 	kstat_named_t nds_persistent_event;
322 	kstat_named_t nds_transient_event;
323 	kstat_named_t nds_fw_load_event;
324 	kstat_named_t nds_reliability_event;
325 	kstat_named_t nds_temperature_event;
326 	kstat_named_t nds_spare_event;
327 	kstat_named_t nds_vendor_event;
328 	kstat_named_t nds_notice_event;
329 	kstat_named_t nds_unknown_event;
330 };
331 
332 #define	NAS_CNT 0
333 #define	NAS_AVG 1
334 #define	NAS_MAX 2
335 struct nvme_admin_stat {
336 	kstat_named_t nas_getlogpage[3];
337 	kstat_named_t nas_identify[3];
338 	kstat_named_t nas_abort[3];
339 	kstat_named_t nas_fwactivate[3];
340 	kstat_named_t nas_fwimgload[3];
341 	kstat_named_t nas_nsformat[3];
342 	kstat_named_t nas_vendor[3];
343 	kstat_named_t nas_other[3];
344 };
345 
346 struct nvme {
347 	dev_info_t *n_dip;
348 	nvme_progress_t n_progress;
349 	nvme_quirk_t n_quirks;
350 
351 	caddr_t n_regs;
352 	ddi_acc_handle_t n_regh;
353 
354 	kmem_cache_t *n_cmd_cache;
355 	kmem_cache_t *n_prp_cache;
356 
357 	size_t n_inth_sz;
358 	ddi_intr_handle_t *n_inth;
359 	int n_intr_cnt;
360 	uint_t n_intr_pri;
361 	int n_intr_cap;
362 	int n_intr_type;
363 	int n_intr_types;
364 
365 	ddi_acc_handle_t n_pcicfg_handle;
366 	uint16_t n_vendor_id;
367 	uint16_t n_device_id;
368 	uint16_t n_subsystem_vendor_id;
369 	uint16_t n_subsystem_device_id;
370 	uint8_t n_revision_id;
371 
372 	char *n_product;
373 	char *n_vendor;
374 
375 	nvme_version_t n_version;
376 	boolean_t n_dead;
377 	nvme_ioctl_errno_t n_dead_status;
378 	taskq_ent_t n_dead_tqent;
379 	boolean_t n_strict_version;
380 	boolean_t n_ignore_unknown_vendor_status;
381 	uint32_t n_admin_queue_len;
382 	uint32_t n_io_squeue_len;
383 	uint32_t n_io_cqueue_len;
384 	uint16_t n_async_event_limit;
385 	uint_t n_min_block_size;
386 	uint16_t n_abort_command_limit;
387 	uint64_t n_max_data_transfer_size;
388 	boolean_t n_write_cache_present;
389 	boolean_t n_write_cache_enabled;
390 	int n_error_log_len;
391 	boolean_t n_async_event_supported;
392 	int n_submission_queues;
393 	int n_completion_queues;
394 
395 	int n_nssr_supported;
396 	int n_doorbell_stride;
397 	int n_timeout;
398 	int n_arbitration_mechanisms;
399 	int n_cont_queues_reqd;
400 	int n_max_queue_entries;
401 	int n_pageshift;
402 	int n_pagesize;
403 
404 	uint32_t n_namespace_count;
405 	uint_t n_namespaces_attachable;
406 	uint_t n_ioq_count;
407 	uint_t n_cq_count;
408 
409 	/*
410 	 * This is cached identify controller and common namespace data that
411 	 * exists in the system. This generally can be used in the kernel;
412 	 * however, we have to be careful about what we use here because these
413 	 * values are not refreshed after attach. Therefore these are good for
414 	 * answering the question what does the controller support or what is in
415 	 * the common namespace information, but not otherwise. That means you
416 	 * shouldn't use this to try to answer how much capacity is still in the
417 	 * controller because this information is just cached.
418 	 */
419 	nvme_identify_ctrl_t *n_idctl;
420 	nvme_identify_nsid_t *n_idcomns;
421 
422 	/* Pointer to the admin queue, which is always queue 0 in n_ioq. */
423 	nvme_qpair_t *n_adminq;
424 	/*
425 	 * All command queues, including the admin queue.
426 	 * Its length is: n_ioq_count + 1.
427 	 */
428 	nvme_qpair_t **n_ioq;
429 	nvme_cq_t **n_cq;
430 
431 	nvme_namespace_t *n_ns;
432 
433 	ddi_dma_attr_t n_queue_dma_attr;
434 	ddi_dma_attr_t n_prp_dma_attr;
435 	ddi_dma_attr_t n_sgl_dma_attr;
436 	ddi_device_acc_attr_t n_reg_acc_attr;
437 	ddi_iblock_cookie_t n_fm_ibc;
438 	int n_fm_cap;
439 
440 	ksema_t n_abort_sema;
441 
442 	/* protects namespace management operations */
443 	nvme_mgmt_lock_t n_mgmt;
444 
445 	/*
446 	 * This lock protects the minor node locking state across the controller
447 	 * and all related namespaces.
448 	 */
449 	kmutex_t n_minor_mutex;
450 	nvme_lock_t n_lock;
451 
452 	kstat_t *n_device_kstat;
453 	nvme_device_stat_t n_device_stat;
454 
455 	kstat_t *n_admin_kstat;
456 	kmutex_t n_admin_stat_mutex;
457 	nvme_admin_stat_t n_admin_stat;
458 
459 	/* hot removal NDI event handling */
460 	ddi_eventcookie_t n_rm_cookie;
461 	ddi_callback_id_t n_ev_rm_cb_id;
462 
463 	/* DDI UFM handle */
464 	ddi_ufm_handle_t *n_ufmh;
465 	/* Cached Firmware Slot Information log page */
466 	nvme_fwslot_log_t *n_fwslot;
467 	/* Lock protecting the cached firmware slot info */
468 	kmutex_t n_fwslot_mutex;
469 };
470 
471 struct nvme_namespace {
472 	nvme_t *ns_nvme;
473 	nvme_ns_progress_t ns_progress;
474 	uint8_t ns_eui64[8];
475 	uint8_t	ns_nguid[16];
476 	char	ns_name[11];
477 
478 	bd_handle_t ns_bd_hdl;
479 
480 	uint32_t ns_id;
481 	size_t ns_block_count;
482 	size_t ns_block_size;
483 	size_t ns_best_block_size;
484 
485 	boolean_t ns_allocated;
486 	boolean_t ns_active;
487 	boolean_t ns_ignore;
488 	boolean_t ns_attached;
489 
490 	nvme_identify_nsid_t *ns_idns;
491 
492 	/*
493 	 * Namespace lock, see the theory statement for more information.
494 	 */
495 	nvme_lock_t ns_lock;
496 
497 	/*
498 	 * If a namespace has neither NGUID nor EUI64, we create a devid in
499 	 * nvme_prepare_devid().
500 	 */
501 	char *ns_devid;
502 };
503 
504 struct nvme_task_arg {
505 	nvme_t *nt_nvme;
506 	nvme_cmd_t *nt_cmd;
507 };
508 
509 typedef enum {
510 	/*
511 	 * This indicates that there is no exclusive access required for this
512 	 * operation. However, this operation will fail if someone attempts to
513 	 * perform this operation and someone else holds a write lock.
514 	 */
515 	NVME_IOCTL_EXCL_NONE	= 0,
516 	/*
517 	 * This indicates that a write lock is required to perform the
518 	 * operation.
519 	 */
520 	NVME_IOCTL_EXCL_WRITE,
521 	/*
522 	 * This indicates that the exclusive check should be skipped. The only
523 	 * case this should be used in is the lock and unlock ioctls as they
524 	 * should be able to proceed even when the controller is being used
525 	 * exclusively.
526 	 */
527 	NVME_IOCTL_EXCL_SKIP
528 } nvme_ioctl_excl_t;
529 
530 /*
531  * This structure represents the set of checks that we apply to ioctl's using
532  * the nvme_ioctl_common_t structure as part of validation.
533  */
534 typedef struct nvme_ioctl_check {
535 	/*
536 	 * This indicates whether or not the command in question allows a
537 	 * namespace to be specified at all. If this is false, a namespace minor
538 	 * cannot be used and a controller minor must leave the nsid set to
539 	 * zero.
540 	 */
541 	boolean_t nck_ns_ok;
542 	/*
543 	 * This indicates that a minor node corresponding to a namespace is
544 	 * allowed to issue this.
545 	 */
546 	boolean_t nck_ns_minor_ok;
547 	/*
548 	 * This indicates that the controller should be skipped from all of the
549 	 * following processing behavior. That is, it's allowed to specify
550 	 * whatever it wants in the nsid field, regardless if it is valid or
551 	 * not. This is required for some of the Identify Command options that
552 	 * list endpoints. This should generally not be used and the driver
553 	 * should still validate the nuance here.
554 	 */
555 	boolean_t nck_skip_ctrl;
556 	/*
557 	 * This indicates that if we're on the controller's minor and we don't
558 	 * have an explicit namespace ID (i.e. 0), should the namespace be
559 	 * rewritten to be the broadcast namespace.
560 	 */
561 	boolean_t nck_ctrl_rewrite;
562 	/*
563 	 * This indicates whether or not the broadcast NSID is acceptable for
564 	 * the controller node.
565 	 */
566 	boolean_t nck_bcast_ok;
567 
568 	/*
569 	 * This indicates to the lock checking code what kind of exclusive
570 	 * access is required. This check occurs after any namespace rewriting
571 	 * has occurred. When looking at exclusivity, a broadcast namespace or
572 	 * namespace 0 indicate that the controller is the target, otherwise the
573 	 * target namespace will be checked for a write lock.
574 	 */
575 	nvme_ioctl_excl_t nck_excl;
576 } nvme_ioctl_check_t;
577 
578 /*
579  * Constants
580  */
581 extern uint_t nvme_vendor_specific_admin_cmd_max_timeout;
582 extern uint32_t nvme_vendor_specific_admin_cmd_size;
583 
584 /*
585  * Common functions.
586  */
587 extern nvme_namespace_t *nvme_nsid2ns(nvme_t *, uint32_t);
588 extern boolean_t nvme_ioctl_error(nvme_ioctl_common_t *, nvme_ioctl_errno_t,
589     uint32_t, uint32_t);
590 extern boolean_t nvme_ctrl_atleast(nvme_t *, const nvme_version_t *);
591 extern void nvme_ioctl_success(nvme_ioctl_common_t *);
592 
593 /*
594  * Validation related functions and kernel tunable limits.
595  */
596 extern boolean_t nvme_validate_logpage(nvme_t *, nvme_ioctl_get_logpage_t *);
597 extern boolean_t nvme_validate_identify(nvme_t *, nvme_ioctl_identify_t *,
598     boolean_t);
599 extern boolean_t nvme_validate_get_feature(nvme_t *,
600     nvme_ioctl_get_feature_t *);
601 extern boolean_t nvme_validate_vuc(nvme_t *, nvme_ioctl_passthru_t *);
602 extern boolean_t nvme_validate_format(nvme_t *, nvme_ioctl_format_t *);
603 extern boolean_t nvme_validate_fw_load(nvme_t *, nvme_ioctl_fw_load_t *);
604 extern boolean_t nvme_validate_fw_commit(nvme_t *, nvme_ioctl_fw_commit_t *);
605 
606 /*
607  * Locking functions
608  */
609 extern void nvme_rwlock(nvme_minor_t *, nvme_ioctl_lock_t *);
610 extern void nvme_rwunlock(nvme_minor_lock_info_t *, nvme_lock_t *);
611 extern void nvme_rwlock_ctrl_dead(void *);
612 extern void nvme_lock_init(nvme_lock_t *);
613 extern void nvme_lock_fini(nvme_lock_t *);
614 
615 /*
616  * Statistics functions
617  */
618 extern boolean_t nvme_stat_init(nvme_t *);
619 extern void nvme_stat_cleanup(nvme_t *);
620 extern void nvme_admin_stat_cmd(nvme_t *, nvme_cmd_t *);
621 
622 #ifdef __cplusplus
623 }
624 #endif
625 
626 #endif /* _NVME_VAR_H */
627