Page MenuHomeFreeBSD

bhyve: implement get-feature of LBA range type of NVMe controller
AbandonedPublic

Authored by wanpengqian_gmail.com on Nov 2 2021, 8:38 AM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Apr 11, 2:32 PM
Unknown Object (File)
Wed, Apr 10, 3:19 AM
Unknown Object (File)
Mar 7 2024, 1:58 AM
Unknown Object (File)
Mar 7 2024, 1:58 AM
Unknown Object (File)
Mar 7 2024, 12:52 AM
Unknown Object (File)
Mar 7 2024, 12:00 AM
Unknown Object (File)
Dec 23 2023, 12:39 AM
Unknown Object (File)
Dec 12 2023, 12:18 AM
Subscribers

Details

Reviewers
grehan
jhb
imp
Group Reviewers
bhyve
Summary

Quote from NVMe specificaion

The default value for this feature should clear the Number of LBA Ranges field to 00h and initialize the LBA
Range Type data structure to contain a single entry with:
Type field cleared to 00h,
Attributes field set to 01h,
Starting LBA field cleared to 0h,
Number of Logical Blocks field set to indicate the number of LBAs in the namespace, and
GUID field set to a globally unique identifier.

when client query this feature, NVMe controller will return the correct data.

Test Plan

FreeBSD: nvmecontrol feature get -f3 nvme0
Linux: nvme get-feature -f3 /dev/nvme0

to verify the result. FreeBSD needs D32700 patch.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 42673
Build 39561: arc lint + arc unit

Event Timeline

create struct for each feature object

What is the long term plan for this functionality? Applications can use LBA Range Type to provide usage hints to the Controller such that it can optimize its performance characteristics. Are there kernels / applications out there that use this functionality? If so, is the goal to use these hints to modify the emulation's behavior?

usr.sbin/bhyve/pci_nvme.c
1438

The specification requires compliant implementations to return the value used in the Set Features in CDW0 of the Get Features completion. Wouldn't this change break that behavior?

What is the long term plan for this functionality? Applications can use LBA Range Type to provide usage hints to the Controller such that it can optimize its performance characteristics. Are there kernels / applications out there that use this functionality? If so, is the goal to use these hints to modify the emulation's behavior?

As of now I didn't see any Applications/OS that take advantage of this feature. but LBA Range Type can be set by application/OS, so virtual controllers can optimize backend storage. such as Cache/Swap Type will store into the host's Flash Memory area, while Filesystem Type can be stored into normal HDD area.
Maybe FreeBSD can implement this feature first?

Anyway, Currently I am only implementing the Get Feature.