aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/nvme
Commit message (Collapse)AuthorAgeFilesLines
* MFS r285918:Jim Harris2015-07-271-10/+12
| | | | | | | | | | | | MFC r285816: nvme: ensure csts.rdy bit is cleared before returning from nvme_ctrlr_disable Approved by: re (gjb) Sponsored by: Intel Notes: svn path=/releng/10.2/; revision=285922
* MFS r285917:Jim Harris2015-07-271-6/+28
| | | | | | | | | | | | MFC r285815: nvme: properly handle case where pci_alloc_msix does not alloc all vectors Approved by: re (gjb) Sponsored by: Intel Notes: svn path=/releng/10.2/; revision=285921
* MFC r281283:Jim Harris2015-05-145-252/+10
| | | | | | | | | | | | nvme: remove CHATHAM related code Chatham was an internal NVMe prototype board used for early driver development. Sponsored by: Intel Notes: svn path=/stable/10/; revision=282926
* MFC r281282:Jim Harris2015-05-141-10/+38
| | | | | | | | | nvme: add device strings for Intel DC series NVMe SSDs Sponsored by: Intel Notes: svn path=/stable/10/; revision=282925
* MFC r281281, r281285:Jim Harris2015-05-142-9/+41
| | | | | | | | | | | | | | nvme: create separate DMA tag for non-payload DMA buffers Submission and completion queue memory need to use a separate DMA tag for mappings than payload buffers, to ensure mappings remain contiguous even with DMAR enabled. Sponsored by: Intel Notes: svn path=/stable/10/; revision=282924
* MFC r281280:Jim Harris2015-05-141-1/+9
| | | | | | | | | | | | | | nvme: fall back to a smaller MSI-X vector allocation if necessary Previously, if per-CPU MSI-X vectors could not be allocated, nvme(4) would fall back to INTx with a single I/O queue pair. This change will still fall back to a single I/O queue pair, but allocate MSI-X vectors instead of reverting to INTx. Sponsored by: Intel Notes: svn path=/stable/10/; revision=282923
* MFC r267342:Jim Harris2014-06-181-1/+1
| | | | | | | | | | Use bitwise OR instead of logical OR when constructing value for SET_FEATURES/NUMBER_OF_QUEUES command. Sponsored by: Intel Notes: svn path=/stable/10/; revision=267620
* MFC r263311:Jim Harris2014-05-073-7/+44
| | | | | | | | nvme: Allocate all MSI resources up front so that we can fall back to INTx if necessary. Notes: svn path=/stable/10/; revision=265577
* MFC r263310:Jim Harris2014-05-073-29/+73
| | | | | | | | nvme: Close hole where nvd(4) would not be notified of all nvme(4) instances if modules loaded during boot. Notes: svn path=/stable/10/; revision=265576
* MFC r263278:Jim Harris2014-05-071-1/+2
| | | | | | | nvme: NVMe specification dictates 4-byte alignment for PRPs (not 8). Notes: svn path=/stable/10/; revision=265573
* MFC r263277:Jim Harris2014-05-071-10/+0
| | | | | | | | | | | | | nvme: Remove the software progress marker SET_FEATURE command during 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. Notes: svn path=/stable/10/; revision=265572
* MFC r260382:Jim Harris2014-05-071-2/+23
| | | | | | | | | | | | For IDENTIFY passthrough commands to Chatham prototype controllers, copy 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. Notes: svn path=/stable/10/; revision=265569
* MFC r257534:Jim Harris2013-11-052-4/+11
| | | | | | | | | | Create a unique unit number for each controller and namespace cdev. Sponsored by: Intel Approved by: re (glebius) Notes: svn path=/stable/10/; revision=257707
* Fix the LINT build.Jim Harris2013-10-081-0/+1
| | | | | | | | Approved by: re (implicit) MFC after: 1 week Notes: svn path=/head/; revision=256169
* Do not leak resources during attach if nvme_ctrlr_construct() or the initialJim Harris2013-10-081-3/+9
| | | | | | | | | | | | controller resets fail. Sponsored by: Intel Reviewed by: carl Approved by: re (hrs) MFC after: 1 week Notes: svn path=/head/; revision=256155
* Log and then disable asynchronous notification of persistent events afterJim Harris2013-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 Notes: svn path=/head/; revision=256154
* Do not enable temperature threshold as an asynchronous event notificationJim Harris2013-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 Notes: svn path=/head/; revision=256153
* Extend some 32-bit fields and variables to 64-bit to prevent overflowJim Harris2013-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 Notes: svn path=/head/; revision=256152
* Add driver-assisted striping for upcoming Intel NVMe controllers that canJim Harris2013-10-083-1/+225
| | | | | | | | | | | | benefit from it. Sponsored by: Intel Reviewed by: kib (earlier version), carl Approved by: re (hrs) MFC after: 1 week Notes: svn path=/head/; revision=256151
* Change the way that unmapped I/O capability is advertised.Kenneth D. Merry2013-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 Notes: svn path=/head/; revision=254389
* If a controller fails to initialize, do not notify consumers (nvd) of itsJim Harris2013-08-131-0/+9
| | | | | | | | | | | namespaces. Sponsoredy by: Intel Reviewed by: carl MFC after: 3 days Notes: svn path=/head/; revision=254303
* Send a shutdown notification in the driver unload path, to ensureJim Harris2013-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 Notes: svn path=/head/; revision=254302
* Add message when nvd disks are attached and detached.Jim Harris2013-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 Notes: svn path=/head/; revision=253476
* Fix nvme(4) and nvd(4) to support non 512-byte sector sizes.Jim Harris2013-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 Notes: svn path=/head/; revision=253474
* Use pause() instead of DELAY() when polling for completion of adminJim Harris2013-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 Notes: svn path=/head/; revision=253438
* Define constants for the lengths of the serial number, model numberJim Harris2013-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 Notes: svn path=/head/; revision=253437
* Fix a poorly worded comment in nvme(4).Jim Harris2013-07-111-3/+3
| | | | | | | MFC after: 3 days Notes: svn path=/head/; revision=253209
* Add comment explaining why CACHE_LINE_SIZE is defined in nvme_private.hJim Harris2013-07-091-0/+4
| | | | | | | | | | if not already defined elsewhere. Requested by: attilio MFC after: 3 days Notes: svn path=/head/; revision=253113
* Update copyright dates.Jim Harris2013-07-099-9/+9
| | | | | | | MFC after: 3 days Notes: svn path=/head/; revision=253112
* Do not retry failed async event requests.Jim Harris2013-07-091-5/+5
| | | | | | | | Sponsored by: Intel MFC after: 3 days Notes: svn path=/head/; revision=253108
* Add pci_enable_busmaster() and pci_disable_busmaster() calls inJim Harris2013-07-091-0/+3
| | | | | | | | | | nvme_attach() and nvme_detach() respectively. Sponsored by: Intel MFC after: 3 days Notes: svn path=/head/; revision=253107
* Add firmware replacement and activation support to nvmecontrol(8) throughJim Harris2013-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 Notes: svn path=/head/; revision=252278
* Remove remaining uio-related code.Jim Harris2013-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 Notes: svn path=/head/; revision=252273
* Fail any passthrough command whose transfer size exceeds the controller'sJim Harris2013-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 Notes: svn path=/head/; revision=252272
* Use MAXPHYS to specify the maximum I/O size for nvme(4).Jim Harris2013-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 Notes: svn path=/head/; revision=252271
* Remove the NVME_IDENTIFY_CONTROLLER and NVME_IDENTIFY_NAMESPACE IOCTLs and ↵Jim Harris2013-04-123-50/+5
| | | | | | | | | | | replace them with the NVMe passthrough equivalent. Sponsored by: Intel Notes: svn path=/head/; revision=249422
* Add support for passthrough NVMe commands.Jim Harris2013-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 Notes: svn path=/head/; revision=249421
* Move the busdma mapping functions to nvme_qpair.c.Jim Harris2013-04-124-84/+45
| | | | | | | | | This removes nvme_uio.c completely. Sponsored by: Intel Notes: svn path=/head/; revision=249420
* Remove the NVMe-specific physio and associated routines.Jim Harris2013-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 Notes: svn path=/head/; revision=249419
* Add a mutex to each namespace, for general locking operations on the namespace.Jim Harris2013-04-122-0/+12
| | | | | | | Sponsored by: Intel Notes: svn path=/head/; revision=249418
* Rename the controller's fail_req_lock, so that it can be used for otherJim Harris2013-04-122-7/+8
| | | | | | | | | locking operations on the controller. Sponsored by: Intel Notes: svn path=/head/; revision=249417
* Do not panic when a busdma mapping operation fails.Jim Harris2013-04-122-5/+28
| | | | | | | | | | Instead, print an error message and fail the associated command with DATA_TRANSFER_ERROR NVMe completion status. Sponsored by: Intel Notes: svn path=/head/; revision=249416
* Add unmapped bio support to nvme(4) and nvd(4).Jim Harris2013-04-015-10/+114
| | | | | | | Sponsored by: Intel Notes: svn path=/head/; revision=248977
* Add "type" to nvme_request, signifying if its payload is a VADDR, UIO, orJim Harris2013-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 Notes: svn path=/head/; revision=248913
* Remove obsolete comment. This code has now been tested with the QEMUJim Harris2013-03-281-4/+0
| | | | | | | NVMe device emulator. Notes: svn path=/head/; revision=248835
* Delete extra IO qpairs allocated based on number of MSI-X vectors, butJim Harris2013-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 Notes: svn path=/head/; revision=248834
* Fix printf format issue on i386.Jim Harris2013-03-271-2/+3
| | | | | | | Reported by: bz Notes: svn path=/head/; revision=248780
* Clean up debug prints.Jim Harris2013-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 Notes: svn path=/head/; revision=248773
* Move common code from the different nvme_allocate_request functions into aJim Harris2013-03-261-18/+21
| | | | | | | | | | | separate function. Sponsored by: Intel Suggested by: carl Reviewed by: carl Notes: svn path=/head/; revision=248771
* Change a number of malloc(9) calls to use M_WAITOK instead ofJim Harris2013-03-264-20/+10
| | | | | | | | | | | M_NOWAIT. Sponsored by: Intel Suggested by: carl Reviewed by: carl Notes: svn path=/head/; revision=248770