Page MenuHomeFreeBSD

Support doorbell strides != 0.
ClosedPublic

Authored by imp on Sep 3 2019, 9:39 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Dec 9, 5:31 PM
Unknown Object (File)
Thu, Nov 28, 12:42 PM
Unknown Object (File)
Thu, Nov 28, 12:42 PM
Unknown Object (File)
Thu, Nov 28, 12:42 PM
Unknown Object (File)
Thu, Nov 28, 12:42 PM
Unknown Object (File)
Thu, Nov 28, 12:41 PM
Unknown Object (File)
Thu, Nov 28, 12:21 PM
Unknown Object (File)
Nov 9 2024, 12:06 AM
Subscribers
None

Details

Summary

The NVMe standard (1.4) states

8.6 Doorbell Stride for Software Emulation
The doorbell stride,...is useful in software emulation of an NVM
Express controller. ... For hardware implementations of the NVM
Express interface, the expected doorbell stride value is 0h.

However, hardware in the wild exists with a doorbell stride of
1h. This change supports that hardware, as well as software emulators
as envisioned in Section 8.6. Since this is the fast path, care has
been taken to make this computation efficient. The bit of math to
compute an offset for each is replaced by a memory load from cache.

Test Plan

Tested on new hardware that has DSTRD=1. works great. Also works on half a dozen older drives that have DSTRD=0.
Don't have an emulator that can set this easily,

Diff Detail

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 26262
Build 24750: arc lint + arc unit

Event Timeline

imp added reviewers: scottl, jimharris.
sys/dev/nvme/nvme_ctrlr.c
112

This should be min. We want the smaller of these two.

Fix some comment wrapping.

scottl added inline comments.
sys/dev/nvme/nvme_qpair.c
626

I would have probably stuck with using nvme_mmio_write_4() because it's more compact and easier to read, but it's a super minor thing.

This revision is now accepted and ready to land.Sep 4 2019, 2:18 PM
sys/dev/nvme/nvme_qpair.c
626

I'd love to, but it hard-codes a offsetof() its second argument, so I couldn't use it.

This revision was automatically updated to reflect the committed changes.
imp marked an inline comment as done.