Page MenuHomeFreeBSD

nvme: MPS is a power of two
ClosedPublic

Authored by imp on Mar 29 2022, 3:41 PM.
Tags
None
Referenced Files
F102922295: D34707.diff
Mon, Nov 18, 6:56 PM
Unknown Object (File)
Sun, Nov 17, 5:20 AM
Unknown Object (File)
Sat, Nov 16, 5:34 PM
Unknown Object (File)
Thu, Nov 14, 5:07 AM
Unknown Object (File)
Mon, Nov 11, 5:32 PM
Unknown Object (File)
Fri, Nov 8, 6:40 AM
Unknown Object (File)
Tue, Nov 5, 7:09 PM
Unknown Object (File)
Tue, Oct 29, 7:39 PM
Subscribers

Details

Summary

Setting MPS in the CC should be a power of 2 number (it specifies the
page size of the host is 2^(12+MPS)), so adjust the calcuation. There is
no functional change because we do not support any architecutres != 4k
pages (yet). Other changes are needed for architectures with 16k or 64k
pages, especially when the underlying NVMe drive doesn't support that
page size (Most drives support a range that's small, and many only
support 4k), but let's at least do this calculation correctly. 12 - 12
is just as much 0 as 4096 >> 13 is :)

Sponsored by: Netflix

Test Plan

Note: This is just a first step that I've distilled from a larger patch
set I'm working on, but is a good interim fix.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

imp requested review of this revision.Mar 29 2022, 3:41 PM
imp added reviewers: chs, chuck, mav, andrew, gallatin.

I'm OK on the main topic, but have comment on another one touched.

sys/dev/nvme/nvme_private.h
97

It seems to be an arbitrary value, unrelated to any page size. As I see, maximum size of error information log page may reach 16KB (8 bit of ELPE multiplied by 64). And it looks not handled correctly in nvme_ctrlr_async_event_log_page_cb().

This revision is now accepted and ready to land.Mar 29 2022, 4:14 PM
This revision was automatically updated to reflect the committed changes.