-
Notifications
You must be signed in to change notification settings - Fork 655
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
nvme: Add nvme_cfg global variable for NVME_ARGS default options #2285
Conversation
Good idea. I was playing around with a different idea. Let me check what I've done and if there are some more cases to cover |
Looking with fresh eyes on this PR, could you explain what do you want to achieve with this change? I mean I understand you want to group those two variable but if it is just that, I don't think we should introduce so much code churn. BTW, I though you would do something similar what I a just posted in #2288 |
Sorry for late to do add additional patches. I thought to try the timeout default options into the NVME_ARGS since currently only some commands supported the option but seems almost libnvme APIs support the timeout parameter. If you okay about this will do continue the implementation. Anyway in future for any other default options the nvme_cfg global variable seems be able to use I think. |
Sounds alright, the only thing to keep in mind, we should avoid changing existing options. |
Just rebased the patch and also noted about the mention. Thank you. |
The last patch for delete-ns command depended on the libnvme PR changes linux-nvme/libnvme#811. |
0f22f7b
to
37625f5
Compare
Sorry the following commands short option changed as below by the commit c809879 since duplicated with the default timeout option - nvme compare [--latency | -t]
+ nvme compare [--latency | -L]
- nvme read [--latency | -t]
+ nvme read [--latency | -L]
- nvme resv-acquire [--rtype=<rtype> | -t <rtype>]
+ nvme resv-acquire [--rtype=<rtype> | -T <rtype>]
- nvme resv-release [--rtype=<rtype> | -t <rtype>]
+ nvme resv-release [--rtype=<rtype> | -T <rtype>]
- nvme security-recv [--al=<allocation-length> | -t <allocation-length>]
+ nvme security-recv [--al=<allocation-length> | -l <allocation-length>]
- nvme security-recv [--tl=<transfer-length> | -t <transfer-length>]
+ nvme security-recv [--tl=<transfer-length> | -l <transfer-length>]
- nvme write [--latency | -t]
+ nvme write [--latency | -L] |
That means we would change existing options once again. The last time it introduced regressions and I promised to avoid this in future. See https://lore.kernel.org/linux-nvme/xfypo2wloir5l3wrw4aodzjekertc4dlnb7dvk2i5egiqwo3ao@rokmuhzvvcfe/ I think we could avoid this by just introducing |
Okay I see so will do consider the suggestion to keep the existing commands. Thank you. |
Just fixed the short option change issue as below as changed the default timeout option order so the existing short command option #define NVME_ARGS(n, ...) \
struct argconfig_commandline_options n[] = { \
OPT_INCR("verbose", 'v', &nvme_cfg.verbose, verbose), \
OPT_FMT("output-format", 'o', &nvme_cfg.output_format, output_format), \
- OPT_UINT("timeout", 't', &nvme_cfg.timeout, timeout), \
##__VA_ARGS__, \
+ OPT_UINT("timeout", 't', &nvme_cfg.timeout, timeout), \
OPT_END() \
} By the way I think we can fix the short option |
Sorry for the late response. I was pretty busy and now I am trying to catch up.
Okay, sounds good to me
Maybe it is worth to add a comment why timeout is the last argument. E.g the ordering of the arguments matters, as the argument parser uses the first match, thus any command which defines
I think we just leave it as it is now. Changing it back will cause again troubles. BTW, could you rebase the PR? Thanks! |
Thanks for your review comments. Let me update the patches on next week since traveling now. |
To preapare to add NVME_ARGS default option further. Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
Replace the existing timeout options to use this instead. Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
The timeout variable zero initialized as same with the default definition. Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
Change to pass the timeout value to libnvme API. Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
The option added as NVME_ARGS default option. Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
Fix white spaces indentation to use tabs. Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
Fix white spaces indentation to use tabs. Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
The fw-activate command is old version prior to 1.2. Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
The nvme-mi-recv/send and get/set-reg commands missed it. Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
Missed to add the commands completions. Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
Added the option as a nvme default option. Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
Added the option as a nvme default option. Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
Just fixed the comment and rebased the patches. |
Thanks a lot! This was a major cleanup! |
To preapare to add NVME_ARGS default option further.