Page MenuHomeFreeBSD

Support doorbell strides != 0.
ClosedPublic

Authored by imp on Sep 3 2019, 9:39 PM.
Tags
None
Referenced Files
Unknown Object (File)
Jan 21 2024, 4:53 PM
Unknown Object (File)
Jan 13 2024, 2:16 AM
Unknown Object (File)
Dec 23 2023, 4:19 AM
Unknown Object (File)
Dec 12 2023, 3:16 AM
Unknown Object (File)
Dec 5 2023, 8:19 PM
Unknown Object (File)
Nov 30 2023, 8:06 PM
Unknown Object (File)
Nov 15 2023, 7:32 PM
Unknown Object (File)
Oct 22 2023, 4:01 PM
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

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

imp added reviewers: scottl, jimharris.
sys/dev/nvme/nvme_ctrlr.c
112 ↗(On Diff #61625)

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 ↗(On Diff #61627)

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 ↗(On Diff #61627)

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.