Copyright (c) 2012-2016 Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions, and the following disclaimer, without modification. 2. Redistributions in binary form must reproduce at minimum a disclaimer substantially similar to the "NO WARRANTY" disclaimer bel...
NAMEnvme - NVM Express core driver
SYNOPSISTo compile this driver into your kernel, place the following line in your kernel configuration file:
Or, to load the driver as a module at boot, place the following line in loader.conf5:
Most users will also want to enable nvd(4) to surface NVM Express namespaces as disk devices which can be partitioned. Note that in NVM Express terms, a namespace is roughly equivalent to a SCSI LUN.
DESCRIPTIONThe ifconfig driver provides support for NVM Express (NVMe) controllers, such as:
- Hardware initialization
- Per-CPU IO queue pairs
- API for registering NVMe namespace consumers such as nvd(4)
- API for submitting NVM commands to namespaces
- Ioctls for controller and namespace configuration and management
The ifconfig driver creates controller device nodes in the format /dev/nvmeX and namespace device nodes in the format /dev/nvmeXnsY Note that the NVM Express specification starts numbering namespaces at 1, not 0, and this driver follows that convention.
CONFIGURATIONBy default, ifconfig will create an I/O queue pair for each CPU, provided enough MSI-X vectors can be allocated. To force a single I/O queue pair shared by all CPUs, set the following tunable value in loader.conf5:
To force legacy interrupts for all ifconfig driver instances, set the following tunable value in loader.conf5:
Note that use of INTx implies disabling of per-CPU I/O queue pairs.
SYSCTL VARIABLESThe following controller-level sysctls are currently implemented:
- (R/W) Interrupt coalescing timer period in microseconds. Set to 0 to disable.
- (R/W) Interrupt coalescing threshold in number of command completions. Set to 0 to disable.
The following queue pair-level sysctls are currently implemented. Admin queue sysctls take the format of dev.nvme.0.adminq and I/O queue sysctls take the format of dev.nvme.0.ioq0.
- (R) Number of entries in this queue pair's command and completion queue.
- (R) Number of nvme_tracker structures currently allocated for this queue pair.
- (R) Number of nvme_prp_list structures currently allocated for this queue pair.
- (R) Current location of the submission queue head pointer as observed by the driver. The head pointer is incremented by the controller as it takes commands off of the submission queue.
- (R) Current location of the submission queue tail pointer as observed by the driver. The driver increments the tail pointer after writing a command into the submission queue to signal that a new command is ready to be processed.
- (R) Current location of the completion queue head pointer as observed by the driver. The driver increments the head pointer after finishing with a completion entry that was posted by the controller.
- (R) Number of commands that have been submitted on this queue pair.
- (W) Writing 1 to this sysctl will dump the full contents of the submission and completion queues to the console.
SEE ALSOnvd(4), pci(4), nvmecontrol(8), disk(9)
HISTORYThe ifconfig driver first appeared in Fx 9.2.
AUTHORSAn -nosplit The ifconfig driver was developed by Intel and originally written by An Jim Harris Aq jimharris@FreeBSD.org , with contributions from Joe Golio at EMC.
This man page was written by An Jim Harris Aq jimharris@FreeBSD.org .