-
Notifications
You must be signed in to change notification settings - Fork 32
nvme: add oxide-specific feature to expose read-only attribute for device #1060
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
7d3fe45
fc631c8
77097aa
a2c8431
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -403,6 +403,19 @@ impl NvmeCtrl { | |
| ) | ||
| } | ||
|
|
||
| cmds::FeatureIdent::OxideDeviceFeatures => { | ||
| if cmd.cdw11 != 0 { | ||
| // We don't currently accept any parameters for this feature | ||
| cmds::Completion::generic_err(STS_INVAL_FIELD) | ||
| } else { | ||
| cmds::Completion::success_val( | ||
| cmds::OxideDeviceFeatures(0) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'll defer to someone else on the change in construction from using
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just to match other similar |
||
| .with_read_only(self.read_only) | ||
| .0, | ||
| ) | ||
| } | ||
| } | ||
|
|
||
| cmds::FeatureIdent::Reserved | ||
| | cmds::FeatureIdent::LbaRangeType | ||
| | cmds::FeatureIdent::SoftwareProgressMarker | ||
|
|
@@ -457,6 +470,7 @@ impl NvmeCtrl { | |
| | cmds::FeatureIdent::WriteAtomicity | ||
| | cmds::FeatureIdent::AsynchronousEventConfiguration | ||
| | cmds::FeatureIdent::SoftwareProgressMarker | ||
| | cmds::FeatureIdent::OxideDeviceFeatures | ||
| | cmds::FeatureIdent::Vendor(_) => { | ||
| cmds::Completion::generic_err(STS_INVAL_FIELD).dnr() | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few notes on validation here that I think we want to check:
AdminCmd::parse. Doesn't have to be fixed in this change, but probably should be a follow up for us there.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One other thing now that I looked more closely here, it looks like we're going to commit to returning the same data regardless of namespace id. I think I'm fine with that, but just want to confirm that intent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a check here specifically and opened #1061 to look at constraining the other features.
We're only advertising 1.0 support so that is there today.
Yes, although now I'm wondering if it's worth constraining one way or the other in the same vein as rejecting non-zero cdw11. Not a huge difference either way since we only support a single namespace today anyways.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, it's the distinction between using namespace id 0 being that it isn't valid or in the future using the broadcast namespace. I think I agree that we can change this in the future. I ultimately convinced myself it was probably fine last time I was looking at it. Ultimately we're the only consumer right now so it's okay to change htis if need be.