Page MenuHomeFreeBSD

nvme: Add OAES bit-field definitions
ClosedPublic

Authored by chuck on Feb 16 2022, 2:58 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Apr 21, 8:22 PM
Unknown Object (File)
Sun, Apr 21, 8:21 PM
Unknown Object (File)
Sun, Apr 21, 8:21 PM
Unknown Object (File)
Sun, Apr 21, 8:21 PM
Unknown Object (File)
Sun, Apr 21, 8:09 PM
Unknown Object (File)
Dec 20 2023, 7:41 AM
Unknown Object (File)
Dec 11 2023, 3:06 AM
Unknown Object (File)
Nov 29 2023, 6:34 AM
Subscribers

Details

Summary

Create definitions for the Optional Asynchronous Events Supported (OAES)
values. Also adds a helper macro for the common use case of "mask and
shift". E.g.

value = NVME_CTRLR_DATA_OAES_NS_ATTR_MASK << NVME_CTRLR_DATA_OAES_NS_ATTR_SHIFT;

becomes

value = NVMEB(NVME_CTRLR_DATA_OAES_NS_ATTR);

Diff Detail

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

Event Timeline

chuck requested review of this revision.Feb 16 2022, 2:58 PM

The new OAES defines are probably fine, but I'd like some feedback on the NVMEB() helper macro. Do you like it? Hate it? Have a better approach? Better name?

Looks good to me, I just think we could add more while there.

sys/dev/nvme/nvme.h
257

Where is the mask for the bit 14? Looking on NVMe 2.0 spec I see few more bits here. Why not add them too?

Added missing mask for Endurance Group (bit 14) and added new
definitions from the 2.0 specification

This revision is now accepted and ready to land.Feb 20 2022, 10:30 PM
This revision was automatically updated to reflect the committed changes.