summaryrefslogtreecommitdiffstats
path: root/sys/dev/nvme/nvme_private.h
Commit message (Collapse)AuthorAgeFilesLines
* MFC r293328:jimharris2016-01-111-0/+1
| | | | | | | | | | nvme: do not revert to single I/O queue when per-CPU queues not available Previously nvme(4) would revert to a single I/O queue if it could not allocate enought interrupt vectors or NVMe submission/completion queues to have one I/O queue per core. This patch determines how to utilize a smaller number of available interrupt vectors, and assigns (as closely as possible) an equal number of cores to each associated I/O queue.
* MFC r293326:jimharris2016-01-111-2/+0
| | | | | | | nvme: do not pre-allocate MSI-X IRQ resources The issue referenced here was resolved by other changes in recent commits, so this code is no longer needed.
* MFC r293325:jimharris2016-01-111-1/+0
| | | | | | | | | | nvme: remove per_cpu_io_queues from struct nvme_controller Instead just use num_io_queues to make this determination. This prepares for some future changes enabling use of multiple queues when we do not have enough queues or MSI-X vectors for one queue per CPU.
* MFC r281283:jimharris2015-05-141-35/+0
| | | | | | | | | nvme: remove CHATHAM related code Chatham was an internal NVMe prototype board used for early driver development. Sponsored by: Intel
* MFC r281281, r281285:jimharris2015-05-141-0/+3
| | | | | | | | | | | 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
* MFC r263311:jimharris2014-05-071-0/+2
| | | | | nvme: Allocate all MSI resources up front so that we can fall back to INTx if necessary.
* MFC r263310:jimharris2014-05-071-2/+5
| | | | | nvme: Close hole where nvd(4) would not be notified of all nvme(4) instances if modules loaded during boot.
* Log and then disable asynchronous notification of persistent events afterjimharris2013-10-081-0/+3
| | | | | | | | | | | | | | | | | | | | | 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
* Add driver-assisted striping for upcoming Intel NVMe controllers that canjimharris2013-10-081-0/+1
| | | | | | | | | benefit from it. Sponsored by: Intel Reviewed by: kib (earlier version), carl Approved by: re (hrs) MFC after: 1 week
* Send a shutdown notification in the driver unload path, to ensurejimharris2013-08-131-0/+1
| | | | | | | | | notification gets sent in cases where system shuts down with driver unloaded. Sponsored by: Intel Reviewed by: carl 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-091-1/+1
| | | | MFC after: 3 days
* Remove remaining uio-related code.jimharris2013-06-261-16/+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
* Use MAXPHYS to specify the maximum I/O size for nvme(4).jimharris2013-06-261-5/+2
| | | | | | | | | | | 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
* Move the busdma mapping functions to nvme_qpair.c.jimharris2013-04-121-4/+0
| | | | | | This removes nvme_uio.c completely. Sponsored by: Intel
* Add a mutex to each namespace, for general locking operations on the namespace.jimharris2013-04-121-0/+1
| | | | Sponsored by: Intel
* Rename the controller's fail_req_lock, so that it can be used for otherjimharris2013-04-121-1/+2
| | | | | | locking operations on the controller. Sponsored by: Intel
* Add unmapped bio support to nvme(4) and nvd(4).jimharris2013-04-011-0/+34
| | | | Sponsored by: Intel
* Add "type" to nvme_request, signifying if its payload is a VADDR, UIO, orjimharris2013-03-291-7/+28
| | | | | | | NULL. This simplifies decisions around if/how requests are routed through busdma. It also paves the way for supporting unmapped bios. Sponsored by: Intel
* Clean up debug prints.jimharris2013-03-261-0/+4
| | | | | | | | | 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
* Replace usages of mtx_pool_find used for admin commands with a pollingjimharris2013-03-261-0/+7
| | | | | | | | | | | | | | | 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
* Add the ability to internally mark a controller as failed, if it is unable tojimharris2013-03-261-1/+16
| | | | | | | | | | | | | | | 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
* Remove the is_started flag from struct nvme_controller.jimharris2013-03-261-4/+1
| | | | | | | | | | 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
* Ensure the controller's MDTS is accounted for in max_xfer_size.jimharris2013-03-261-0/+3
| | | | | | | | | | The controller's IDENTIFY data contains MDTS (Max Data Transfer Size) to allow the controller to specify the maximum I/O data transfer size. nvme(4) already provides a default maximum, but make sure it does not exceed what MDTS reports. Sponsored by: Intel Reviewed by: carl
* Cap the number of retry attempts to a configurable number. This ensuresjimharris2013-03-261-1/+6
| | | | | | | | | that if a specific I/O repeatedly times out, we don't retry it indefinitely. The default number of retries will be 4, but is adjusted using hw.nvme.retry_count. Sponsored by: Intel Reviewed by: carl
* Pass associated log page data to async event consumers, if requested.jimharris2013-03-261-1/+4
| | | | | Sponsored by: Intel Reviewed by: carl
* When an asynchronous event request is completed, automatically fetch thejimharris2013-03-261-0/+6
| | | | | | | | | | specified log page. This satisfies the spec condition that future async events of the same type will not be sent until the associated log page is fetched. Sponsored by: Intel Reviewed by: carl
* Add structure definitions and controller command function for firmwarejimharris2013-03-261-0/+4
| | | | | | | log pages. Sponsored by: Intel Reviewed by: carl
* Add structure definitions and a controller command function forjimharris2013-03-261-0/+5
| | | | | | | error log pages. Sponsored by: Intel Reviewed by: carl
* Make nvme_ctrlr_reset a nop if a reset is already in progress.jimharris2013-03-261-1/+3
| | | | | | | | | | | | | This protects against cases where a controller crashes with multiple I/O outstanding, each timing out and requesting controller resets simultaneously. While here, remove a debugging printf from a previous commit, and add more logging around I/O that need to be resubmitted after a controller reset. Sponsored by: Intel Reviewed by: carl
* By default, always escalate to controller reset when an I/O times out.jimharris2013-03-261-1/+2
| | | | | | | | | | While aborts are typically cleaner than a full controller reset, many times an I/O timeout indicates other controller-level issues where aborts may not work. NVMe drivers for other operating systems are also defaulting to controller reset rather than aborts for timed out I/O. Sponsored by: Intel Reviewed by: carl
* Add a tunable for the I/O timeout interval. Default is still 30 seconds,jimharris2013-03-261-4/+9
| | | | | | | but can be adjusted between a min/max of 5 and 120 seconds. Sponsored by: Intel Reviewed by: carl
* Add handling for controller fatal status (csts.cfs).jimharris2013-03-261-0/+3
| | | | | | | | | | | | | On any I/O timeout, check for csts.cfs==1. If set, the controller is reporting fatal status and we reset the controller immediately, rather than trying to abort the timed out command. This changeset also includes deferring the controller start portion of the reset to a separate task. This ensures we are always performing a controller start operation from a consistent context. Sponsored by: Intel Reviewed by: carl
* Add controller reset capability to nvme(4) and ability to explicitlyjimharris2013-03-261-6/+12
| | | | | | | | | | | | | | invoke it from nvmecontrol(8). Controller reset will be performed in cases where I/O are repeatedly timing out, the controller reports an unrecoverable condition, or when explicitly requested via IOCTL or an nvme consumer. Since the controller may be in such a state where it cannot even process queue deletion requests, we will perform a controller reset without trying to clean up anything on the controller first. Sponsored by: Intel Reviewed by: carl
* Keep a doubly-linked list of outstanding trackers.jimharris2013-03-261-2/+3
| | | | | | This enables in-order re-submission of I/O after a controller reset. Sponsored by: Intel
* Expose the get/set features API to nvme consumers.jimharris2013-03-261-8/+0
| | | | Sponsored by: Intel
* Add an interface for nvme shim drivers (i.e. nvd) to register forjimharris2013-03-261-0/+6
| | | | | | notifications when new nvme controllers are added to the system. Sponsored by: Intel
* Enable asynchronous event requests on non-Chatham devices.jimharris2013-03-261-7/+16
| | | | | | | | Also add logic to clean up all outstanding asynchronous event requests when resetting or shutting down the controller, since these requests will not be explicitly completed by the controller itself. Sponsored by: Intel
* Move controller destruction code from nvme_detach() to new nvme_ctrlr_destruct()jimharris2013-03-261-0/+1
| | | | | | function. Sponsored by: Intel
* Specify command timeout interval on a per-command type basis.jimharris2013-03-261-0/+3
| | | | | | | This is primarily driven by the need to disable timeouts for asynchronous event requests, which by nature should not be timed out. Sponsored by: Intel
* Add support for ABORT commands, including issuing these commands whenjimharris2013-03-261-0/+2
| | | | | | | | an I/O times out. Also ensure that we retry commands that are aborted due to a timeout. Sponsored by: Intel
* Map BAR 4/5, because NVMe spec says devices may place the MSI-X tablejimharris2012-12-181-0/+8
| | | | | | behind BAR 4/5, rather than in BAR 0/1 with the control/doorbell registers. Sponsored by: Intel
* Do not use taskqueue to defer completion work when using INTx. INTx nowjimharris2012-12-181-3/+0
| | | | | | matches MSI-X behavior. Sponsored by: Intel
* Add PCI device ID for 8-channel IDT NVMe controller, and clarify that thejimharris2012-12-061-1/+2
| | | | | | previously defined IDT PCI device ID was for a 32-channel controller. Submitted by: Joe Golio <joseph.golio@isilon.com>
* Add ability to queue nvme_request objects if no nvme_trackers are available.jimharris2012-10-181-1/+2
| | | | | | | | | This eliminates the need to manage queue depth at the nvd(4) level for Chatham prototype board workarounds, and also adds the ability to accept a number of requests on a single qpair that is much larger than the number of trackers allocated. Sponsored by: Intel
* Preallocate a limited number of nvme_tracker objects per qpair, ratherjimharris2012-10-181-7/+16
| | | | | | than dynamically creating them at runtime. Sponsored by: Intel
* Create nvme_qpair_submit_request() which eliminates all of the codejimharris2012-10-181-0/+2
| | | | | | | duplication between the admin and io controller-level submit functions. Sponsored by: Intel
* Cleanup uio-related code to use struct nvme_request andjimharris2012-10-181-0/+19
| | | | | | | | | | | | nvme_ctrlr_submit_io_request(). While here, also fix case where a uio may have more than 1 iovec. NVMe's definition of SGEs (called PRPs) only allows for the first SGE to start on a non-page boundary. The simplest way to handle this is to construct a temporary uio for each iovec, and submit an NVMe request for each. Sponsored by: Intel
* Add nvme_ctrlr_submit_[admin|io]_request functions which consolidatesjimharris2012-10-181-3/+4
| | | | | | | code for allocating nvme_tracker objects and making calls into bus_dmamap_load for commands which have payloads. Sponsored by: Intel
OpenPOWER on IntegriCloud