367145 |
29-Oct-2020 |
brooks |
MFC r366911:
vmapbuf: don't smuggle address or length in buf
Instead, add arguments to vmapbuf. Since this argument is always a pointer use a type of void * and cast to vm_offset_t in vmapbuf. (In CheriBSD we've altered vm_fault_quick_hold_pages to take a pointer and check its bounds.)
In no other situtation does b_data contain a user pointer and vmapbuf replaces b_data with the actual mapping.
Suggested by: jhb Reviewed by: imp, jhb Obtained from: CheriBSD Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D26784 |
355092 |
25-Nov-2019 |
mav |
MFC r344955 (by imp): Don't print all the I/O we abort on a reset, unless we're out of retries.
When resetting the controller, we abort I/O. Prior to this fix, we printed a ton of abort messages for I/O that we're going to retry. This imparts no useful information. Stop printing them unless our retry count is exhausted. Clarify code for when we don't retry, and remove useless arg to a routine that's always called with it as 'true'. All the other debug is still printed (including multiple reset messages if we have multiple timeouts before the taskqueue runs the actual reset) so that we know when we reset. |
355091 |
25-Nov-2019 |
mav |
MFC r341710 (by imp): Even though they are reserved, cdw2 and cdw3 can be set via nvme-cli (and soon nvmecontrol). Go ahead and copy them into rsvd2 and rsvd3. |
351588 |
28-Aug-2019 |
mav |
MFC r351352: Improve NVMe hot unplug handling.
If device is unplugged from the system (CSTS register reads return 0xffffffff), it makes no sense to send any more recovery requests or expect any responses back. If there is a detach call in such state, just stop all activity and free resources. If there is no detach call (hot-plug is not supported), rely on normal timeout handling, but when it trigger controller reset, do not wait for impossible and quickly report failure.
Sponsored by: iXsystems, Inc. |
351586 |
28-Aug-2019 |
mav |
MFC r351320: Formalize NVMe controller consumer life cycle.
This fixes possible double call of fail_fn, for example on hot removal. It also allows ctrlr_fn to safely return NULL cookie in case of failure and not get useless ns_fn or fail_fn call with NULL cookie later. |
350996 |
13-Aug-2019 |
mav |
MFC kernel part of r350523, r350524, r350961: Add IOCTL to translate nvdX into nvmeY and NSID.
While very useful by itself, it also makes `nvmecontrol` not depend on hardcoded device names parsing, that in its turn makes simple to take nvdX (and potentially any other) device names as arguments.
Also added IOCTL bypass from nvdX to respective nvmeYnsZ makes them interchangeable for management purposes. |
346249 |
15-Apr-2019 |
mav |
MFC r330760: Add new opcodes and statuses from NVMe 1.3a. |
346246 |
15-Apr-2019 |
mav |
MFC part of r334200: - Add missing nvme_notify_fail_consumers() call on controller detach.
With nvd(4) driver fixes merged it should now handle detach properly. The rest of r334200 seems too invasive and depending to be MFC'd. |
346245 |
15-Apr-2019 |
mav |
MFC r344736 (by imp): Add ABORTED_BY_REQUEST to the list of things we look at DNR bit and tell why to comment (code already does this) |
346244 |
15-Apr-2019 |
mav |
MFC r344642 (by imp): Unconditionally support unmapped BIOs. This was another shim for supporting older kernels. However, all supported versions of FreeBSD have unmapped I/Os (as do several that have gone EOL), remove it. It's unlikely the driver would work on the older kernels anyway at this point. |
346243 |
15-Apr-2019 |
mav |
MFC r344640 (by imp): Remove #ifdef code to support FreeBSD versions that haven't been supported in years. A number of changes have been made to the driver that likely wouldn't work on those older versions that aren't properly ifdef'd and it's project policy to GC such code once it is stale. |
346242 |
15-Apr-2019 |
mav |
MFC r342862 (by chuck): Add NVMe drive to NOIOB quirk list
Dell-branded Intel P4600 NVMe drives benefit from NVMe 1.3's NOIOB feature. Unfortunately just like Intel DC P4500s, they don't advertise themselves as benefiting from this...
This changes adds P4600s to the existing list of old drives which benefit from striping. |
346241 |
15-Apr-2019 |
mav |
MFC r340481 (by imp): Remove do-nothing nvme_modevent.
nvme_modevent no longer does anything interesting, remove it. |
346240 |
15-Apr-2019 |
mav |
MFC r340412: Use atomic_load_acq_int() here too to poll done, ala r328521 |
346239 |
15-Apr-2019 |
mav |
MFC r339775: Put a workaround in for command timeout malfunctioning
At least one NVMe drive has a bug that makeing the Command Time Out PCIe feature unreliable. The workaround is to disable this feature. The driver wouldn't deal correctly with a timeout anyway. Only do this for drives that are known bad. |
346238 |
15-Apr-2019 |
mav |
MFC r337273 (by jhibbits): nvme(4): Add bus_dmamap_sync() at the end of the request path
Summary: Some architectures, in this case powerpc64, need explicit synchronization barriers vs device accesses.
Prior to this change, when running 'make buildworld -j72' on a 18-core (72-thread) POWER9, I would see controller resets often. With this change, I don't see these resets messages, though another tester still does, for yet to be determined reasons, so this may not be a complete fix. Additionally, I see a ~5-10% speed up in buildworld times, likely due to not needing to reset the controller. |
343332 |
23-Jan-2019 |
mav |
MFC r342546: Add descriptions to NVMe interrupts. |
335166 |
14-Jun-2018 |
mav |
MFC r325794, r325838 (by imp): Provide link speed data in XPT_GET_TRAN_SETTINGS. Provide full version information for that and XPT_PATH_INQ. Provide macros to encode/decode major/minor versions. Read the link speed and lane count to compute the base_transfer_speed for XPT_PATH_INQ. |
335155 |
14-Jun-2018 |
mav |
MFC r333180: Fix LOR between controller and queue locks.
Admin pass-through requests took controller lock before the queue lock, but in case of request submission to a failed controller controller lock was taken after the queue lock. Fix that by reducing the lock scopes and switching to mtx_pool locks to track pass-through request completion. |
335153 |
14-Jun-2018 |
mav |
MFC r333130: Improve nvme(4) attach/detach sequences.
This change allows clean device detach on attach failures and driver unload, while previous code tried to talk to already shut down controller, or even accessed resources failed to allocate. |
335152 |
14-Jun-2018 |
mav |
MFC r333127: Fix use-after-free in nvme_qpair_destroy().
dma_tag_payload should not be destroyed before payload_dma_map, and seems it should be used there instead of dma_tag to match creation. |
335151 |
14-Jun-2018 |
mav |
MFC r332897 (by imp), r333123: Migrate to make_dev_s interface to populate /dev/nvmeX entries |
335150 |
14-Jun-2018 |
mav |
MFC r331046 (by imp): Try polling the qpairs on timeout.
On some systems, we're getting timeouts when we use multiple queues on drives that work perfectly well on other systems. On a hunch, Jim Harris suggested I poll the completion queue when we get a timeout. This patch polls the completion queue if no fatal status was indicated. If it had pending I/O, we complete that request and return. Otherwise, if aborts are enabled and no fatal status, we abort the command and return. Otherwise we reset the card.
This may clear up the problem, or we may see it result in lots of timeouts and a performance problem. Either way, we'll know the next step. We may also need to pay attention to the fatal status bit of the controller. |
335149 |
14-Jun-2018 |
mav |
MFC r330954, r330955 (by imp): When tearing down a queue pair, also delete the queue entries.
The NVME standard has required in section 7.2.6, since at least 1.1, that a clean shutdown is signalled by deleting the subission and the completion queues before setting the shutdown bit in CC. The 1.0 standard, apparently, did not and many of the early Intel cards didn't care. Some newer cards care, at least one whose beta firmware can scramble the card on an unclean shutdown. Linux has done this for some time. To make it possible to move forward with an evaluation of this pre-release card with wonky firmware, delete the queues on the card when we delete the qpair structures. |
335143 |
14-Jun-2018 |
mav |
MFC r330953 (by imp): Don't make the namespace devices eternal.
We'll need to delete namespaces soon, so go ahead and stop making these devices eternal. It doesn't help much, and will be getting in the way soon. |
335142 |
14-Jun-2018 |
mav |
MFC r328089 (by imp): Move setting of CAM_SIM_QUEUED to before we actually submit it to the hardware. Setting it after is racy, and we can lose the race on a heavily loaded system. |
335139 |
14-Jun-2018 |
mav |
MFC r313954 (by imp): Remove obsolete comment after prior rev. |
335138 |
14-Jun-2018 |
mav |
MFC r311351 (by rpokala): In the same vein as r311350, fix whitespace in handling of XPT_PATH_INQ in several more drivers. |
332824 |
20-Apr-2018 |
imp |
MFC r332780,r332783: Intel drives have an optimal alignment for I/O. While they honor I/Os that cross this boundary, they perform better when this isn't the case. Intel uses the 3rd byte in the vendor specific area for this. The DC P3500 was previously listed without any explanation. Add the DC P3520 and DC P4500 to the list.
There won't be any others drives needing this quirk. Intel has standardized a field in the namespace data in 1.3 (noiob). A future patch will use that if it exists, with fallback to this method.
Submitted by: Keith Busch Reviewed by: jimharris@ [[ plus tweak comments from 332783 ]]
Sponsored by: Netflix |
331722 |
29-Mar-2018 |
eadler |
Revert r330897:
This was intended to be a non-functional change. It wasn't. The commit message was thus wrong. In addition it broke arm, and merged crypto related code.
Revert with prejudice.
This revert skips files touched in r316370 since that commit was since MFCed. This revert also skips files that require $FreeBSD$ property changes.
Thank you to those who helped me get out of this mess including but not limited to gonzo, kevans, rgrimes.
Requested by: gjb (re) |
330897 |
14-Mar-2018 |
eadler |
Partial merge of the SPDX changes
These changes are incomplete but are making it difficult to determine what other changes can/should be merged.
No objections from: pfg |
330669 |
08-Mar-2018 |
mav |
MFC r328521 (by imp): Use atomic load and stores to ensure that the compiler doesn't optimize away these loops. Change boolean to int to match what atomic API supplies. Remove wmb() since the atomic_store_rel() on status.done ensure the prior writes to status. It also fixes the fact that there wasn't a rmb() before reading done. This should also be more efficient since wmb() is fairly heavy weight. |
328751 |
01-Feb-2018 |
mav |
MFC small part of r325794 to fix the build. |
328750 |
01-Feb-2018 |
mav |
MFC r327034 (by imp): Return domain, bus, slot, and function for the transport settings in PATH_INQ requests for nvme. |
328749 |
01-Feb-2018 |
mav |
MFC r326937, r326940 (by imp): When we're disabling the nvme device, some drives have a controller bug that requires 'hands off' for a period of time (2.3s) before we check the RDY bit. Sicne this is a very odd quirk for a very limited selection of drives, do this as a quirk. This prevented a successful reset of the card when the card wedged.
Also, make sure that we comply with the advice from section 3.1.5 of the 1.3 spec says that transitioning CC.EN from 0 to 1 when CSTS.RDY is 1 or transitioning CC.EN from 1 to 0 when CSTS.RDY is 0 "has undefined results". Short circuit when EN == RDY == desired state.
Finally, fail the reset if the disable fails. This will lead to a failed device, which is what we want. (note: nda device needs work for coping with a failed device). |
328703 |
01-Feb-2018 |
mav |
MFC r324644 (by imp): Closer examination shows that nvme and CAM both normally zero-fill allocations (for req and ccb, which ultimately contain the nvme_cmd). As such, we can micro-optimize these routines. Add a comment to this effect, and bzero the ccb used to make the requests for the nda dump rotuine so it more closely matches a ccb allocated with xpt_get_ccb(). |
328702 |
01-Feb-2018 |
mav |
MFC r324634 (by imp): Use nvme_ctrlr_poll instead of nvme_ctrlr_intx_handler since it is more general and doesn't try to access registers that may be undefined when the card is in MSIX mode.
This change, along with r324630, r324631, r324632, makes nda crash dumps work again. Previously, they only worked on CPU 0 when the stack garbage was just so. |
328701 |
01-Feb-2018 |
mav |
MFC r324633 (by imp): Create general polling function for the nvme controller. Use it when we're doing the various pin-based interrupt modes. Adjust nvme_ctrlr_intx_handler to use nvme_ctrlr_poll. |
328700 |
01-Feb-2018 |
mav |
MFC r324631 (by imp): Explicitly set reserved fields and 'fuse' to 0. This prevents us from acidentally sending bogus values in these fields, which some drives may reject with an error or worse (undefined behavior).
This is especially needed for the ndadump routine which allocates the cmd from stack garbage.... |
328699 |
01-Feb-2018 |
mav |
MFC r324075 (by imp): Tweak performance of nda completions
Use xpt_done_direct in preference to xpt_done when completing a successful I/O. Continue to use xpt_done when there's an error, or for completion of the submission of a CCB. This eliminates a context switch to the cam_doneq thread. |
328698 |
01-Feb-2018 |
mav |
MFC r323834 (by imp): Fix queue depth for nda.
1/4 of the number of queues times queue entries is too limiting. It works up to about 4k IOPS / 3.0GB/s for hardware that can do 4.4k/3.2GB/s with nvd. 3/4 works better, though it highlights issues in the fairness of nda's choice of TRIM vs READ. That will be fixed separately. |
328697 |
01-Feb-2018 |
mav |
MFC r322998 (by imp): Fix a few overlooked spots where the coded uses 16-bit NSIDs. Chuck Tuffli had submitted a more thorough patch that I was unaware of when I did my work and this brings in the bits I missed from that patch. |
328696 |
01-Feb-2018 |
mav |
MFC r322997: Add CAM/NVMe support for CAM_DATA_SG
This adds support in pass(4) for data to be described with a scatter-gather list (sglist) to augment the existing (single) virtual address. |
328692 |
01-Feb-2018 |
mav |
MFC r322995 (by imp): Add new compile-time option NVME_USE_NVD that sets the default value of the runtime hw.nvme.use_vnd tunable. We still default to nvd unless otherwise requested. |
328691 |
01-Feb-2018 |
mav |
MFC r322994: Set the max transactions for NVMe drives better.
Provided a better estimate for the number of transactions that can be pending at one time. This will be number of queues * number of trackers / 4, as suggested by Jim Harris. This gives a better estimate of the number of transactions that CAM should queue before applying back pressure. This should be revisted when we have real multi-queue support in CAM and the upper layers of the I/O stack. |
328690 |
01-Feb-2018 |
mav |
MFC r322903 (by imp): Fill in reserved areas from NVMe spec in the IDENTIFY structure (struct nvme_controller_data) as defined in the NVM Express specification, revsion 1.3. |
328689 |
01-Feb-2018 |
mav |
MFC r322902 (by imp): NVME Namespace ID is 32-bits, so widen interface to reflect that. |
328688 |
01-Feb-2018 |
mav |
MFC r322901 (by imp): Add feature codes from NVMe 1.3 specification:
o Automomous Power State Transition o Host Memory Buffer o Timestamp o Keep Alive Timer o Host Controlled Thermal Management o Non-Operational Power State Config
Also note that feature codes 0x78-0x7f are reserved for the NVMe Management Interface. |
328687 |
01-Feb-2018 |
mav |
MFC r322874, r322875 (by imp): Sanity check sizes
Add compile time sanity checks to make sure that packed structures are the proper size, typically as defined in the NVMe standard. |
328685 |
01-Feb-2018 |
mav |
MFC r322872 (by imp): Enable bus mastering on the device before resetting the device. The card has to do PCIe transactions to complete the reset process, but can't do them, per the PCIe spec, unless bus mastering is enabled. |
328684 |
01-Feb-2018 |
mav |
MFC r322443 (by nwhitehorn): Move NVME controller shutdown from being called as part of module unloading to being called through the newbus DEVICE_SHUTDOWN() path. This ensures that the NVME controller gets shut down before the device and bus disappear and prevents data corruption on shutdown on at least Samsung EVO 960 SSDs.
PR: kern/211852 |
328683 |
01-Feb-2018 |
mav |
MFC r322257 (by imp): Use the correct queue depth for nda devices. |
328681 |
01-Feb-2018 |
mav |
MFC r322036 (by imp): Make nvd vs nda choice boot-time rather than build-time
Introduce hw.nvme.use_nvd tunable. This tunable allows both nvd and nda to be installed in the kernel, while allowing only one of them to create devices. This is an all-or-nothing setting, and you can't change it after boot-time. However, it will allow easier A/B testing. |
328680 |
01-Feb-2018 |
mav |
MFC r320984 (by imp): This adds CAM pass(4) support for NVMe IO's. Applications indicate the IO type (Admin or NVM) using XPT op-codes XPT_NVME_ADMIN or XPT_NVME_IO. |
328678 |
01-Feb-2018 |
mav |
MFC r320424 (by imp): Add new definitions for namespaces. |
328677 |
01-Feb-2018 |
mav |
MFC r314889 (by imp): Avoid dereferencing unintialized elements in the error path.
Some drives sometimes have errors for things like setting the number of queue entries in the submission queue. The error paths taken for these drives ensure a panic dereferencing uninialized data. |
328676 |
01-Feb-2018 |
mav |
MFC r314884 (by imp): Make multi-namespace nvme drives more robust.
Fix assumptions about name spaces in NVME driver. First, it assumes cdata.nn is the number of configured devices. However, it is the number of supported name spaces. Second, it assumes that there will never be more than 16 name spaces supported, but a certain drive I'm testing reports 1024. It assumes that name spaces are a tightly packed namespace, but the standard seems to indicate otherwise. Finally, it assumes that an error would be generated when quearying an unconfigured namespace. Instead, it succeeds but the identify data is all zeros.
Fix these by limiting the number of name spaces we probe to 16. Remove aborting when we find one in error. When the size of the name space is zero, ignore it.
This is admittedly a bandaide. The long term fix will be to participate in the enumeration and name space change protocols definfed in the NVNe standard. |
328675 |
01-Feb-2018 |
mav |
MFC r313113 (by imp): Ensure that the passthrough request will fit in MAXPHYS bytes after it has been rounded to full pages. This avoids a panic in vm_fault_quick_hold_pages due to this off-by-one error passing one page too many into vmapbuf. |
328674 |
01-Feb-2018 |
mav |
MFC r308855 (by imp): Implement HGST Log page 0xc1, as documented in the HGST SN100 and SN150 product manuals. Subpage 0x32 is documented, but not implemented. |
328673 |
01-Feb-2018 |
mav |
MFC r308854 (by imp): Print Intel's expanded Temperature log page. |
328671 |
01-Feb-2018 |
mav |
MFC r308853 (by imp): Add log pages that Intel SSDs provide. It turns out that many of these are widely implemented beyond just Intel drives. |
328670 |
01-Feb-2018 |
mav |
MFC r308852 (by imp): Add log pages defined through NVM Express 1.2.1. |
328669 |
01-Feb-2018 |
mav |
MFC r308851 (by imp): Expand the SMART / Health Information Log Page (Page 02) printout based on NVM Express 1.2.1 Standard. |
328667 |
01-Feb-2018 |
mav |
MFC r308431 (by scottl): Convert the Q-Pair and PRP list memory allocations to use BUSDMA. Add a bunch of safery belts and error handling in related codepaths. |
328666 |
01-Feb-2018 |
mav |
MFC r303466: Kill a few stray debug printfs. |
328665 |
01-Feb-2018 |
mav |
MFC r303126 (by imp): Actually import nvme_sim so the CAM attachment for NVME (nda) actually works. |
328664 |
01-Feb-2018 |
mav |
MFC r303040, r303042 (by scottl): Supporting flushing the dump before returning, and simplify/combine the logic. Switch to a 5us delay since most NVME devices can easily do 200,000 iops. |
328663 |
01-Feb-2018 |
mav |
MFC r303017 (by imp): Implement crashdump support on NVME |
323262 |
07-Sep-2017 |
kib |
MFC r323054: The nvme module should explicitly declare dependency on the cam. |
323148 |
03-Sep-2017 |
des |
MFH (r314888): silence aliasing warning in nvme.h
Approved by: imp |
302408 |
08-Jul-2016 |
gjb |
Copy head@r302406 to stable/11 as part of the 11.0-RELEASE cycle. Prune svn:mergeinfo from the new branch, as nothing has been merged here.
Additional commits post-branch will follow.
Approved by: re (implicit) Sponsored by: The FreeBSD Foundation |
301778 |
10-Jun-2016 |
imp |
Commit the bits of nda that were missed. This should fix the build.
Approved by: re@
|
296617 |
10-Mar-2016 |
mav |
Revert r292074 (by smh): Limit stripesize reported from nvd(4) to 4K
I believe that this patch handled the problem from the wrong side. Instead of making ZFS properly handle large stripe sizes, it made unrelated driver to lie in reported parameters to workaround that.
Alternative solution for this problem from ZFS side was committed at r296615.
Discussed with: smh
|
295944 |
24-Feb-2016 |
jimharris |
nvme: fix intx handler to not dereference ioq during initialization
This was a regression from r293328, which deferred allocation of the controller's ioq array until after interrupts are enabled during boot.
PR: 207432 Reported and tested by: Andy Carrel <wac@google.com> MFC after: 3 days Sponsored by: Intel
|
295790 |
19-Feb-2016 |
jhibbits |
Replace several bus_alloc_resource() calls using default arguments with bus_alloc_resource_any()
Since these calls only use default arguments, bus_alloc_resource_any() is the right call.
Differential Revision: https://reviews.freebsd.org/D5306
|
295532 |
11-Feb-2016 |
jimharris |
nvme: avoid duplicate SET_NUM_QUEUES commands
nvme(4) issues a SET_NUM_QUEUES command during device initialization to ensure enough I/O queues exists for each of the MSI-X vectors we have allocated. The SET_NUM_QUEUES command is then issued again during nvme_ctrlr_start(), to ensure that is properly set after any controller reset.
At least one NVMe drive exists which fails this second SET_NUM_QUEUES command during device initialization. So change nvme_ctrlr_start() to only issue its SET_NUM_QUEUES command when it is coming out of a reset - avoiding the duplicate SET_NUM_QUEUES during device initialization.
Reported by: gallatin MFC after: 3 days Sponsored by: Intel
|
295087 |
30-Jan-2016 |
imp |
Implement power command to list all power modes, find out the power mode we're in and to set the power mode.
|
293354 |
07-Jan-2016 |
jimharris |
nvme: replace NVME_CEILING macro with howmany()
Suggested by: rpokala MFC after: 3 days
|
293352 |
07-Jan-2016 |
jimharris |
nvme: add hw.nvme.min_cpus_per_ioq tunable
Due to FreeBSD system-wide limits on number of MSI-X vectors (https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=199321), it may be desirable to allocate fewer than the maximum number of vectors for an NVMe device, in order to save vectors for other devices (usually Ethernet) that can take better advantage of them and may be probed after NVMe.
This tunable is expressed in terms of minimum number of CPUs per I/O queue instead of max number of queues per controller, to allow for a more even distribution of CPUs per queue. This avoids cases where some number of CPUs have a dedicated queue, but other CPUs need to share queues. Ideally the PR referenced above will eventually be fixed and the mechanism implemented here becomes obsolete anyways.
While here, fix a bug in the CPUs per I/O queue calculation to properly account for the admin queue's MSI-X vector.
Reviewed by: gallatin MFC after: 3 days Sponsored by: Intel
|
293328 |
07-Jan-2016 |
jimharris |
nvme: do not revert o single I/O queue when per-CPU queues not possible
Previously nvme(4) would revert to a signle 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 after: 3 days Sponsored by: Intel
|
293327 |
07-Jan-2016 |
jimharris |
nvme: break out interrupt setup code into a separate function
MFC after: 3 days Sponsored by: Intel
|
293326 |
07-Jan-2016 |
jimharris |
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 after: 3 days Sponsored by: Intel
|
293325 |
07-Jan-2016 |
jimharris |
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 after: 3 days Sponsored by: Intel
|
293324 |
07-Jan-2016 |
jimharris |
nvme: simplify some of the nested ifs in interrupt setup code
This prepares for some follow-up commits which do more work in this area.
MFC after: 3 days Sponsored by: Intel
|
292074 |
11-Dec-2015 |
smh |
Limit stripesize reported from nvd(4) to 4K
Intel NVMe controllers have a slow path for I/Os that span a 128KB stripe boundary but ZFS limits ashift, which is derived from d_stripesize, to 13 (8KB) so we limit the stripesize reported to geom(8) to 4KB.
This may result in a small number of additional I/Os to require splitting in nvme(4), however the NVMe I/O path is very efficient so these additional I/Os will cause very minimal (if any) difference in performance or CPU utilisation.
This can be controller by the new sysctl kern.nvme.max_optimal_sectorsize.
MFC after: 1 week Sponsored by: Multiplay Differential Revision: https://reviews.freebsd.org/D4446
|
290199 |
30-Oct-2015 |
jimharris |
nvd, nvme: report stripesize through GEOM disk layer
MFC after: 3 days Sponsored by: Intel
|
290198 |
30-Oct-2015 |
jimharris |
nvme: fix race condition in split bio completion path
Fixes race condition observed under following circumstances:
1) I/O split on 128KB boundary with Intel NVMe controller. Current Intel controllers produce better latency when I/Os do not span a 128KB boundary - even if the I/O size itself is less than 128KB. 2) Per-CPU I/O queues are enabled. 3) Child I/Os are submitted on different submission queues. 4) Interrupts for child I/O completions occur almost simultaneously. 5) ithread for child I/O A increments bio_inbed, then immediately is preempted (rendezvous IPI, higher priority interrupt). 6) ithread for child I/O B increments bio_inbed, then completes parent bio since all children are now completed. 7) parent bio is freed, and immediately reallocated for a VFS or gpart bio (including setting bio_children to 1 and clearing bio_driver1). 8) ithread for child I/O A resumes processing. bio_children for what it thinks is the parent bio is set to 1, so it thinks it needs to complete the parent bio.
Result is either calling a NULL callback function, or double freeing the bio to its uma zone.
PR: 203746 Reported by: Drew Gallatin <gallatin@netflix.com>, Marc Goroff <mgoroff@quorum.net> Tested by: Drew Gallatin <gallatin@netflix.com> MFC after: 3 days Sponsored by: Intel
|
286043 |
29-Jul-2015 |
jimharris |
nvme: do not notify a consumer about failures that occur during initialization
MFC after: 3 days Sponsored by: Intel
|
285819 |
23-Jul-2015 |
jeff |
Refactor unmapped buffer address handling. - Use pointer assignment rather than a combination of pointers and flags to switch buffers between unmapped and mapped. This eliminates multiple flags and generally simplifies the logic. - Eliminate b_saveaddr since it is only used with pager bufs which have their b_data re-initialized on each allocation. - Gather up some convenience routines in the buffer cache for manipulating buf space and buf malloc space. - Add an inline, buf_mapped(), to standardize checks around unmapped buffers.
In collaboration with: mlaier Reviewed by: kib Tested by: pho (many small revisions ago) Sponsored by: EMC / Isilon Storage Division
|
285816 |
23-Jul-2015 |
jimharris |
nvme: ensure csts.rdy bit is cleared before returning from nvme_ctrlr_disable
PR: 200458 MFC after: 3 days Sponsored by: Intel
|
285815 |
23-Jul-2015 |
jimharris |
nvme: properly handle case where pci_alloc_msix does not alloc all vectors
Reported by: Sean Kelly <smkelly@smkelly.org> MFC after: 3 days Sponsored by: Intel
|
281285 |
09-Apr-2015 |
jimharris |
nvme: use BUS_SPACE_MAXSIZE for bus_dma_tag_create maxsize parameter
This fixes i386 PAE build fallout from r281281.
Reported by: bz MFC after: 1 week
|
281283 |
08-Apr-2015 |
jimharris |
nvme: remove CHATHAM related code
Chatham was an internal NVMe prototype board used for early driver development.
MFC after: 1 week Sponsored by: Intel
|
281282 |
08-Apr-2015 |
jimharris |
nvme: add device strings for Intel DC series NVMe SSDs
MFC after: 1 week Sponsored by: Intel
|
281281 |
08-Apr-2015 |
jimharris |
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.
Submitted by: kib MFC after: 1 week Sponsored by: Intel
|
281280 |
08-Apr-2015 |
jimharris |
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.
MFC after: 1 week Sponsored by: Intel
|
267342 |
10-Jun-2014 |
jimharris |
Use bitwise OR instead of logical OR when constructing value for SET_FEATURES/NUMBER_OF_QUEUES command.
Sponsored by: Intel MFC after: 3 days
|
263311 |
18-Mar-2014 |
jimharris |
nvme: Allocate all MSI resources up front so that we can fall back to INTx if necessary.
Sponsored by: Intel MFC after: 3 days
|
263310 |
18-Mar-2014 |
jimharris |
nvme: Close hole where nvd(4) would not be notified of all nvme(4) instances if modules loaded during boot.
Sponsored by: Intel MFC after: 3 days
|
263278 |
17-Mar-2014 |
jimharris |
nvme: NVMe specification dictates 4-byte alignment for PRPs (not 8).
Sponsored by: Intel MFC after: 3 days
|
263277 |
17-Mar-2014 |
jimharris |
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.
Sponsored by: Intel MFC after: 3 days
|
260382 |
06-Jan-2014 |
jimharris |
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.
Sponsored by: Intel MFC after: 3 days
|
257534 |
01-Nov-2013 |
jimharris |
Create a unique unit number for each controller and namespace cdev.
Sponsored by: Intel MFC after: 3 days
|
256169 |
08-Oct-2013 |
jimharris |
Fix the LINT build.
Approved by: re (implicit) MFC after: 1 week
|
256155 |
08-Oct-2013 |
jimharris |
Do not leak resources during attach if nvme_ctrlr_construct() or the initial controller resets fail.
Sponsored by: Intel Reviewed by: carl Approved by: re (hrs) MFC after: 1 week
|
256154 |
08-Oct-2013 |
jimharris |
Log and then disable asynchronous notification of persistent events after 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
|
256153 |
08-Oct-2013 |
jimharris |
Do not enable temperature threshold as an asynchronous event notification on NVMe controllers that do not support it.
Sponsored by: Intel Reviewed by: carl Approved by: re (hrs) MFC after: 1 week
|
256152 |
08-Oct-2013 |
jimharris |
Extend some 32-bit fields and variables to 64-bit to prevent overflow 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
|
256151 |
08-Oct-2013 |
jimharris |
Add driver-assisted striping for upcoming Intel NVMe controllers that can benefit from it.
Sponsored by: Intel Reviewed by: kib (earlier version), carl Approved by: re (hrs) MFC after: 1 week
|
254389 |
15-Aug-2013 |
ken |
Change the way that unmapped I/O capability is advertised.
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
|
254303 |
13-Aug-2013 |
jimharris |
If a controller fails to initialize, do not notify consumers (nvd) of its namespaces.
Sponsoredy by: Intel Reviewed by: carl MFC after: 3 days
|
254302 |
13-Aug-2013 |
jimharris |
Send a shutdown notification in the driver unload path, to ensure notification gets sent in cases where system shuts down with driver unloaded.
Sponsored by: Intel Reviewed by: carl MFC after: 3 days
|
253476 |
19-Jul-2013 |
jimharris |
Add message when nvd disks are attached and detached.
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
|
253474 |
19-Jul-2013 |
jimharris |
Fix nvme(4) and nvd(4) to support non 512-byte sector sizes.
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
|
253438 |
17-Jul-2013 |
jimharris |
Use pause() instead of DELAY() when polling for completion of admin 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
|
253437 |
17-Jul-2013 |
jimharris |
Define constants for the lengths of the serial number, model number 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
|
253209 |
11-Jul-2013 |
jimharris |
Fix a poorly worded comment in nvme(4).
MFC after: 3 days
|
253113 |
09-Jul-2013 |
jimharris |
Add comment explaining why CACHE_LINE_SIZE is defined in nvme_private.h if not already defined elsewhere.
Requested by: attilio MFC after: 3 days
|
253112 |
09-Jul-2013 |
jimharris |
Update copyright dates.
MFC after: 3 days
|
253108 |
09-Jul-2013 |
jimharris |
Do not retry failed async event requests.
Sponsored by: Intel MFC after: 3 days
|
253107 |
09-Jul-2013 |
jimharris |
Add pci_enable_busmaster() and pci_disable_busmaster() calls in nvme_attach() and nvme_detach() respectively.
Sponsored by: Intel MFC after: 3 days
|
252278 |
27-Jun-2013 |
jimharris |
Add firmware replacement and activation support to nvmecontrol(8) through 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
|
252273 |
26-Jun-2013 |
jimharris |
Remove remaining uio-related code.
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
|
252272 |
26-Jun-2013 |
jimharris |
Fail any passthrough command whose transfer size exceeds the controller's 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
|
252271 |
26-Jun-2013 |
jimharris |
Use MAXPHYS to specify the maximum I/O size for nvme(4).
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
|
249422 |
12-Apr-2013 |
jimharris |
Remove the NVME_IDENTIFY_CONTROLLER and NVME_IDENTIFY_NAMESPACE IOCTLs and replace them with the NVMe passthrough equivalent.
Sponsored by: Intel
|
249421 |
12-Apr-2013 |
jimharris |
Add support for passthrough NVMe commands.
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
|
249420 |
12-Apr-2013 |
jimharris |
Move the busdma mapping functions to nvme_qpair.c.
This removes nvme_uio.c completely.
Sponsored by: Intel
|
249419 |
12-Apr-2013 |
jimharris |
Remove the NVMe-specific physio and associated routines.
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
|
249418 |
12-Apr-2013 |
jimharris |
Add a mutex to each namespace, for general locking operations on the namespace.
Sponsored by: Intel
|
249417 |
12-Apr-2013 |
jimharris |
Rename the controller's fail_req_lock, so that it can be used for other locking operations on the controller.
Sponsored by: Intel
|
249416 |
12-Apr-2013 |
jimharris |
Do not panic when a busdma mapping operation fails.
Instead, print an error message and fail the associated command with DATA_TRANSFER_ERROR NVMe completion status.
Sponsored by: Intel
|
248977 |
01-Apr-2013 |
jimharris |
Add unmapped bio support to nvme(4) and nvd(4).
Sponsored by: Intel
|
248913 |
29-Mar-2013 |
jimharris |
Add "type" to nvme_request, signifying if its payload is a VADDR, UIO, or NULL. This simplifies decisions around if/how requests are routed through busdma. It also paves the way for supporting unmapped bios.
Sponsored by: Intel
|
248835 |
28-Mar-2013 |
jimharris |
Remove obsolete comment. This code has now been tested with the QEMU NVMe device emulator.
|
248834 |
28-Mar-2013 |
jimharris |
Delete extra IO qpairs allocated based on number of MSI-X vectors, but 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
|
248780 |
27-Mar-2013 |
jimharris |
Fix printf format issue on i386.
Reported by: bz
|
248773 |
26-Mar-2013 |
jimharris |
Clean up debug prints.
1) Consistently use device_printf. 2) Make dump_completion and dump_command into something more human-readable.
Sponsored by: Intel Reviewed by: carl
|
248771 |
26-Mar-2013 |
jimharris |
Move common code from the different nvme_allocate_request functions into a separate function.
Sponsored by: Intel Suggested by: carl Reviewed by: carl
|
248770 |
26-Mar-2013 |
jimharris |
Change a number of malloc(9) calls to use M_WAITOK instead of M_NOWAIT.
Sponsored by: Intel Suggested by: carl Reviewed by: carl
|
248769 |
26-Mar-2013 |
jimharris |
Replace usages of mtx_pool_find used for admin commands with a polling 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
|
248768 |
26-Mar-2013 |
jimharris |
Abort and do not retry any outstanding admin commands left over after a controller reset.
Sponsored by: Intel Reviewed by: carl
|
248767 |
26-Mar-2013 |
jimharris |
Add the ability to internally mark a controller as failed, if it is unable to 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
|
248766 |
26-Mar-2013 |
jimharris |
Just disable the controller instead of deleting IO queues during detach.
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
|
248764 |
26-Mar-2013 |
jimharris |
Set Pre-boot Software Load Count to 0 at the end of the controller 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
|
248763 |
26-Mar-2013 |
jimharris |
Remove the is_started flag from struct nvme_controller.
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
|
248762 |
26-Mar-2013 |
jimharris |
Ensure the controller's MDTS is accounted for in max_xfer_size.
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
|
248761 |
26-Mar-2013 |
jimharris |
Cap the number of retry attempts to a configurable number. This ensures 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
|
248760 |
26-Mar-2013 |
jimharris |
Pass associated log page data to async event consumers, if requested.
Sponsored by: Intel Reviewed by: carl
|
248759 |
26-Mar-2013 |
jimharris |
When an asynchronous event request is completed, automatically fetch the 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
|
248758 |
26-Mar-2013 |
jimharris |
Add structure definitions and controller command function for firmware log pages.
Sponsored by: Intel Reviewed by: carl
|
248757 |
26-Mar-2013 |
jimharris |
Add structure definitions and a controller command function for error log pages.
Sponsored by: Intel Reviewed by: carl
|
248756 |
26-Mar-2013 |
jimharris |
Create struct nvme_status.
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
|
248755 |
26-Mar-2013 |
jimharris |
Make nvme_ctrlr_reset a nop if a reset is already in progress.
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
|
248754 |
26-Mar-2013 |
jimharris |
By default, always escalate to controller reset when an I/O times out.
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
|
248749 |
26-Mar-2013 |
jimharris |
Add a tunable for the I/O timeout interval. Default is still 30 seconds, but can be adjusted between a min/max of 5 and 120 seconds.
Sponsored by: Intel Reviewed by: carl
|
248748 |
26-Mar-2013 |
jimharris |
Add handling for controller fatal status (csts.cfs).
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
|
248747 |
26-Mar-2013 |
jimharris |
Add API for nvme consumers to access controller and namespace identify data.
Sponsored by: Intel Reviewed by: carl
|
248746 |
26-Mar-2013 |
jimharris |
Add controller reset capability to nvme(4) and ability to explicitly 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
|
248741 |
26-Mar-2013 |
jimharris |
Keep a doubly-linked list of outstanding trackers.
This enables in-order re-submission of I/O after a controller reset.
Sponsored by: Intel
|
248740 |
26-Mar-2013 |
jimharris |
Create a generic nvme_ctrlr_cmd_get_log_page function, and change the health information log page function to use it.
Sponsored by: Intel
|
248739 |
26-Mar-2013 |
jimharris |
Expose the get/set features API to nvme consumers.
Sponsored by: Intel
|
248738 |
26-Mar-2013 |
jimharris |
Add an interface for nvme shim drivers (i.e. nvd) to register for notifications when new nvme controllers are added to the system.
Sponsored by: Intel
|
248737 |
26-Mar-2013 |
jimharris |
Enable asynchronous event requests on non-Chatham devices.
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
|
248736 |
26-Mar-2013 |
jimharris |
Move controller destruction code from nvme_detach() to new nvme_ctrlr_destruct() function.
Sponsored by: Intel
|
248735 |
26-Mar-2013 |
jimharris |
Specify command timeout interval on a per-command type basis.
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
|
248734 |
26-Mar-2013 |
jimharris |
Explicitly abort a timed out command, if the ABORT command sent to the controller indicates the command was not found.
Sponsored by: Intel
|
248733 |
26-Mar-2013 |
jimharris |
Break out the code for completing an nvme_tracker object into a separate function.
This allows for completions outside the normal completion path, for example when an ABORT command fails due to the controller reporting the targeted command does not exist. This is mainly for protection against a faulty controller, but we need to clean up our internal request nonetheless.
Sponsored by: Intel
|
248732 |
26-Mar-2013 |
jimharris |
Add support for ABORT commands, including issuing these commands when an I/O times out.
Also ensure that we retry commands that are aborted due to a timeout.
Sponsored by: Intel
|
248731 |
26-Mar-2013 |
jimharris |
Add an internal _nvme_qpair_submit_request function, which performs the submit action assuming the qpair lock has already been acquired.
Also change nvme_qpair_submit_request to just lock/unlock the mutex around a call to this new function.
This fixes a recursive mutex acquisition in the retry path.
Sponsored by: Intel
|
248730 |
26-Mar-2013 |
jimharris |
Make the DSM range count 0-based. Previously we were deallocating one more LBA than we should have been.
Sponsored by: Intel
|
248729 |
26-Mar-2013 |
jimharris |
Do not look at the namespace's thin provisioning field to determine if DSM command is supported. The two are not related.
Sponsored by: Intel
|
247963 |
07-Mar-2013 |
obrien |
Fix GCC build: /usr/src/sys/modules/nvme/../../dev/nvme/nvme.c:211: warning: format '%qx' expects type 'long unsigned int', but argument 9 has type 'long long unsigned int' [-Wformat]
|
245136 |
07-Jan-2013 |
jimharris |
Revert r244549.
This change was originally intended to account for test kthreads under the nvmecontrol process, but jhb indicated it may not be safe to associate kthreads with userland processes and this could have unintended consequences.
I did not observe any problems with this change, but my testing didn't exhaust the kinds of corner cases that could cause problems. It is not that important to account for these test threads under nvmecontrol, so I am just reverting this change for now.
On a related note, the part of this patch for <= 7.x fails compilation so reverting this fixes that too.
Suggested by: jhb
|
244549 |
21-Dec-2012 |
jimharris |
Put kthreads under curproc so they are attached to nvmecontrol rather than pid 0.
Sponsored by: Intel
|
244413 |
18-Dec-2012 |
jimharris |
Map BAR 4/5, because NVMe spec says devices may place the MSI-X table behind BAR 4/5, rather than in BAR 0/1 with the control/doorbell registers.
Sponsored by: Intel
|
244411 |
18-Dec-2012 |
jimharris |
Simplify module definition by adding nvme_modevent to DRIVER_MODULE() definition.
Submitted by: Carl Delsey <carl.r.delsey@intel.com>
|
244410 |
18-Dec-2012 |
jimharris |
Do not use taskqueue to defer completion work when using INTx. INTx now matches MSI-X behavior.
Sponsored by: Intel
|
243951 |
06-Dec-2012 |
jimharris |
Add PCI device ID for 8-channel IDT NVMe controller, and clarify that the previously defined IDT PCI device ID was for a 32-channel controller.
Submitted by: Joe Golio <joseph.golio@isilon.com>
|
242420 |
31-Oct-2012 |
jimharris |
Use callout_reset_curcpu to allow the callout to be handled by the current CPU and not always CPU 0.
This has the added benefit of reducing a huge amount of spinlock contention on the callout_cpu spinlock for CPU 0.
Sponsored by: Intel
|
241689 |
18-Oct-2012 |
glebius |
Fix build after r241659.
|
241665 |
18-Oct-2012 |
jimharris |
Add ability to queue nvme_request objects if no nvme_trackers are available.
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
|
241664 |
18-Oct-2012 |
jimharris |
Preallocate a limited number of nvme_tracker objects per qpair, rather than dynamically creating them at runtime.
Sponsored by: Intel
|
241663 |
18-Oct-2012 |
jimharris |
Create nvme_qpair_submit_request() which eliminates all of the code duplication between the admin and io controller-level submit functions.
Sponsored by: Intel
|
241662 |
18-Oct-2012 |
jimharris |
Simplify how the qpair lock is acquired and released.
Sponsored by: Intel
|
241661 |
18-Oct-2012 |
jimharris |
Cleanup uio-related code to use struct nvme_request and 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
|
241660 |
18-Oct-2012 |
jimharris |
Add nvme_ctrlr_submit_[admin|io]_request functions which consolidates code for allocating nvme_tracker objects and making calls into bus_dmamap_load for commands which have payloads.
Sponsored by: Intel
|
241659 |
18-Oct-2012 |
jimharris |
Add struct nvme_request object which contains all of the parameters passed from an NVMe consumer.
This allows us to mostly build NVMe command buffers without holding the qpair lock, and also allows for future queueing of nvme_request objects in cases where the submission queue is full and no nvme_tracker objects are available.
Sponsored by: Intel
|
241658 |
18-Oct-2012 |
jimharris |
Merge struct nvme_prp_list into struct nvme_tracker.
This simplifies the driver significantly where it is constructing commands to be submitted to hardware. By reducing the number of PRPs (NVMe parlance for SGE) from 128 to 32, it ensures we do not allocate too much memory for more common smaller I/O sizes, while still supporting up to 128KB I/O sizes.
This also paves the way for pre-allocation of nvme_tracker objects for each queue which will simplify the I/O path even further.
Sponsored by: Intel
|
241657 |
18-Oct-2012 |
jimharris |
Add return codes to all functions used for submitting commands to I/O queues.
Sponsored by: Intel
|
241434 |
10-Oct-2012 |
jimharris |
Count number of times each queue pair's interrupt handler is invoked.
Also add sysctls to query and reset each queue pair's stats, including the new count added here.
Sponsored by: Intel
|
241433 |
10-Oct-2012 |
jimharris |
Put the nvme_qpair mutex on its own cacheline.
Sponsored by: Intel
|
241394 |
10-Oct-2012 |
kevlo |
Revert previous commit...
Pointyhat to: kevlo (myself)
|
241370 |
09-Oct-2012 |
kevlo |
Prefer NULL over 0 for pointers
|
240700 |
19-Sep-2012 |
jimharris |
In nvme(4), set device description for BUS_PROBE_GENERIC case.
Reported by: jhb
|
240697 |
19-Sep-2012 |
jimharris |
Report nvme(4) as a generic driver for NVMe devices if PCI class, subclass and programming interface codes match.
Sponsored by: Intel
|
240672 |
18-Sep-2012 |
jimharris |
Add #if 0 around nvme_async_event_cb() until NVMe AER functionality can be tested.
This fixes a build warning found only with clang.
|
240671 |
18-Sep-2012 |
jimharris |
Add __aligned(4) to NVMe defined data structures.
This fixes issue in nvmecontrol(8), where clang throws a cast-align warning when casting a __packed structure pointer to a uint32_t pointer as part of printing raw hex output.
Reported by: dhw
|
240616 |
17-Sep-2012 |
jimharris |
This is the first of several commits which will add NVM Express (NVMe) 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>
|