Page MenuHomeFreeBSD

nvme: MPS is a power of two
ClosedPublic

Authored by imp on Mar 29 2022, 3:41 PM.
Tags
None
Referenced Files
Unknown Object (File)
Feb 8 2024, 12:42 PM
Unknown Object (File)
Jan 14 2024, 8:09 AM
Unknown Object (File)
Dec 23 2023, 12:07 AM
Unknown Object (File)
Dec 13 2023, 11:25 AM
Unknown Object (File)
Nov 17 2023, 8:23 PM
Unknown Object (File)
Nov 17 2023, 5:21 PM
Unknown Object (File)
Nov 17 2023, 3:24 PM
Unknown Object (File)
Nov 17 2023, 3:01 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.