[--rae | -r]
[--csi=<command_set_identifier> | -y <command_set_identifier>]
[--ot=<offset_type> | -O <offset_type>]
+ [--xfer-len=<length> | -x <length>]
DESCRIPTION
-----------
The default is byte offset. If the option is specified
the index mode is used.
+-x <length>::
+--xfer-len <length>:
+ Specify the read chunk size. The length argument is expected to be
+ a multiple of 4096. The default size is 4096.
+
EXAMPLES
--------
* Get 512 bytes from log page 2
return do_admin_args_op(get_log, dev, args);
}
+int nvme_cli_get_log_page(struct nvme_dev *dev, __u32 xfer_len,
+ struct nvme_get_log_args *args)
+{
+ return do_admin_op(get_log_page, dev, xfer_len, args);
+}
+
int nvme_cli_get_nsid_log(struct nvme_dev *dev, bool rae,
enum nvme_cmd_get_log_lid lid,
__u32 nsid, __u32 len, void *log)
int nvme_cli_get_log(struct nvme_dev *dev, struct nvme_get_log_args *args);
+int nvme_cli_get_log_page(struct nvme_dev *dev,
+ __u32 xfer_len,
+ struct nvme_get_log_args *args);
int nvme_cli_get_nsid_log(struct nvme_dev *dev, bool rae,
enum nvme_cmd_get_log_lid lid,
const char *raw = "output in raw format";
const char *csi = "command set identifier";
const char *offset_type = "offset type";
+ const char *xfer_len = "read chunk size (default 4k)";
struct nvme_dev *dev;
unsigned char *log;
int err;
bool raw_binary;
__u8 csi;
bool ot;
+ __u32 xfer_len;
};
struct config cfg = {
.raw_binary = false,
.csi = NVME_CSI_NVM,
.ot = false,
+ .xfer_len = 4096,
};
OPT_ARGS(opts) = {
OPT_FLAG("raw-binary", 'b', &cfg.raw_binary, raw),
OPT_BYTE("csi", 'y', &cfg.csi, csi),
OPT_FLAG("ot", 'O', &cfg.ot, offset_type),
+ OPT_UINT("xfer-len", 'x', &cfg.xfer_len, xfer_len),
OPT_END()
};
goto close_dev;
}
+ if (cfg.xfer_len == 0 || cfg.xfer_len % 4096) {
+ fprintf(stderr, "xfer-len argument invalid. It needs to be mulitple of 4k");
+ err = -EINVAL;
+ goto close_dev;
+ }
+
log = malloc(cfg.log_len);
if (!log) {
perror("could not alloc buffer for log\n");
.log = log,
.result = NULL,
};
- err = nvme_cli_get_log(dev, &args);
+ err = nvme_cli_get_log_page(dev, cfg.xfer_len, &args);
if (!err) {
if (!cfg.raw_binary) {
printf("Device:%s log-id:%d namespace-id:%#x\n",