-
Notifications
You must be signed in to change notification settings - Fork 2
ioctl: nvme_dsm use nvme_passthru_cmd directly #2
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
Conversation
Signed-off-by: Daniel Wagner <[email protected]>
The next change will add a static inline implementation of nvme_get_log which uses nvme_get_log_page. Thus move the nvme_get_log_page function up so it can be used directly. Signed-off-by: Daniel Wagner <[email protected]>
Refactor nvme_get_log and nvme_get_log_page to use use struct nvme_passthru_cmd directly and drop the struct nvme_get_log_args. The struct args have are ABI thus it's hard to change it after a release. The nvme_passthru_cmd buffer is a generic buffer and it's possible to use the setters directly on the buffer in an inline function. Besides a reduced API to maintain it also generates better code and avoids one call less when issue a command. Signed-off-by: Daniel Wagner <[email protected]>
Drop struct nvme_format_nvm_args. Signed-off-by: Daniel Wagner <[email protected]>
Drop struct nvme_ns_mgmt_args. Signed-off-by: Daniel Wagner <[email protected]>
Drop struct nvme_ns_attach_args. Signed-off-by: Daniel Wagner <[email protected]>
Drop struct nvme_fw_download_args. Signed-off-by: Daniel Wagner <[email protected]>
Drop struct nvme_fw_commit_args. Signed-off-by: Daniel Wagner <[email protected]>
Drop struct nvme_security_send_args. Signed-off-by: Daniel Wagner <[email protected]>
13b0a90 to
a180203
Compare
Drop struct nvme_dsm_args. Signed-off-by: Tokunori Ikegami <[email protected]>
Drop struct nvme_io_args. Signed-off-by: Tokunori Ikegami <[email protected]>
a180203 to
812ebf2
Compare
To use the fields in nvme_io() and nvme_dsm() functions. Signed-off-by: Tokunori Ikegami <[email protected]>
Drop struct nvme_copy_args. Signed-off-by: Tokunori Ikegami <[email protected]>
src/nvme/ioctl.h
Outdated
| */ | ||
| int nvme_dsm(nvme_link_t l, struct nvme_dsm_args *args); | ||
| static inline int nvme_dsm(nvme_link_t l, struct nvme_dsm_range *dsm, __u16 nr_ranges, __u32 attrs, | ||
| __u32 nsid, __u32 *result) |
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.
As I just figured out, the nsid is in cdw0, so it should be right after nvme_link_t l. Sorry for my mistake.
|
Looks great! If you could reorder the |
Also order the pointer and its length member go to the end of the list. Signed-off-by: Tokunori Ikegami <[email protected]>
|
Just fixed the review comments. Thank you. |
58a0811 to
5fa5c8a
Compare
|
I'll pick those and rebase them on the libnvme2 branch. Let me figure out what is the simplest way. |
|
I've picked these directly. They uncovered a bunch of bugs in the handling of the |
|
Applied. I'll merge the nsid match into the other changes later. Thanks! |
| NVME_VAL(NVM_CDW12_STC) | | ||
| NVME_VAL(NVM_CDW12_PRINFO) | | ||
| NVME_VAL(NVM_CDW12_FUA) | | ||
| NVME_VAL(NVM_CDW12_LR), |
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.
btw, this masks is already shifted thus it doesn't work as expected. I've added the necessary >> NVME_NVM_CDW12_CONTROL_SHIFT so it works. Caught by meson test -C .build :)
|
Thank you. Noted. |
Drop struct nvme_dsm_args.