-
Notifications
You must be signed in to change notification settings - Fork 698
plugin/ocp_get_feature_fid_c5h:Added the OCP Get Feature FID=C5h comm… #2768
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
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 |
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| nvme-ocp-get-latency-monitor(1) | ||
| ========================================= | ||
|
|
||
| NAME | ||
| ---- | ||
| nvme-ocp-get-latency-monitor - Define and print get-latency-monitor value | ||
|
|
||
| SYNOPSIS | ||
| -------- | ||
| [verse] | ||
| 'nvme ocp get-latency-monitor' <device> [--sel=<select> | -s <select>] | ||
| [--namespace-id <nsid> | -n <nsid>] [--no-uuid | -u] | ||
|
|
||
| DESCRIPTION | ||
| ----------- | ||
| The <device> parameter is mandatory and may be either the NVMe character | ||
| device (ex: /dev/nvme0) or block device (ex: /dev/nvme0n1). | ||
|
|
||
| This will only work on OCP compliant devices supporting this feature. | ||
| Results for any other device are undefined. | ||
|
|
||
| On success it returns 0, error code otherwise. | ||
|
|
||
| OPTIONS | ||
| ------- | ||
| -n <nsid>:: | ||
| --namespace-id=<nsid>:: | ||
| NSID: Assign the different kind of nsid value(like | ||
| active, inactive and invalid nsids) and check | ||
| the get feature command response: | ||
|
|
||
| -s <select>:: | ||
| --sel=<select>:: | ||
| Select (SEL): This field specifies which value of the attributes | ||
| to return in the provided data: | ||
| + | ||
| [] | ||
| |================== | ||
| |Select|Description | ||
| |0|Current | ||
| |1|Default | ||
| |2|Saved | ||
| |3|Supported capabilities | ||
| |4-7|Reserved | ||
| |================== | ||
|
|
||
| -u:: | ||
| --no-uuid:: | ||
| Do not try to automatically detect UUID index for this command (required | ||
| for old OCP 1.0 support) | ||
|
|
||
| EXAMPLES | ||
| -------- | ||
| * Has the program issue a get-latency-monitor to retrieve the 0xC5 get features. | ||
| + | ||
| ------------ | ||
| # nvme ocp get-latency-monitor /dev/nvme0 | ||
| ------------ | ||
|
|
||
| NVME | ||
| ---- | ||
| Part of the nvme-user suite. | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1648,6 +1648,10 @@ plugin_ocp_opts () { | |
| opts+=" --comp-id= -i --list -l --verbose -v \ | ||
| --output-format -o --timeout= -t" | ||
| ;; | ||
| "get-latency-monitor") | ||
| opts+=" --sel= -s \ | ||
| --namespace-id= -n --no-uuid -u" | ||
| ;; | ||
|
Contributor
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. Please add
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. @ikegami-t - Incorporated the review comments |
||
| "help") | ||
| opts+=$NO_OPTS | ||
| ;; | ||
|
|
@@ -1729,7 +1733,7 @@ _nvme_subcmds () { | |
| telemetry-string-log set-telemetry-profile \ | ||
| set-dssd-async-event-config get-dssd-async-event-config \ | ||
| get-error-injection set-error-injection \ | ||
| hardware-component-log" | ||
| hardware-component-log get-latency-monitor" | ||
| [mangoboost]="id-ctrl" | ||
| ) | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -423,6 +423,80 @@ int ocp_set_latency_monitor_feature(int argc, char **argv, struct command *cmd, | |
| return err; | ||
| } | ||
|
|
||
| static int ocp_get_latency_monitor_feature(int argc, char **argv, struct command *cmd, | ||
| struct plugin *plugin) | ||
| { | ||
| const char *desc = "Define Issue Get Feature command (FID: 0xC5) Latency Monitor"; | ||
| const char *sel = "[0-3]: current/default/saved/supported/"; | ||
| const char *nsid = "Byte[04-07]: Namespace Identifier Valid/Invalid/Inactive"; | ||
|
|
||
| _cleanup_nvme_dev_ struct nvme_dev *dev = NULL; | ||
|
|
||
|
Contributor
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. No needed to add this blank line. |
||
| __u32 result; | ||
| int err; | ||
| bool uuid; | ||
| __u8 uuid_index = 0; | ||
|
|
||
| struct config { | ||
| __u8 sel; | ||
| __u32 nsid; | ||
| }; | ||
|
|
||
| struct config cfg = { | ||
| .sel = 0, | ||
| .nsid = 0, | ||
| }; | ||
|
|
||
| OPT_ARGS(opts) = { | ||
| OPT_BYTE("sel", 's', &cfg.sel, sel), | ||
| OPT_UINT("namespace-id", 'n', &cfg.nsid, nsid), | ||
| OPT_FLAG("no-uuid", 'u', NULL, no_uuid), | ||
|
Contributor
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. Please update the documentation to add the `no-uuid' parameter. static int eol_plp_failure_mode(int argc, char **argv, struct command *cmd,
struct plugin *plugin)
{
...
err = eol_plp_failure_mode_get(dev, nsid, fid, cfg.sel,
!argconfig_parse_seen(opts, "no-uuid"));And also if the nsid value can be deleted then the
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. @ikegami-t - Incorporated the review comments |
||
| OPT_END() | ||
| }; | ||
|
|
||
| err = parse_and_open(&dev, argc, argv, desc, opts); | ||
| if (err) | ||
| return err; | ||
|
|
||
| uuid = !argconfig_parse_seen(opts, "no-uuid"); | ||
|
|
||
| if (uuid) { | ||
| /* OCP 2.0 requires UUID index support */ | ||
| err = ocp_get_uuid_index(dev, &uuid_index); | ||
| if (err || !uuid_index) { | ||
| nvme_show_error("ERROR: No OCP UUID index found"); | ||
| return err; | ||
| } | ||
| } | ||
|
|
||
|
Contributor
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. No needed to add 2 blank lines but only 1 blank line okay to added.
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. @ikegami-t - incorporated the review comments |
||
| struct nvme_get_features_args args = { | ||
| .args_size = sizeof(args), | ||
| .fd = dev_fd(dev), | ||
| .fid = OCP_FID_LM, | ||
| .nsid = cfg.nsid, | ||
| .sel = cfg.sel, | ||
| .cdw11 = 0, | ||
| .uuidx = uuid_index, | ||
| .data_len = 0, | ||
| .data = NULL, | ||
| .timeout = NVME_DEFAULT_IOCTL_TIMEOUT, | ||
| .result = &result, | ||
| }; | ||
|
|
||
| err = nvme_get_features(&args); | ||
| if (!err) { | ||
| printf("get-feature:0xC5 %s value: %#08x\n", | ||
| nvme_select_to_string(cfg.sel), result); | ||
|
|
||
| if (cfg.sel == NVME_GET_FEATURES_SEL_SUPPORTED) | ||
| nvme_show_select_result(0xC5, result); | ||
|
Contributor
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. - nvme_show_select_result(0xC5, result);
+ nvme_show_select_result(OCP_FID_LM, result);
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. @ikegami-t - We can't pass OCP_FID_LM for this nvme_show_select_result api. Because enum data type is different for that api parameter. |
||
| } else { | ||
| nvme_show_error("Could not get feature: 0xC5"); | ||
| } | ||
|
|
||
| return err; | ||
| } | ||
|
|
||
| /////////////////////////////////////////////////////////////////////////////// | ||
| /////////////////////////////////////////////////////////////////////////////// | ||
| /////////////////////////////////////////////////////////////////////////////// | ||
|
|
||
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.
The
--nsidnot described and also no description for the options-nand--nsid.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.
@ikegami-t incorporated the review comments