]> www.infradead.org Git - users/sagi/nvme-cli.git/commitdiff
fdp: set-events feature is saveable
authorSteven Seungcheol Lee <sc108.lee@samsung.com>
Mon, 17 Apr 2023 05:17:41 +0000 (14:17 +0900)
committerDaniel Wagner <wagi@monom.org>
Mon, 17 Apr 2023 08:32:42 +0000 (10:32 +0200)
TP4146 Flexible Data Placement 2022.11.30 Ratified
5.27.1.TBD1 Flexible Data Placement Events (Feature Identifier 1Eh)
mentioned as below
This Feature shall be saveable (refer to section 4.2).

Signed-off-by: Steven Seungcheol Lee <sc108.lee@samsung.com>
Reported-by: Youngjin Jung <yj4369.jung@samsung.com>
plugins/fdp/fdp.c

index 1e292e8cfaa881e6a3075f276bb484d59e528940..34253d7c0cad558088db4535a026564689c069ba 100644 (file)
@@ -449,6 +449,7 @@ static int fdp_set_events(int argc, char **argv, struct command *cmd, struct plu
        const char *enable = "Enable/disable event";
        const char *event_types = "Comma-separated list of event types";
        const char *ph = "Placement Handle";
+       const char *save = "specifies that the controller shall save the attribute";
 
        struct nvme_dev *dev;
        int err = -1;
@@ -461,16 +462,19 @@ static int fdp_set_events(int argc, char **argv, struct command *cmd, struct plu
                __u16   ph;
                char    *event_types;
                bool    enable;
+               bool    save;
        };
 
        struct config cfg = {
                .enable = false,
+               .save   = false,
        };
 
        OPT_ARGS(opts) = {
                OPT_UINT("namespace-id",     'n', &cfg.namespace_id, namespace_id),
                OPT_SHRT("placement-handle", 'p', &cfg.ph,           ph),
                OPT_FLAG("enable",           'e', &cfg.enable,       enable),
+               OPT_FLAG("save",             's', &cfg.save,         save),
                OPT_LIST("event-types",      't', &cfg.event_types,  event_types),
                OPT_END()
        };
@@ -514,6 +518,7 @@ static int fdp_set_events(int argc, char **argv, struct command *cmd, struct plu
                .args_size      = sizeof(args),
                .fd             = dev_fd(dev),
                .fid            = NVME_FEAT_FID_FDP_EVENTS,
+               .save           = cfg.save,
                .nsid           = cfg.namespace_id,
                .cdw11          = (nev << 16) | cfg.ph,
                .cdw12          = cfg.enable ? 0x1 : 0x0,