Skip to content

libnvme: Add direction parameter to get feature length#494

Merged
igaw merged 2 commits intolinux-nvme:masterfrom
ikegami-t:set-feature-0dh
Oct 21, 2022
Merged

libnvme: Add direction parameter to get feature length#494
igaw merged 2 commits intolinux-nvme:masterfrom
ikegami-t:set-feature-0dh

Conversation

@ikegami-t
Copy link
Copy Markdown
Contributor

Since feature identifier 0Dh: host memory buffer length is affected by the direction as mentioned by the issue #1681.

Signed-off-by: Tokunori Ikegami ikegami.t@gmail.com

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Oct 18, 2022

Codecov Report

Merging #494 (7ad759b) into master (ac270c3) will decrease coverage by 0.03%.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##           master     #494      +/-   ##
==========================================
- Coverage   23.56%   23.53%   -0.04%     
==========================================
  Files          31       31              
  Lines        5882     5890       +8     
  Branches     1203     1205       +2     
==========================================
  Hits         1386     1386              
- Misses       4040     4048       +8     
  Partials      456      456              
Impacted Files Coverage Δ
src/nvme/types.h 0.00% <ø> (ø)
src/nvme/util.c 0.00% <0.00%> (ø)
src/nvme/util.h 0.00% <ø> (ø)
src/nvme/mi-mctp.c 69.03% <0.00%> (-0.45%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Comment thread src/nvme/util.h Outdated
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be better to introduce an enum for the dir argument. The bool isn't really self explanatory.
Another thing it will break the existing API. One nasty idea is we could abuse the 'len' argument for passing in the dir but this is probably a too big hack.

So I suggest to add nvme_get_feature_length2() which has this new argument and nvme_get_feature_length() just calls nvme_get_feature_length2() with dir=NVME_HOST_MEM_HOST_TO_CTRL.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your comments. About the suggestion mensioned to make sure let me confirm below.
If added nvme_get_feature_length2() but still the original API does not work correctly for the feature ID reported by the issue. Is this really okay?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we need keep the nvme_get_feature_length() around, because removing or changing this function is not possible as we promised not to break the API.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. Thanks for the explanation.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just pushed the changes as suggested.

@ikegami-t ikegami-t force-pushed the set-feature-0dh branch 2 times, most recently from 1d1e60a to 7ad759b Compare October 18, 2022 16:21
@igaw
Copy link
Copy Markdown
Collaborator

igaw commented Oct 21, 2022

Almost, I wanted the functions names to be the other way round. I'll do the update quickly.

@igaw
Copy link
Copy Markdown
Collaborator

igaw commented Oct 21, 2022

Almost, I wanted the functions names to be the other way round. I'll do the update quickly.

Got confused by the web view. But there are couple of small things I'd like to cleanup. Just a sec.

ikegami-t and others added 2 commits October 21, 2022 09:07
Since feature identifier 0Dh: host memory buffer length is affected by the
direction as mentioned by the issue #1681.

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
[dwagner: reordered definitions and declerations]
Signed-off-by: Daniel Wagner <dwagner@suse.de>
Use consistently the fallthrough statement as we have a fallback in
util.h in case the compiler doesn't support it.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
@igaw igaw merged commit 59187d7 into linux-nvme:master Oct 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants