summaryrefslogtreecommitdiffstats
path: root/sys/dev/nvd/nvd.c
Commit message (Collapse)AuthorAgeFilesLines
* MFC r295022:jimharris2016-02-171-1/+17
| | | | | | | | | | | | | | | | | nvd: add hw.nvd.delete_max tunable The NVMe specification does not define a maximum or optimal delete size, so technically max delete size is min(full size of namespace, 2^32 - 1 LBAs). A single delete operation for a multi-TB NVMe namespace though may take much longer to complete than the nvme(4) I/O timeout period. So choose a sensible default here that is still suitably large to minimize the number of overall delete operations. This also fixes possible uint32_t overflow on initial TRIM operation for zpool create operations for NVMe namespaces with >4G LBAs. Approved by: re (glebius) Sponsored by: Intel
* MFC r292074:smh2016-01-251-1/+1
| | | | | | Limit stripesize reported from nvd(4) to 4K Sponsored by: Multiplay
* MFC r293323:jimharris2016-01-111-0/+18
| | | | | | | | | nvd: submit bios directly when BIO_ORDERED not set or in flight This significantly improves parallelism in the most common case. The taskqueue is still used whenever BIO_ORDERED bios are in flight. This patch is based heavily on a patch from gallatin@.
* MFC r293322:jimharris2016-01-111-12/+23
| | | | | | | nvd: break out submission logic into separate function This enables a future patch using this same logic to submit I/O directly bypassing the taskqueue.
* MFC r293321:jimharris2016-01-111-0/+1
| | | | | | | | nvd: skip BIO_ORDERED logic when bio fails submission This ensures the bio flags are not read after biodone(). The ordering will still be enforced, after the bio is submitted successfully.
* MFC r293320:jimharris2016-01-111-13/+0
| | | | | | | nvd: do not wait for previous bios before submitting ordered bio Still wait until all in-flight bios (including the ordered bio) complete before processing more bios from the queue.
* MFC r293319:jimharris2016-01-111-1/+1
| | | | nvd: set DISKFLAG_DIRECT_COMPLETION
* MFC r290199:jimharris2015-11-231-0/+1
| | | | | | nvd, nvme: report stripesize through GEOM disk layer Sponsored by: Intel
* MFC r285767:jimharris2015-07-271-0/+1
| | | | | | | | | | | | | | | | nvd: set d_delmaxsize to full capacity of NVMe namespace The NVMe specification has no ability to specify a maximum delete size that is less than the full capacity of the namespace - so just using the namespace size is the correct value here. This fixes reported issues where ZFS trim on init looked like it was hanging the system - previously the default I/O max size (128KB on Intel NVMe controllers) was used for delete operations which worked out to only about 8MB/s. With this patch I can add an 800GB DC P3700 drive to a ZFS pool in about 15-20 seconds. Sponsored by: Intel
* Add driver-assisted striping for upcoming Intel NVMe controllers that canjimharris2013-10-081-11/+0
| | | | | | | | | benefit from it. Sponsored by: Intel Reviewed by: kib (earlier version), carl Approved by: re (hrs) MFC after: 1 week
* Add message when nvd disks are attached and detached.jimharris2013-07-191-8/+29
| | | | | | | | | | | | 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
* Do not call disk_create() until we have completed all initialization of ourjimharris2013-07-191-2/+2
| | | | | | | | internal disk structure. Sponsored by: Intel Reviewed by: carl MFC after: 3 days
* Define constants for the lengths of the serial number, model numberjimharris2013-07-171-2/+6
| | | | | | | | | | | 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
* Update copyright dates.jimharris2013-07-091-1/+1
| | | | MFC after: 3 days
* Add unmapped bio support to nvme(4) and nvd(4).jimharris2013-04-011-0/+5
| | | | Sponsored by: Intel
* Change a number of malloc(9) calls to use M_WAITOK instead ofjimharris2013-03-261-2/+2
| | | | | | | | M_NOWAIT. Sponsored by: Intel Suggested by: carl Reviewed by: carl
* Add the ability to internally mark a controller as failed, if it is unable tojimharris2013-03-261-1/+21
| | | | | | | | | | | | | | | 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
* Have nvd(4) register for controller notifications.jimharris2013-03-261-17/+54
| | | | | | | Also have nvd maintain controller/namespace relationships internally. Sponsored by: Intel Reviewed by: carl
* Create struct nvme_status.jimharris2013-03-261-2/+2
| | | | | | | | | | | | | | NVMe error log entries include status, so breaking this out into its own data structure allows it to be included in both the nvme_completion data structure as well as error log entry data structures. While here, expose nvme_completion_is_error(), and change all of the places that were explicitly looking at sc/sct bits to use this macro instead. Sponsored by: Intel Reviewed by: carl
* Add an interface for nvme shim drivers (i.e. nvd) to register forjimharris2013-03-261-4/+6
| | | | | | notifications when new nvme controllers are added to the system. Sponsored by: Intel
* Add ability to queue nvme_request objects if no nvme_trackers are available.jimharris2012-10-181-19/+3
| | | | | | | | | 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
* Add return codes to all functions used for submitting commands to I/Ojimharris2012-10-181-1/+13
| | | | | | queues. Sponsored by: Intel
* Revert previous commit...kevlo2012-10-101-1/+1
| | | | Pointyhat to: kevlo (myself)
* Prefer NULL over 0 for pointerskevlo2012-10-091-1/+1
|
* This is the first of several commits which will add NVM Express (NVMe)jimharris2012-09-171-0/+318
support to FreeBSD. A full description of the overall functionality being added is below. nvmexpress.org defines NVM Express as "an optimized register interface, command set and feature set fo PCI Express (PCIe)-based Solid-State Drives (SSDs)." This commit adds nvme(4) and nvd(4) driver source code and Makefiles to the tree. Full NVMe functionality description: Add nvme(4) and nvd(4) drivers and nvmecontrol(8) for NVM Express (NVMe) device support. There will continue to be ongoing work on NVM Express support, but there is more than enough to allow for evaluation of pre-production NVM Express devices as well as soliciting feedback. Questions and feedback are welcome. nvme(4) implements NVMe hardware abstraction and is a provider of NVMe namespaces. The closest equivalent of an NVMe namespace is a SCSI LUN. nvd(4) is an NVMe consumer, surfacing NVMe namespaces as GEOM disks. nvmecontrol(8) is used for NVMe configuration and management. The following are currently supported: nvme(4) - full mandatory NVM command set support - per-CPU IO queues (enabled by default but configurable) - per-queue sysctls for statistics and full command/completion queue dumps for debugging - registration API for NVMe namespace consumers - I/O error handling (except for timeoutsee below) - compilation switches for support back to stable-7 nvd(4) - BIO_DELETE and BIO_FLUSH (if supported by controller) - proper BIO_ORDERED handling nvmecontrol(8) - devlist: list NVMe controllers and their namespaces - identify: display controller or namespace identify data in human-readable or hex format - perftest: quick and dirty performance test to measure raw performance of NVMe device without userspace/physio/GEOM overhead The following are still work in progress and will be completed over the next 3-6 months in rough priority order: - complete man pages - firmware download and activation - asynchronous error requests - command timeout error handling - controller resets - nvmecontrol(8) log page retrieval This has been primarily tested on amd64, with light testing on i386. I would be happy to provide assistance to anyone interested in porting this to other architectures, but am not currently planning to do this work myself. Big-endian and dmamap sync for command/completion queues are the main areas that would need to be addressed. The nvme(4) driver currently has references to Chatham, which is an Intel-developed prototype board which is not fully spec compliant. These references will all be removed over time. Sponsored by: Intel Contributions from: Joe Golio/EMC <joseph dot golio at emc dot com>
OpenPOWER on IntegriCloud