summaryrefslogtreecommitdiffstats
path: root/sys/dev/nvme
Commit message (Collapse)AuthorAgeFilesLines
* Use bitwise OR instead of logical OR when constructing value forjimharris2014-06-101-1/+1
| | | | | | | SET_FEATURES/NUMBER_OF_QUEUES command. Sponsored by: Intel MFC after: 3 days
* nvme: Allocate all MSI resources up front so that we can fall back tojimharris2014-03-183-7/+44
| | | | | | | INTx if necessary. Sponsored by: Intel MFC after: 3 days
* nvme: Close hole where nvd(4) would not be notified of all nvme(4)jimharris2014-03-183-29/+73
| | | | | | | instances if modules loaded during boot. Sponsored by: Intel MFC after: 3 days
* nvme: NVMe specification dictates 4-byte alignment for PRPs (not 8).jimharris2014-03-171-1/+2
| | | | | Sponsored by: Intel MFC after: 3 days
* nvme: Remove the software progress marker SET_FEATURE command duringjimharris2014-03-171-10/+0
| | | | | | | | | | | | controller initialization. The spec says OS drivers should send this command after controller initialization completes successfully, but other NVMe OS drivers are not sending this command. This change will therefore reduce differences between the FreeBSD and other OS drivers. Sponsored by: Intel MFC after: 3 days
* For IDENTIFY passthrough commands to Chatham prototype controllers, copyjimharris2014-01-061-2/+23
| | | | | | | | | | | the spoofed identify data into the user buffer rather than issuing the command to the controller, since Chatham IDENTIFY data is always spoofed. While here, fix a bug in the spoofed data for Chatham submission and completion queue entry sizes. Sponsored by: Intel MFC after: 3 days
* Create a unique unit number for each controller and namespace cdev.jimharris2013-11-012-4/+11
| | | | | Sponsored by: Intel MFC after: 3 days
* Fix the LINT build.jimharris2013-10-081-0/+1
| | | | | Approved by: re (implicit) MFC after: 1 week
* Do not leak resources during attach if nvme_ctrlr_construct() or the initialjimharris2013-10-081-3/+9
| | | | | | | | | controller resets fail. Sponsored by: Intel Reviewed by: carl Approved by: re (hrs) MFC after: 1 week
* Log and then disable asynchronous notification of persistent events afterjimharris2013-10-082-7/+56
| | | | | | | | | | | | | | | | | | | | | they occur. This prevents repeated notifications of the same event. Status of these events may be viewed at any time by viewing the SMART/Health Info Page using nvmecontrol, whether or not asynchronous events notifications for those events are enabled. This log page can be viewed using: nvmecontrol logpage -p 2 <ctrlr id> Future enhancements may re-enable these notifications on a periodic basis so that if the notified condition persists, it will continue to be logged. Sponsored by: Intel Reviewed by: carl Approved by: re (hrs) MFC after: 1 week
* Do not enable temperature threshold as an asynchronous event notificationjimharris2013-10-081-0/+14
| | | | | | | | | on NVMe controllers that do not support it. Sponsored by: Intel Reviewed by: carl Approved by: re (hrs) MFC after: 1 week
* Extend some 32-bit fields and variables to 64-bit to prevent overflowjimharris2013-10-082-5/+5
| | | | | | | | | | when calculating stats in nvmecontrol perftest. Sponsored by: Intel Reported by: Joe Golio <joseph.golio@emc.com> Reviewed by: carl Approved by: re (hrs) MFC after: 1 week
* Add driver-assisted striping for upcoming Intel NVMe controllers that canjimharris2013-10-083-1/+225
| | | | | | | | | benefit from it. Sponsored by: Intel Reviewed by: kib (earlier version), carl Approved by: re (hrs) MFC after: 1 week
* Change the way that unmapped I/O capability is advertised.ken2013-08-151-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The previous method was to set the D_UNMAPPED_IO flag in the cdevsw for the driver. The problem with this is that in many cases (e.g. sa(4)) there may be some instances of the driver that can handle unmapped I/O and some that can't. The isp(4) driver can handle unmapped I/O, but the esp(4) driver currently cannot. The cdevsw is shared among all driver instances. So instead of setting a flag on the cdevsw, set a flag on the cdev. This allows drivers to indicate support for unmapped I/O on a per-instance basis. sys/conf.h: Remove the D_UNMAPPED_IO cdevsw flag and replace it with an SI_UNMAPPED cdev flag. kern_physio.c: Look at the cdev SI_UNMAPPED flag to determine whether or not a particular driver can handle unmapped I/O. geom_dev.c: Set the SI_UNMAPPED flag for all GEOM cdevs. Since GEOM will create a temporary mapping when needed, setting SI_UNMAPPED unconditionally will work. Remove the D_UNMAPPED_IO flag. nvme_ns.c: Set the SI_UNMAPPED flag on cdevs created here if NVME_UNMAPPED_BIO_SUPPORT is enabled. vfs_aio.c: In aio_qphysio(), check the SI_UNMAPPED flag on a cdev instead of the D_UNMAPPED_IO flag on the cdevsw. sys/param.h: Bump __FreeBSD_version to 1000045 for the switch from setting the D_UNMAPPED_IO flag in the cdevsw to setting SI_UNMAPPED in the cdev. Reviewed by: kib, jimharris MFC after: 1 week Sponsored by: Spectra Logic
* If a controller fails to initialize, do not notify consumers (nvd) of itsjimharris2013-08-131-0/+9
| | | | | | | | namespaces. Sponsoredy by: Intel Reviewed by: carl MFC after: 3 days
* Send a shutdown notification in the driver unload path, to ensurejimharris2013-08-134-28/+51
| | | | | | | | | notification gets sent in cases where system shuts down with driver unloaded. Sponsored by: Intel Reviewed by: carl MFC after: 3 days
* Add message when nvd disks are attached and detached.jimharris2013-07-193-3/+65
| | | | | | | | | | | | As part of this commit, add an nvme_strvis() function which borrows heavily from cam_strvis(). This will allow stripping of leading/trailing whitespace and also handle unprintable characters in model/serial numbers. This function goes into a new nvme_util.c file which is used by both the driver and nvmecontrol. Sponsored by: Intel Reviewed by: carl MFC after: 3 days
* Fix nvme(4) and nvd(4) to support non 512-byte sector sizes.jimharris2013-07-192-4/+15
| | | | | | | | | | Recent testing with QEMU that has variable sector size support for NVMe uncovered some of these issues. Chatham prototype boards supported only 512 byte sectors. Sponsored by: Intel Reviewed by: carl MFC after: 3 days
* Use pause() instead of DELAY() when polling for completion of adminjimharris2013-07-171-4/+4
| | | | | | | | | | | | | commands during controller initialization. DELAY() does not work here during config_intrhook context - we need to explicitly relinquish the CPU for the admin command completion to get processed. Sponsored by: Intel Reported by: Adam Brooks <adam.j.brooks@intel.com> Reviewed by: carl MFC after: 3 days
* Define constants for the lengths of the serial number, model numberjimharris2013-07-171-3/+7
| | | | | | | | | | | and firmware revision in the controller's identify structure. Also modify consumers of these fields to ensure they only use the specified number of bytes for their respective fields. Sponsored by: Intel Reviewed by: carl MFC after: 3 days
* Fix a poorly worded comment in nvme(4).jimharris2013-07-111-3/+3
| | | | MFC after: 3 days
* Add comment explaining why CACHE_LINE_SIZE is defined in nvme_private.hjimharris2013-07-091-0/+4
| | | | | | | if not already defined elsewhere. Requested by: attilio MFC after: 3 days
* Update copyright dates.jimharris2013-07-099-9/+9
| | | | MFC after: 3 days
* Do not retry failed async event requests.jimharris2013-07-091-5/+5
| | | | | Sponsored by: Intel MFC after: 3 days
* Add pci_enable_busmaster() and pci_disable_busmaster() calls injimharris2013-07-091-0/+3
| | | | | | | nvme_attach() and nvme_detach() respectively. Sponsored by: Intel MFC after: 3 days
* Add firmware replacement and activation support to nvmecontrol(8) throughjimharris2013-06-271-0/+6
| | | | | | | | | | | | | | | | | | | | a new firmware command. NVMe controllers may support up to 7 firmware slots for storing of different firmware revisions. This new firmware command supports firmware replacement (i.e. firmware download) with or without immediate activation, or activation of a previously stored firmware image. It also supports selection of the firmware slot during replacement operations, using IDENTIFY information from the controller to check that the specified slot is valid. Newly activated firmware does not take effect until the new controller reset, either via a reboot or separate 'nvmecontrol reset' command to the same controller. Submitted by: Joe Golio <joseph.golio@emc.com> Obtained from: EMC / Isilon Storage Division MFC after: 3 days
* Remove remaining uio-related code.jimharris2013-06-262-32/+0
| | | | | | | | The nvme_physio() function was removed quite a while ago, which was the only user of this uio-related code. Sponsored by: Intel MFC after: 3 days
* Fail any passthrough command whose transfer size exceeds the controller'sjimharris2013-06-262-2/+15
| | | | | | | | | | | max transfer size. This guards against rogue commands coming in from userspace. Also add KASSERTS for the virtual address and unmapped bio cases, if the transfer size exceeds the controller's max transfer size. Sponsored by: Intel MFC after: 3 days
* Use MAXPHYS to specify the maximum I/O size for nvme(4).jimharris2013-06-264-22/+10
| | | | | | | | | | | Also allow admin commands to transfer up to this maximum I/O size, rather than the artificial limit previously imposed. The larger I/O size is very beneficial for upcoming firmware download support. This has the added benefit of simplifying the code since both admin and I/O commands now use the same maximum I/O size. Sponsored by: Intel MFC after: 3 days
* Remove the NVME_IDENTIFY_CONTROLLER and NVME_IDENTIFY_NAMESPACE IOCTLs and ↵jimharris2013-04-123-50/+5
| | | | | | | | replace them with the NVMe passthrough equivalent. Sponsored by: Intel
* Add support for passthrough NVMe commands.jimharris2013-04-123-0/+163
| | | | | | | | This includes a new IOCTL to support a generic method for nvmecontrol(8) to pass IDENTIFY, GET_LOG_PAGE, GET_FEATURES and other commands to the controller, rather than separate IOCTLs for each. Sponsored by: Intel
* Move the busdma mapping functions to nvme_qpair.c.jimharris2013-04-124-84/+45
| | | | | | This removes nvme_uio.c completely. Sponsored by: Intel
* Remove the NVMe-specific physio and associated routines.jimharris2013-04-122-165/+2
| | | | | | | | These were added early on for benchmarking purposes to avoid the mapped I/O penalties incurred in kern_physio. Now that FreeBSD (including kern_physio) supports unmapped I/O, the need for these NVMe-specific routines no longer exists. Sponsored by: Intel
* Add a mutex to each namespace, for general locking operations on the namespace.jimharris2013-04-122-0/+12
| | | | Sponsored by: Intel
* Rename the controller's fail_req_lock, so that it can be used for otherjimharris2013-04-122-7/+8
| | | | | | locking operations on the controller. Sponsored by: Intel
* Do not panic when a busdma mapping operation fails.jimharris2013-04-122-5/+28
| | | | | | | Instead, print an error message and fail the associated command with DATA_TRANSFER_ERROR NVMe completion status. Sponsored by: Intel
* Add unmapped bio support to nvme(4) and nvd(4).jimharris2013-04-015-10/+114
| | | | Sponsored by: Intel
* Add "type" to nvme_request, signifying if its payload is a VADDR, UIO, orjimharris2013-03-295-37/+63
| | | | | | | NULL. This simplifies decisions around if/how requests are routed through busdma. It also paves the way for supporting unmapped bios. Sponsored by: Intel
* Remove obsolete comment. This code has now been tested with the QEMUjimharris2013-03-281-4/+0
| | | | NVMe device emulator.
* Delete extra IO qpairs allocated based on number of MSI-X vectors, butjimharris2013-03-281-6/+14
| | | | | | | | | | later found to not be usable because the controller doesn't support the same number of queues. This is not the normal case, but does occur with the Chatham prototype board. Sponsored by: Intel
* Fix printf format issue on i386.jimharris2013-03-271-2/+3
| | | | Reported by: bz
* Clean up debug prints.jimharris2013-03-265-43/+254
| | | | | | | | | 1) Consistently use device_printf. 2) Make dump_completion and dump_command into something more human-readable. Sponsored by: Intel Reviewed by: carl
* Move common code from the different nvme_allocate_request functions into ajimharris2013-03-261-18/+21
| | | | | | | | separate function. Sponsored by: Intel Suggested by: carl Reviewed by: carl
* Change a number of malloc(9) calls to use M_WAITOK instead ofjimharris2013-03-264-20/+10
| | | | | | | | M_NOWAIT. Sponsored by: Intel Suggested by: carl Reviewed by: carl
* Replace usages of mtx_pool_find used for admin commands with a pollingjimharris2013-03-264-103/+71
| | | | | | | | | | | | | | | mechanism. Now that all requests are timed, we are guaranteed to get a completion notification, even if it is an abort status due to a timed out admin command. This has the effect of simplifying the controller and namespace setup code, so that it reads straight through rather than broken up into a bunch of different callback functions. Sponsored by: Intel Reviewed by: carl
* Abort and do not retry any outstanding admin commands left over afterjimharris2013-03-261-0/+15
| | | | | | | a controller reset. Sponsored by: Intel Reviewed by: carl
* Add the ability to internally mark a controller as failed, if it is unable tojimharris2013-03-265-21/+192
| | | | | | | | | | | | | | | start or reset. Also add a notifier for NVMe consumers for controller fail conditions and plumb this notifier for nvd(4) to destroy the associated GEOM disks when a failure occurs. This requires a bit of work to cover the races when a consumer is sending I/O requests to a controller that is transitioning to the failed state. To help cover this condition, add a task to defer completion of I/Os submitted to a failed controller, so that the consumer will still always receive its completions in a different context than the submission. Sponsored by: Intel Reviewed by: carl
* Just disable the controller instead of deleting IO queues during detach.jimharris2013-03-262-59/+17
| | | | | | | | This is just as effective, and removes the need for a bunch of admin commands to a controller that's going to be disabled shortly anyways. Sponsored by: Intel Reviewed by: carl
* Set Pre-boot Software Load Count to 0 at the end of the controllerjimharris2013-03-261-0/+10
| | | | | | | | | | | | | start process. The spec indicates the OS driver should use Set Features (Software Progress Marker) to set the pre-boot software load count to 0 after the OS driver has successfully been initialized. This allows pre-boot software to determine if there have been any issues with the OS loading. Sponsored by: Intel Reviewed by: carl
* Remove the is_started flag from struct nvme_controller.jimharris2013-03-264-60/+46
| | | | | | | | | | This flag was originally added to communicate to the sysctl code which oids should be built, but there are easier ways to do this. This needs to be cleaned up prior to adding new controller states - for example, controller failure. Sponsored by: Intel Reviewed by: carl
OpenPOWER on IntegriCloud