| File: | .build-ci/../src/nvme-cmds-passthru.c |
| Warning: | line 257, column 4 Potential leak of memory pointed to by 'mdata' |
Press '?' to see keyboard shortcuts
Keyboard shortcuts:
| 1 | // SPDX-License-Identifier: GPL-2.0-or-later | |||
| 2 | /* | |||
| 3 | * NVM-Express command line utility. | |||
| 4 | * | |||
| 5 | * Copyright (c) 2014-2015, Intel Corporation. | |||
| 6 | * | |||
| 7 | * Written by Keith Busch <kbusch@kernel.org> | |||
| 8 | */ | |||
| 9 | ||||
| 10 | /** | |||
| 11 | * This program uses NVMe IOCTLs to run native nvme commands to a device. | |||
| 12 | */ | |||
| 13 | #include <dirent.h> | |||
| 14 | #include <errno(*__errno_location ()).h> | |||
| 15 | #include <fcntl.h> | |||
| 16 | #include <getopt.h> | |||
| 17 | #include <inttypes.h> | |||
| 18 | #include <libgen.h> | |||
| 19 | #include <locale.h> | |||
| 20 | #include <math.h> | |||
| 21 | #include <signal.h> | |||
| 22 | #include <stdint.h> | |||
| 23 | #include <stdio.h> | |||
| 24 | #include <stdlib.h> | |||
| 25 | #include <string.h> | |||
| 26 | #include <unistd.h> | |||
| 27 | ||||
| 28 | #ifdef NVME_HAVE_MMAP | |||
| 29 | #include <sys/mman.h> | |||
| 30 | #endif | |||
| 31 | #include <sys/stat.h> | |||
| 32 | #include <sys/types.h> | |||
| 33 | ||||
| 34 | #include <libnvme-mi.h> | |||
| 35 | #include <libnvme.h> | |||
| 36 | ||||
| 37 | #include <ccan/array_size/array_size.h> | |||
| 38 | #include <ccan/endian/endian.h> | |||
| 39 | #include <ccan/minmax/minmax.h> | |||
| 40 | #include <shared/compiler-attributes-util.h> | |||
| 41 | #include <shared/fs-util.h> | |||
| 42 | #include <shared/mmio-util.h> | |||
| 43 | #include <shared/parse-util.h> | |||
| 44 | #include <shared/sig-util.h> | |||
| 45 | #include <shared/suffix-util.h> | |||
| 46 | #include <shared/time-util.h> | |||
| 47 | ||||
| 48 | #include "argconfig.h" | |||
| 49 | #include "cleanup.h" | |||
| 50 | #include "global-ctx.h" | |||
| 51 | #include "logging.h" | |||
| 52 | #include "nvme-cmds-common.h" | |||
| 53 | #include "nvme-print.h" | |||
| 54 | #include "plugin.h" | |||
| 55 | ||||
| 56 | static const char *latency = "output latency statistics"; | |||
| 57 | static const char *namespace_desired = "desired namespace"; | |||
| 58 | static const char *raw_dump = "dump output in binary format"; | |||
| 59 | ||||
| 60 | static void passthru_print_read_output(struct passthru_config cfg, void *data, int dfd, void *mdata, | |||
| 61 | int mfd, int err) | |||
| 62 | { | |||
| 63 | if (strlen(cfg.input_file)) { | |||
| 64 | if (write(dfd, (void *)data, cfg.data_len) < 0) | |||
| 65 | perror("failed to write data buffer"); | |||
| 66 | } else if (data) { | |||
| 67 | if (cfg.raw_binary) | |||
| 68 | d_raw((unsigned char *)data, cfg.data_len); | |||
| 69 | else if (!err) | |||
| 70 | d((unsigned char *)data, cfg.data_len, 16, 1); | |||
| 71 | } | |||
| 72 | if (cfg.metadata_len && cfg.metadata) { | |||
| 73 | if (strlen(cfg.metadata)) { | |||
| 74 | if (write(mfd, (void *)mdata, cfg.metadata_len) < 0) | |||
| 75 | perror("failed to write metadata buffer"); | |||
| 76 | } else { | |||
| 77 | if (cfg.raw_binary) | |||
| 78 | d_raw((unsigned char *)mdata, cfg.metadata_len); | |||
| 79 | else if (!err) | |||
| 80 | d((unsigned char *)mdata, cfg.metadata_len, 16, 1); | |||
| 81 | } | |||
| 82 | } | |||
| 83 | } | |||
| 84 | ||||
| 85 | static int passthru(int argc, char **argv, bool_Bool admin, | |||
| 86 | const char *desc, struct command *acmd) | |||
| 87 | { | |||
| 88 | const char *opcode = "opcode (required)"; | |||
| 89 | const char *cflags = "command flags"; | |||
| 90 | const char *rsvd = "value for reserved field"; | |||
| 91 | const char *data_len = "data I/O length (bytes)"; | |||
| 92 | const char *metadata_len = "metadata seg. length (bytes)"; | |||
| 93 | const char *metadata = "metadata input or output file"; | |||
| 94 | const char *cdw2 = "command dword 2 value"; | |||
| 95 | const char *cdw3 = "command dword 3 value"; | |||
| 96 | const char *cdw10 = "command dword 10 value"; | |||
| 97 | const char *cdw11 = "command dword 11 value"; | |||
| 98 | const char *cdw12 = "command dword 12 value"; | |||
| 99 | const char *cdw13 = "command dword 13 value"; | |||
| 100 | const char *cdw14 = "command dword 14 value"; | |||
| 101 | const char *cdw15 = "command dword 15 value"; | |||
| 102 | const char *input = "data input or output file"; | |||
| 103 | const char *show = "print command before sending"; | |||
| 104 | const char *re = "set dataflow direction to receive"; | |||
| 105 | const char *wr = "set dataflow direction to send"; | |||
| 106 | const char *prefill = "prefill buffers with known byte-value, default 0"; | |||
| 107 | ||||
| 108 | __cleanup_huge__attribute__((cleanup(libnvme_free_huge))) struct libnvme_mem_huge mh = { 0, }; | |||
| 109 | __cleanup_nvme_global_ctx__attribute__((cleanup(cleanup_nvme_global_ctx))) struct libnvme_global_ctx *ctx = NULL((void*)0); | |||
| 110 | __cleanup_nvme_transport_handle__attribute__((cleanup(cleanup_nvme_transport_handle))) struct libnvme_transport_handle *hdl = NULL((void*)0); | |||
| 111 | __cleanup_fd__attribute__((cleanup(shr_cleanup_fd))) int dfd = -1, mfd = -1; | |||
| 112 | int flags = -1; | |||
| 113 | int mode = 0644; | |||
| 114 | void *data = NULL((void*)0); | |||
| 115 | __cleanup_free__attribute__((cleanup(shr_freep))) void *mdata = NULL((void*)0); | |||
| 116 | int err = 0; | |||
| 117 | const char *cmd_name = NULL((void*)0); | |||
| 118 | struct timeval start_time, end_time; | |||
| 119 | nvme_print_flags_t flags_t; | |||
| 120 | ||||
| 121 | struct passthru_config cfg = { | |||
| 122 | .opcode = 0, | |||
| 123 | .flags = 0, | |||
| 124 | .prefill = 0, | |||
| 125 | .rsvd = 0, | |||
| 126 | .namespace_id = 0, | |||
| 127 | .data_len = 0, | |||
| 128 | .metadata_len = 0, | |||
| 129 | .cdw2 = 0, | |||
| 130 | .cdw3 = 0, | |||
| 131 | .cdw10 = 0, | |||
| 132 | .cdw11 = 0, | |||
| 133 | .cdw12 = 0, | |||
| 134 | .cdw13 = 0, | |||
| 135 | .cdw14 = 0, | |||
| 136 | .cdw15 = 0, | |||
| 137 | .input_file = "", | |||
| 138 | .metadata = "", | |||
| 139 | .raw_binary = false0, | |||
| 140 | .show_command = false0, | |||
| 141 | .read = false0, | |||
| 142 | .write = false0, | |||
| 143 | .latency = false0, | |||
| 144 | }; | |||
| 145 | ||||
| 146 | NVME_ARGS(opts,nvme_args.supported_output_formats = (NORMAL | JSON | BINARY) ; struct argconfig_commandline_options opts[] = { {"", 0, ((void *)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Options", 0, ((void *)0)}, {"opcode", 'O', "NUM", CFG_BYTE, &cfg.opcode, 1, opcode , 0, }, {"flags", 'f', "NUM", CFG_BYTE, &cfg.flags, 1, cflags , 0, }, {"prefill", 'p', "NUM", CFG_BYTE, &cfg.prefill, 1 , prefill, 0, }, {"rsvd", 'R', "NUM", CFG_SHORT, &cfg.rsvd , 1, rsvd, 0, }, {"namespace-id", 'n', "NUM", CFG_POSITIVE, & cfg.namespace_id, 1, namespace_desired, 0, }, {"data-len", 'l' , "NUM", CFG_POSITIVE, &cfg.data_len, 1, data_len, 0, }, { "metadata-len", 'm', "NUM", CFG_POSITIVE, &cfg.metadata_len , 1, metadata_len, 0, }, {"cdw2", '2', "NUM", CFG_POSITIVE, & cfg.cdw2, 1, cdw2, 0, }, {"cdw3", '3', "NUM", CFG_POSITIVE, & cfg.cdw3, 1, cdw3, 0, }, {"cdw10", '4', "NUM", CFG_POSITIVE, & cfg.cdw10, 1, cdw10, 0, }, {"cdw11", '5', "NUM", CFG_POSITIVE , &cfg.cdw11, 1, cdw11, 0, }, {"cdw12", '6', "NUM", CFG_POSITIVE , &cfg.cdw12, 1, cdw12, 0, }, {"cdw13", '7', "NUM", CFG_POSITIVE , &cfg.cdw13, 1, cdw13, 0, }, {"cdw14", '8', "NUM", CFG_POSITIVE , &cfg.cdw14, 1, cdw14, 0, }, {"cdw15", '9', "NUM", CFG_POSITIVE , &cfg.cdw15, 1, cdw15, 0, }, {"input-file", 'i', "FILE", CFG_STRING, &cfg.input_file, 1, input, 0, }, {"metadata" , 'M', "FILE", CFG_STRING, &cfg.metadata, 1, metadata, 0, }, {"raw-binary", 'b', ((void*)0), CFG_FLAG, &cfg.raw_binary , 0, raw_dump, 0, }, {"show-command", 's', ((void*)0), CFG_FLAG , &cfg.show_command, 0, show, 0, }, {"read", 'r', ((void* )0), CFG_FLAG, &cfg.read, 0, re, 0, }, {"write", 'w', ((void *)0), CFG_FLAG, &cfg.write, 0, wr, 0, }, {"latency", 'T', ((void*)0), CFG_FLAG, &cfg.latency, 0, latency, 0, }, {"" , 0, ((void*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Global options" , 0, ((void*)0)}, {"verbose", 'v', "NUM", CFG_INCREMENT, & nvme_args.verbose, 0, "Increase output verbosity", 0, }, {"quiet" , 0, ((void*)0), CFG_FLAG, &nvme_args.quiet, 0, "suppress informational output" , 0, }, {"output-format", 'o', "FMT", CFG_STRING, &nvme_args .output_format, 1, "Output format: normal|json|binary", 0, }, {"timeout", 0, "NUM", CFG_POSITIVE, &nvme_args.timeout, 1 , "timeout value, in milliseconds", 0, }, {"dry-run", 0, ((void *)0), CFG_FLAG, &nvme_args.dry_run, 0, "show command instead of executing" , 0, }, {"no-retries", 0, ((void*)0), CFG_FLAG, &nvme_args .no_retries, 0, "disable retry logic on errors", 0, }, {"no-ioctl-probing" , 0, ((void*)0), CFG_FLAG, &nvme_args.no_ioctl_probing, 0 , "disable 64-bit IOCTL support probing", 0, }, {"output-format-version" , 0, "NUM", CFG_POSITIVE, &nvme_args.output_format_ver, 1 , "output format version: 1|2", 0, }, {"human-readable", 'H', ((void*)0), CFG_FLAG, &nvme_args.verbose, 0, ((void*)0), 0, ((void*)0), 1}, {"set-options", 0, "KEY=VALUE", CFG_STRING , &nvme_args.set_options, 1, "set a libnvme library option (key=value[,key=value,...]);" , 0, }, { ((void*)0) } } | |||
| 147 | OPT_BYTE("opcode", 'O', &cfg.opcode, opcode),nvme_args.supported_output_formats = (NORMAL | JSON | BINARY) ; struct argconfig_commandline_options opts[] = { {"", 0, ((void *)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Options", 0, ((void *)0)}, {"opcode", 'O', "NUM", CFG_BYTE, &cfg.opcode, 1, opcode , 0, }, {"flags", 'f', "NUM", CFG_BYTE, &cfg.flags, 1, cflags , 0, }, {"prefill", 'p', "NUM", CFG_BYTE, &cfg.prefill, 1 , prefill, 0, }, {"rsvd", 'R', "NUM", CFG_SHORT, &cfg.rsvd , 1, rsvd, 0, }, {"namespace-id", 'n', "NUM", CFG_POSITIVE, & cfg.namespace_id, 1, namespace_desired, 0, }, {"data-len", 'l' , "NUM", CFG_POSITIVE, &cfg.data_len, 1, data_len, 0, }, { "metadata-len", 'm', "NUM", CFG_POSITIVE, &cfg.metadata_len , 1, metadata_len, 0, }, {"cdw2", '2', "NUM", CFG_POSITIVE, & cfg.cdw2, 1, cdw2, 0, }, {"cdw3", '3', "NUM", CFG_POSITIVE, & cfg.cdw3, 1, cdw3, 0, }, {"cdw10", '4', "NUM", CFG_POSITIVE, & cfg.cdw10, 1, cdw10, 0, }, {"cdw11", '5', "NUM", CFG_POSITIVE , &cfg.cdw11, 1, cdw11, 0, }, {"cdw12", '6', "NUM", CFG_POSITIVE , &cfg.cdw12, 1, cdw12, 0, }, {"cdw13", '7', "NUM", CFG_POSITIVE , &cfg.cdw13, 1, cdw13, 0, }, {"cdw14", '8', "NUM", CFG_POSITIVE , &cfg.cdw14, 1, cdw14, 0, }, {"cdw15", '9', "NUM", CFG_POSITIVE , &cfg.cdw15, 1, cdw15, 0, }, {"input-file", 'i', "FILE", CFG_STRING, &cfg.input_file, 1, input, 0, }, {"metadata" , 'M', "FILE", CFG_STRING, &cfg.metadata, 1, metadata, 0, }, {"raw-binary", 'b', ((void*)0), CFG_FLAG, &cfg.raw_binary , 0, raw_dump, 0, }, {"show-command", 's', ((void*)0), CFG_FLAG , &cfg.show_command, 0, show, 0, }, {"read", 'r', ((void* )0), CFG_FLAG, &cfg.read, 0, re, 0, }, {"write", 'w', ((void *)0), CFG_FLAG, &cfg.write, 0, wr, 0, }, {"latency", 'T', ((void*)0), CFG_FLAG, &cfg.latency, 0, latency, 0, }, {"" , 0, ((void*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Global options" , 0, ((void*)0)}, {"verbose", 'v', "NUM", CFG_INCREMENT, & nvme_args.verbose, 0, "Increase output verbosity", 0, }, {"quiet" , 0, ((void*)0), CFG_FLAG, &nvme_args.quiet, 0, "suppress informational output" , 0, }, {"output-format", 'o', "FMT", CFG_STRING, &nvme_args .output_format, 1, "Output format: normal|json|binary", 0, }, {"timeout", 0, "NUM", CFG_POSITIVE, &nvme_args.timeout, 1 , "timeout value, in milliseconds", 0, }, {"dry-run", 0, ((void *)0), CFG_FLAG, &nvme_args.dry_run, 0, "show command instead of executing" , 0, }, {"no-retries", 0, ((void*)0), CFG_FLAG, &nvme_args .no_retries, 0, "disable retry logic on errors", 0, }, {"no-ioctl-probing" , 0, ((void*)0), CFG_FLAG, &nvme_args.no_ioctl_probing, 0 , "disable 64-bit IOCTL support probing", 0, }, {"output-format-version" , 0, "NUM", CFG_POSITIVE, &nvme_args.output_format_ver, 1 , "output format version: 1|2", 0, }, {"human-readable", 'H', ((void*)0), CFG_FLAG, &nvme_args.verbose, 0, ((void*)0), 0, ((void*)0), 1}, {"set-options", 0, "KEY=VALUE", CFG_STRING , &nvme_args.set_options, 1, "set a libnvme library option (key=value[,key=value,...]);" , 0, }, { ((void*)0) } } | |||
| 148 | OPT_BYTE("flags", 'f', &cfg.flags, cflags),nvme_args.supported_output_formats = (NORMAL | JSON | BINARY) ; struct argconfig_commandline_options opts[] = { {"", 0, ((void *)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Options", 0, ((void *)0)}, {"opcode", 'O', "NUM", CFG_BYTE, &cfg.opcode, 1, opcode , 0, }, {"flags", 'f', "NUM", CFG_BYTE, &cfg.flags, 1, cflags , 0, }, {"prefill", 'p', "NUM", CFG_BYTE, &cfg.prefill, 1 , prefill, 0, }, {"rsvd", 'R', "NUM", CFG_SHORT, &cfg.rsvd , 1, rsvd, 0, }, {"namespace-id", 'n', "NUM", CFG_POSITIVE, & cfg.namespace_id, 1, namespace_desired, 0, }, {"data-len", 'l' , "NUM", CFG_POSITIVE, &cfg.data_len, 1, data_len, 0, }, { "metadata-len", 'm', "NUM", CFG_POSITIVE, &cfg.metadata_len , 1, metadata_len, 0, }, {"cdw2", '2', "NUM", CFG_POSITIVE, & cfg.cdw2, 1, cdw2, 0, }, {"cdw3", '3', "NUM", CFG_POSITIVE, & cfg.cdw3, 1, cdw3, 0, }, {"cdw10", '4', "NUM", CFG_POSITIVE, & cfg.cdw10, 1, cdw10, 0, }, {"cdw11", '5', "NUM", CFG_POSITIVE , &cfg.cdw11, 1, cdw11, 0, }, {"cdw12", '6', "NUM", CFG_POSITIVE , &cfg.cdw12, 1, cdw12, 0, }, {"cdw13", '7', "NUM", CFG_POSITIVE , &cfg.cdw13, 1, cdw13, 0, }, {"cdw14", '8', "NUM", CFG_POSITIVE , &cfg.cdw14, 1, cdw14, 0, }, {"cdw15", '9', "NUM", CFG_POSITIVE , &cfg.cdw15, 1, cdw15, 0, }, {"input-file", 'i', "FILE", CFG_STRING, &cfg.input_file, 1, input, 0, }, {"metadata" , 'M', "FILE", CFG_STRING, &cfg.metadata, 1, metadata, 0, }, {"raw-binary", 'b', ((void*)0), CFG_FLAG, &cfg.raw_binary , 0, raw_dump, 0, }, {"show-command", 's', ((void*)0), CFG_FLAG , &cfg.show_command, 0, show, 0, }, {"read", 'r', ((void* )0), CFG_FLAG, &cfg.read, 0, re, 0, }, {"write", 'w', ((void *)0), CFG_FLAG, &cfg.write, 0, wr, 0, }, {"latency", 'T', ((void*)0), CFG_FLAG, &cfg.latency, 0, latency, 0, }, {"" , 0, ((void*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Global options" , 0, ((void*)0)}, {"verbose", 'v', "NUM", CFG_INCREMENT, & nvme_args.verbose, 0, "Increase output verbosity", 0, }, {"quiet" , 0, ((void*)0), CFG_FLAG, &nvme_args.quiet, 0, "suppress informational output" , 0, }, {"output-format", 'o', "FMT", CFG_STRING, &nvme_args .output_format, 1, "Output format: normal|json|binary", 0, }, {"timeout", 0, "NUM", CFG_POSITIVE, &nvme_args.timeout, 1 , "timeout value, in milliseconds", 0, }, {"dry-run", 0, ((void *)0), CFG_FLAG, &nvme_args.dry_run, 0, "show command instead of executing" , 0, }, {"no-retries", 0, ((void*)0), CFG_FLAG, &nvme_args .no_retries, 0, "disable retry logic on errors", 0, }, {"no-ioctl-probing" , 0, ((void*)0), CFG_FLAG, &nvme_args.no_ioctl_probing, 0 , "disable 64-bit IOCTL support probing", 0, }, {"output-format-version" , 0, "NUM", CFG_POSITIVE, &nvme_args.output_format_ver, 1 , "output format version: 1|2", 0, }, {"human-readable", 'H', ((void*)0), CFG_FLAG, &nvme_args.verbose, 0, ((void*)0), 0, ((void*)0), 1}, {"set-options", 0, "KEY=VALUE", CFG_STRING , &nvme_args.set_options, 1, "set a libnvme library option (key=value[,key=value,...]);" , 0, }, { ((void*)0) } } | |||
| 149 | OPT_BYTE("prefill", 'p', &cfg.prefill, prefill),nvme_args.supported_output_formats = (NORMAL | JSON | BINARY) ; struct argconfig_commandline_options opts[] = { {"", 0, ((void *)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Options", 0, ((void *)0)}, {"opcode", 'O', "NUM", CFG_BYTE, &cfg.opcode, 1, opcode , 0, }, {"flags", 'f', "NUM", CFG_BYTE, &cfg.flags, 1, cflags , 0, }, {"prefill", 'p', "NUM", CFG_BYTE, &cfg.prefill, 1 , prefill, 0, }, {"rsvd", 'R', "NUM", CFG_SHORT, &cfg.rsvd , 1, rsvd, 0, }, {"namespace-id", 'n', "NUM", CFG_POSITIVE, & cfg.namespace_id, 1, namespace_desired, 0, }, {"data-len", 'l' , "NUM", CFG_POSITIVE, &cfg.data_len, 1, data_len, 0, }, { "metadata-len", 'm', "NUM", CFG_POSITIVE, &cfg.metadata_len , 1, metadata_len, 0, }, {"cdw2", '2', "NUM", CFG_POSITIVE, & cfg.cdw2, 1, cdw2, 0, }, {"cdw3", '3', "NUM", CFG_POSITIVE, & cfg.cdw3, 1, cdw3, 0, }, {"cdw10", '4', "NUM", CFG_POSITIVE, & cfg.cdw10, 1, cdw10, 0, }, {"cdw11", '5', "NUM", CFG_POSITIVE , &cfg.cdw11, 1, cdw11, 0, }, {"cdw12", '6', "NUM", CFG_POSITIVE , &cfg.cdw12, 1, cdw12, 0, }, {"cdw13", '7', "NUM", CFG_POSITIVE , &cfg.cdw13, 1, cdw13, 0, }, {"cdw14", '8', "NUM", CFG_POSITIVE , &cfg.cdw14, 1, cdw14, 0, }, {"cdw15", '9', "NUM", CFG_POSITIVE , &cfg.cdw15, 1, cdw15, 0, }, {"input-file", 'i', "FILE", CFG_STRING, &cfg.input_file, 1, input, 0, }, {"metadata" , 'M', "FILE", CFG_STRING, &cfg.metadata, 1, metadata, 0, }, {"raw-binary", 'b', ((void*)0), CFG_FLAG, &cfg.raw_binary , 0, raw_dump, 0, }, {"show-command", 's', ((void*)0), CFG_FLAG , &cfg.show_command, 0, show, 0, }, {"read", 'r', ((void* )0), CFG_FLAG, &cfg.read, 0, re, 0, }, {"write", 'w', ((void *)0), CFG_FLAG, &cfg.write, 0, wr, 0, }, {"latency", 'T', ((void*)0), CFG_FLAG, &cfg.latency, 0, latency, 0, }, {"" , 0, ((void*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Global options" , 0, ((void*)0)}, {"verbose", 'v', "NUM", CFG_INCREMENT, & nvme_args.verbose, 0, "Increase output verbosity", 0, }, {"quiet" , 0, ((void*)0), CFG_FLAG, &nvme_args.quiet, 0, "suppress informational output" , 0, }, {"output-format", 'o', "FMT", CFG_STRING, &nvme_args .output_format, 1, "Output format: normal|json|binary", 0, }, {"timeout", 0, "NUM", CFG_POSITIVE, &nvme_args.timeout, 1 , "timeout value, in milliseconds", 0, }, {"dry-run", 0, ((void *)0), CFG_FLAG, &nvme_args.dry_run, 0, "show command instead of executing" , 0, }, {"no-retries", 0, ((void*)0), CFG_FLAG, &nvme_args .no_retries, 0, "disable retry logic on errors", 0, }, {"no-ioctl-probing" , 0, ((void*)0), CFG_FLAG, &nvme_args.no_ioctl_probing, 0 , "disable 64-bit IOCTL support probing", 0, }, {"output-format-version" , 0, "NUM", CFG_POSITIVE, &nvme_args.output_format_ver, 1 , "output format version: 1|2", 0, }, {"human-readable", 'H', ((void*)0), CFG_FLAG, &nvme_args.verbose, 0, ((void*)0), 0, ((void*)0), 1}, {"set-options", 0, "KEY=VALUE", CFG_STRING , &nvme_args.set_options, 1, "set a libnvme library option (key=value[,key=value,...]);" , 0, }, { ((void*)0) } } | |||
| 150 | OPT_SHRT("rsvd", 'R', &cfg.rsvd, rsvd),nvme_args.supported_output_formats = (NORMAL | JSON | BINARY) ; struct argconfig_commandline_options opts[] = { {"", 0, ((void *)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Options", 0, ((void *)0)}, {"opcode", 'O', "NUM", CFG_BYTE, &cfg.opcode, 1, opcode , 0, }, {"flags", 'f', "NUM", CFG_BYTE, &cfg.flags, 1, cflags , 0, }, {"prefill", 'p', "NUM", CFG_BYTE, &cfg.prefill, 1 , prefill, 0, }, {"rsvd", 'R', "NUM", CFG_SHORT, &cfg.rsvd , 1, rsvd, 0, }, {"namespace-id", 'n', "NUM", CFG_POSITIVE, & cfg.namespace_id, 1, namespace_desired, 0, }, {"data-len", 'l' , "NUM", CFG_POSITIVE, &cfg.data_len, 1, data_len, 0, }, { "metadata-len", 'm', "NUM", CFG_POSITIVE, &cfg.metadata_len , 1, metadata_len, 0, }, {"cdw2", '2', "NUM", CFG_POSITIVE, & cfg.cdw2, 1, cdw2, 0, }, {"cdw3", '3', "NUM", CFG_POSITIVE, & cfg.cdw3, 1, cdw3, 0, }, {"cdw10", '4', "NUM", CFG_POSITIVE, & cfg.cdw10, 1, cdw10, 0, }, {"cdw11", '5', "NUM", CFG_POSITIVE , &cfg.cdw11, 1, cdw11, 0, }, {"cdw12", '6', "NUM", CFG_POSITIVE , &cfg.cdw12, 1, cdw12, 0, }, {"cdw13", '7', "NUM", CFG_POSITIVE , &cfg.cdw13, 1, cdw13, 0, }, {"cdw14", '8', "NUM", CFG_POSITIVE , &cfg.cdw14, 1, cdw14, 0, }, {"cdw15", '9', "NUM", CFG_POSITIVE , &cfg.cdw15, 1, cdw15, 0, }, {"input-file", 'i', "FILE", CFG_STRING, &cfg.input_file, 1, input, 0, }, {"metadata" , 'M', "FILE", CFG_STRING, &cfg.metadata, 1, metadata, 0, }, {"raw-binary", 'b', ((void*)0), CFG_FLAG, &cfg.raw_binary , 0, raw_dump, 0, }, {"show-command", 's', ((void*)0), CFG_FLAG , &cfg.show_command, 0, show, 0, }, {"read", 'r', ((void* )0), CFG_FLAG, &cfg.read, 0, re, 0, }, {"write", 'w', ((void *)0), CFG_FLAG, &cfg.write, 0, wr, 0, }, {"latency", 'T', ((void*)0), CFG_FLAG, &cfg.latency, 0, latency, 0, }, {"" , 0, ((void*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Global options" , 0, ((void*)0)}, {"verbose", 'v', "NUM", CFG_INCREMENT, & nvme_args.verbose, 0, "Increase output verbosity", 0, }, {"quiet" , 0, ((void*)0), CFG_FLAG, &nvme_args.quiet, 0, "suppress informational output" , 0, }, {"output-format", 'o', "FMT", CFG_STRING, &nvme_args .output_format, 1, "Output format: normal|json|binary", 0, }, {"timeout", 0, "NUM", CFG_POSITIVE, &nvme_args.timeout, 1 , "timeout value, in milliseconds", 0, }, {"dry-run", 0, ((void *)0), CFG_FLAG, &nvme_args.dry_run, 0, "show command instead of executing" , 0, }, {"no-retries", 0, ((void*)0), CFG_FLAG, &nvme_args .no_retries, 0, "disable retry logic on errors", 0, }, {"no-ioctl-probing" , 0, ((void*)0), CFG_FLAG, &nvme_args.no_ioctl_probing, 0 , "disable 64-bit IOCTL support probing", 0, }, {"output-format-version" , 0, "NUM", CFG_POSITIVE, &nvme_args.output_format_ver, 1 , "output format version: 1|2", 0, }, {"human-readable", 'H', ((void*)0), CFG_FLAG, &nvme_args.verbose, 0, ((void*)0), 0, ((void*)0), 1}, {"set-options", 0, "KEY=VALUE", CFG_STRING , &nvme_args.set_options, 1, "set a libnvme library option (key=value[,key=value,...]);" , 0, }, { ((void*)0) } } | |||
| 151 | OPT_UINT("namespace-id", 'n', &cfg.namespace_id, namespace_desired),nvme_args.supported_output_formats = (NORMAL | JSON | BINARY) ; struct argconfig_commandline_options opts[] = { {"", 0, ((void *)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Options", 0, ((void *)0)}, {"opcode", 'O', "NUM", CFG_BYTE, &cfg.opcode, 1, opcode , 0, }, {"flags", 'f', "NUM", CFG_BYTE, &cfg.flags, 1, cflags , 0, }, {"prefill", 'p', "NUM", CFG_BYTE, &cfg.prefill, 1 , prefill, 0, }, {"rsvd", 'R', "NUM", CFG_SHORT, &cfg.rsvd , 1, rsvd, 0, }, {"namespace-id", 'n', "NUM", CFG_POSITIVE, & cfg.namespace_id, 1, namespace_desired, 0, }, {"data-len", 'l' , "NUM", CFG_POSITIVE, &cfg.data_len, 1, data_len, 0, }, { "metadata-len", 'm', "NUM", CFG_POSITIVE, &cfg.metadata_len , 1, metadata_len, 0, }, {"cdw2", '2', "NUM", CFG_POSITIVE, & cfg.cdw2, 1, cdw2, 0, }, {"cdw3", '3', "NUM", CFG_POSITIVE, & cfg.cdw3, 1, cdw3, 0, }, {"cdw10", '4', "NUM", CFG_POSITIVE, & cfg.cdw10, 1, cdw10, 0, }, {"cdw11", '5', "NUM", CFG_POSITIVE , &cfg.cdw11, 1, cdw11, 0, }, {"cdw12", '6', "NUM", CFG_POSITIVE , &cfg.cdw12, 1, cdw12, 0, }, {"cdw13", '7', "NUM", CFG_POSITIVE , &cfg.cdw13, 1, cdw13, 0, }, {"cdw14", '8', "NUM", CFG_POSITIVE , &cfg.cdw14, 1, cdw14, 0, }, {"cdw15", '9', "NUM", CFG_POSITIVE , &cfg.cdw15, 1, cdw15, 0, }, {"input-file", 'i', "FILE", CFG_STRING, &cfg.input_file, 1, input, 0, }, {"metadata" , 'M', "FILE", CFG_STRING, &cfg.metadata, 1, metadata, 0, }, {"raw-binary", 'b', ((void*)0), CFG_FLAG, &cfg.raw_binary , 0, raw_dump, 0, }, {"show-command", 's', ((void*)0), CFG_FLAG , &cfg.show_command, 0, show, 0, }, {"read", 'r', ((void* )0), CFG_FLAG, &cfg.read, 0, re, 0, }, {"write", 'w', ((void *)0), CFG_FLAG, &cfg.write, 0, wr, 0, }, {"latency", 'T', ((void*)0), CFG_FLAG, &cfg.latency, 0, latency, 0, }, {"" , 0, ((void*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Global options" , 0, ((void*)0)}, {"verbose", 'v', "NUM", CFG_INCREMENT, & nvme_args.verbose, 0, "Increase output verbosity", 0, }, {"quiet" , 0, ((void*)0), CFG_FLAG, &nvme_args.quiet, 0, "suppress informational output" , 0, }, {"output-format", 'o', "FMT", CFG_STRING, &nvme_args .output_format, 1, "Output format: normal|json|binary", 0, }, {"timeout", 0, "NUM", CFG_POSITIVE, &nvme_args.timeout, 1 , "timeout value, in milliseconds", 0, }, {"dry-run", 0, ((void *)0), CFG_FLAG, &nvme_args.dry_run, 0, "show command instead of executing" , 0, }, {"no-retries", 0, ((void*)0), CFG_FLAG, &nvme_args .no_retries, 0, "disable retry logic on errors", 0, }, {"no-ioctl-probing" , 0, ((void*)0), CFG_FLAG, &nvme_args.no_ioctl_probing, 0 , "disable 64-bit IOCTL support probing", 0, }, {"output-format-version" , 0, "NUM", CFG_POSITIVE, &nvme_args.output_format_ver, 1 , "output format version: 1|2", 0, }, {"human-readable", 'H', ((void*)0), CFG_FLAG, &nvme_args.verbose, 0, ((void*)0), 0, ((void*)0), 1}, {"set-options", 0, "KEY=VALUE", CFG_STRING , &nvme_args.set_options, 1, "set a libnvme library option (key=value[,key=value,...]);" , 0, }, { ((void*)0) } } | |||
| 152 | OPT_UINT("data-len", 'l', &cfg.data_len, data_len),nvme_args.supported_output_formats = (NORMAL | JSON | BINARY) ; struct argconfig_commandline_options opts[] = { {"", 0, ((void *)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Options", 0, ((void *)0)}, {"opcode", 'O', "NUM", CFG_BYTE, &cfg.opcode, 1, opcode , 0, }, {"flags", 'f', "NUM", CFG_BYTE, &cfg.flags, 1, cflags , 0, }, {"prefill", 'p', "NUM", CFG_BYTE, &cfg.prefill, 1 , prefill, 0, }, {"rsvd", 'R', "NUM", CFG_SHORT, &cfg.rsvd , 1, rsvd, 0, }, {"namespace-id", 'n', "NUM", CFG_POSITIVE, & cfg.namespace_id, 1, namespace_desired, 0, }, {"data-len", 'l' , "NUM", CFG_POSITIVE, &cfg.data_len, 1, data_len, 0, }, { "metadata-len", 'm', "NUM", CFG_POSITIVE, &cfg.metadata_len , 1, metadata_len, 0, }, {"cdw2", '2', "NUM", CFG_POSITIVE, & cfg.cdw2, 1, cdw2, 0, }, {"cdw3", '3', "NUM", CFG_POSITIVE, & cfg.cdw3, 1, cdw3, 0, }, {"cdw10", '4', "NUM", CFG_POSITIVE, & cfg.cdw10, 1, cdw10, 0, }, {"cdw11", '5', "NUM", CFG_POSITIVE , &cfg.cdw11, 1, cdw11, 0, }, {"cdw12", '6', "NUM", CFG_POSITIVE , &cfg.cdw12, 1, cdw12, 0, }, {"cdw13", '7', "NUM", CFG_POSITIVE , &cfg.cdw13, 1, cdw13, 0, }, {"cdw14", '8', "NUM", CFG_POSITIVE , &cfg.cdw14, 1, cdw14, 0, }, {"cdw15", '9', "NUM", CFG_POSITIVE , &cfg.cdw15, 1, cdw15, 0, }, {"input-file", 'i', "FILE", CFG_STRING, &cfg.input_file, 1, input, 0, }, {"metadata" , 'M', "FILE", CFG_STRING, &cfg.metadata, 1, metadata, 0, }, {"raw-binary", 'b', ((void*)0), CFG_FLAG, &cfg.raw_binary , 0, raw_dump, 0, }, {"show-command", 's', ((void*)0), CFG_FLAG , &cfg.show_command, 0, show, 0, }, {"read", 'r', ((void* )0), CFG_FLAG, &cfg.read, 0, re, 0, }, {"write", 'w', ((void *)0), CFG_FLAG, &cfg.write, 0, wr, 0, }, {"latency", 'T', ((void*)0), CFG_FLAG, &cfg.latency, 0, latency, 0, }, {"" , 0, ((void*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Global options" , 0, ((void*)0)}, {"verbose", 'v', "NUM", CFG_INCREMENT, & nvme_args.verbose, 0, "Increase output verbosity", 0, }, {"quiet" , 0, ((void*)0), CFG_FLAG, &nvme_args.quiet, 0, "suppress informational output" , 0, }, {"output-format", 'o', "FMT", CFG_STRING, &nvme_args .output_format, 1, "Output format: normal|json|binary", 0, }, {"timeout", 0, "NUM", CFG_POSITIVE, &nvme_args.timeout, 1 , "timeout value, in milliseconds", 0, }, {"dry-run", 0, ((void *)0), CFG_FLAG, &nvme_args.dry_run, 0, "show command instead of executing" , 0, }, {"no-retries", 0, ((void*)0), CFG_FLAG, &nvme_args .no_retries, 0, "disable retry logic on errors", 0, }, {"no-ioctl-probing" , 0, ((void*)0), CFG_FLAG, &nvme_args.no_ioctl_probing, 0 , "disable 64-bit IOCTL support probing", 0, }, {"output-format-version" , 0, "NUM", CFG_POSITIVE, &nvme_args.output_format_ver, 1 , "output format version: 1|2", 0, }, {"human-readable", 'H', ((void*)0), CFG_FLAG, &nvme_args.verbose, 0, ((void*)0), 0, ((void*)0), 1}, {"set-options", 0, "KEY=VALUE", CFG_STRING , &nvme_args.set_options, 1, "set a libnvme library option (key=value[,key=value,...]);" , 0, }, { ((void*)0) } } | |||
| 153 | OPT_UINT("metadata-len", 'm', &cfg.metadata_len, metadata_len),nvme_args.supported_output_formats = (NORMAL | JSON | BINARY) ; struct argconfig_commandline_options opts[] = { {"", 0, ((void *)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Options", 0, ((void *)0)}, {"opcode", 'O', "NUM", CFG_BYTE, &cfg.opcode, 1, opcode , 0, }, {"flags", 'f', "NUM", CFG_BYTE, &cfg.flags, 1, cflags , 0, }, {"prefill", 'p', "NUM", CFG_BYTE, &cfg.prefill, 1 , prefill, 0, }, {"rsvd", 'R', "NUM", CFG_SHORT, &cfg.rsvd , 1, rsvd, 0, }, {"namespace-id", 'n', "NUM", CFG_POSITIVE, & cfg.namespace_id, 1, namespace_desired, 0, }, {"data-len", 'l' , "NUM", CFG_POSITIVE, &cfg.data_len, 1, data_len, 0, }, { "metadata-len", 'm', "NUM", CFG_POSITIVE, &cfg.metadata_len , 1, metadata_len, 0, }, {"cdw2", '2', "NUM", CFG_POSITIVE, & cfg.cdw2, 1, cdw2, 0, }, {"cdw3", '3', "NUM", CFG_POSITIVE, & cfg.cdw3, 1, cdw3, 0, }, {"cdw10", '4', "NUM", CFG_POSITIVE, & cfg.cdw10, 1, cdw10, 0, }, {"cdw11", '5', "NUM", CFG_POSITIVE , &cfg.cdw11, 1, cdw11, 0, }, {"cdw12", '6', "NUM", CFG_POSITIVE , &cfg.cdw12, 1, cdw12, 0, }, {"cdw13", '7', "NUM", CFG_POSITIVE , &cfg.cdw13, 1, cdw13, 0, }, {"cdw14", '8', "NUM", CFG_POSITIVE , &cfg.cdw14, 1, cdw14, 0, }, {"cdw15", '9', "NUM", CFG_POSITIVE , &cfg.cdw15, 1, cdw15, 0, }, {"input-file", 'i', "FILE", CFG_STRING, &cfg.input_file, 1, input, 0, }, {"metadata" , 'M', "FILE", CFG_STRING, &cfg.metadata, 1, metadata, 0, }, {"raw-binary", 'b', ((void*)0), CFG_FLAG, &cfg.raw_binary , 0, raw_dump, 0, }, {"show-command", 's', ((void*)0), CFG_FLAG , &cfg.show_command, 0, show, 0, }, {"read", 'r', ((void* )0), CFG_FLAG, &cfg.read, 0, re, 0, }, {"write", 'w', ((void *)0), CFG_FLAG, &cfg.write, 0, wr, 0, }, {"latency", 'T', ((void*)0), CFG_FLAG, &cfg.latency, 0, latency, 0, }, {"" , 0, ((void*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Global options" , 0, ((void*)0)}, {"verbose", 'v', "NUM", CFG_INCREMENT, & nvme_args.verbose, 0, "Increase output verbosity", 0, }, {"quiet" , 0, ((void*)0), CFG_FLAG, &nvme_args.quiet, 0, "suppress informational output" , 0, }, {"output-format", 'o', "FMT", CFG_STRING, &nvme_args .output_format, 1, "Output format: normal|json|binary", 0, }, {"timeout", 0, "NUM", CFG_POSITIVE, &nvme_args.timeout, 1 , "timeout value, in milliseconds", 0, }, {"dry-run", 0, ((void *)0), CFG_FLAG, &nvme_args.dry_run, 0, "show command instead of executing" , 0, }, {"no-retries", 0, ((void*)0), CFG_FLAG, &nvme_args .no_retries, 0, "disable retry logic on errors", 0, }, {"no-ioctl-probing" , 0, ((void*)0), CFG_FLAG, &nvme_args.no_ioctl_probing, 0 , "disable 64-bit IOCTL support probing", 0, }, {"output-format-version" , 0, "NUM", CFG_POSITIVE, &nvme_args.output_format_ver, 1 , "output format version: 1|2", 0, }, {"human-readable", 'H', ((void*)0), CFG_FLAG, &nvme_args.verbose, 0, ((void*)0), 0, ((void*)0), 1}, {"set-options", 0, "KEY=VALUE", CFG_STRING , &nvme_args.set_options, 1, "set a libnvme library option (key=value[,key=value,...]);" , 0, }, { ((void*)0) } } | |||
| 154 | OPT_UINT("cdw2", '2', &cfg.cdw2, cdw2),nvme_args.supported_output_formats = (NORMAL | JSON | BINARY) ; struct argconfig_commandline_options opts[] = { {"", 0, ((void *)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Options", 0, ((void *)0)}, {"opcode", 'O', "NUM", CFG_BYTE, &cfg.opcode, 1, opcode , 0, }, {"flags", 'f', "NUM", CFG_BYTE, &cfg.flags, 1, cflags , 0, }, {"prefill", 'p', "NUM", CFG_BYTE, &cfg.prefill, 1 , prefill, 0, }, {"rsvd", 'R', "NUM", CFG_SHORT, &cfg.rsvd , 1, rsvd, 0, }, {"namespace-id", 'n', "NUM", CFG_POSITIVE, & cfg.namespace_id, 1, namespace_desired, 0, }, {"data-len", 'l' , "NUM", CFG_POSITIVE, &cfg.data_len, 1, data_len, 0, }, { "metadata-len", 'm', "NUM", CFG_POSITIVE, &cfg.metadata_len , 1, metadata_len, 0, }, {"cdw2", '2', "NUM", CFG_POSITIVE, & cfg.cdw2, 1, cdw2, 0, }, {"cdw3", '3', "NUM", CFG_POSITIVE, & cfg.cdw3, 1, cdw3, 0, }, {"cdw10", '4', "NUM", CFG_POSITIVE, & cfg.cdw10, 1, cdw10, 0, }, {"cdw11", '5', "NUM", CFG_POSITIVE , &cfg.cdw11, 1, cdw11, 0, }, {"cdw12", '6', "NUM", CFG_POSITIVE , &cfg.cdw12, 1, cdw12, 0, }, {"cdw13", '7', "NUM", CFG_POSITIVE , &cfg.cdw13, 1, cdw13, 0, }, {"cdw14", '8', "NUM", CFG_POSITIVE , &cfg.cdw14, 1, cdw14, 0, }, {"cdw15", '9', "NUM", CFG_POSITIVE , &cfg.cdw15, 1, cdw15, 0, }, {"input-file", 'i', "FILE", CFG_STRING, &cfg.input_file, 1, input, 0, }, {"metadata" , 'M', "FILE", CFG_STRING, &cfg.metadata, 1, metadata, 0, }, {"raw-binary", 'b', ((void*)0), CFG_FLAG, &cfg.raw_binary , 0, raw_dump, 0, }, {"show-command", 's', ((void*)0), CFG_FLAG , &cfg.show_command, 0, show, 0, }, {"read", 'r', ((void* )0), CFG_FLAG, &cfg.read, 0, re, 0, }, {"write", 'w', ((void *)0), CFG_FLAG, &cfg.write, 0, wr, 0, }, {"latency", 'T', ((void*)0), CFG_FLAG, &cfg.latency, 0, latency, 0, }, {"" , 0, ((void*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Global options" , 0, ((void*)0)}, {"verbose", 'v', "NUM", CFG_INCREMENT, & nvme_args.verbose, 0, "Increase output verbosity", 0, }, {"quiet" , 0, ((void*)0), CFG_FLAG, &nvme_args.quiet, 0, "suppress informational output" , 0, }, {"output-format", 'o', "FMT", CFG_STRING, &nvme_args .output_format, 1, "Output format: normal|json|binary", 0, }, {"timeout", 0, "NUM", CFG_POSITIVE, &nvme_args.timeout, 1 , "timeout value, in milliseconds", 0, }, {"dry-run", 0, ((void *)0), CFG_FLAG, &nvme_args.dry_run, 0, "show command instead of executing" , 0, }, {"no-retries", 0, ((void*)0), CFG_FLAG, &nvme_args .no_retries, 0, "disable retry logic on errors", 0, }, {"no-ioctl-probing" , 0, ((void*)0), CFG_FLAG, &nvme_args.no_ioctl_probing, 0 , "disable 64-bit IOCTL support probing", 0, }, {"output-format-version" , 0, "NUM", CFG_POSITIVE, &nvme_args.output_format_ver, 1 , "output format version: 1|2", 0, }, {"human-readable", 'H', ((void*)0), CFG_FLAG, &nvme_args.verbose, 0, ((void*)0), 0, ((void*)0), 1}, {"set-options", 0, "KEY=VALUE", CFG_STRING , &nvme_args.set_options, 1, "set a libnvme library option (key=value[,key=value,...]);" , 0, }, { ((void*)0) } } | |||
| 155 | OPT_UINT("cdw3", '3', &cfg.cdw3, cdw3),nvme_args.supported_output_formats = (NORMAL | JSON | BINARY) ; struct argconfig_commandline_options opts[] = { {"", 0, ((void *)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Options", 0, ((void *)0)}, {"opcode", 'O', "NUM", CFG_BYTE, &cfg.opcode, 1, opcode , 0, }, {"flags", 'f', "NUM", CFG_BYTE, &cfg.flags, 1, cflags , 0, }, {"prefill", 'p', "NUM", CFG_BYTE, &cfg.prefill, 1 , prefill, 0, }, {"rsvd", 'R', "NUM", CFG_SHORT, &cfg.rsvd , 1, rsvd, 0, }, {"namespace-id", 'n', "NUM", CFG_POSITIVE, & cfg.namespace_id, 1, namespace_desired, 0, }, {"data-len", 'l' , "NUM", CFG_POSITIVE, &cfg.data_len, 1, data_len, 0, }, { "metadata-len", 'm', "NUM", CFG_POSITIVE, &cfg.metadata_len , 1, metadata_len, 0, }, {"cdw2", '2', "NUM", CFG_POSITIVE, & cfg.cdw2, 1, cdw2, 0, }, {"cdw3", '3', "NUM", CFG_POSITIVE, & cfg.cdw3, 1, cdw3, 0, }, {"cdw10", '4', "NUM", CFG_POSITIVE, & cfg.cdw10, 1, cdw10, 0, }, {"cdw11", '5', "NUM", CFG_POSITIVE , &cfg.cdw11, 1, cdw11, 0, }, {"cdw12", '6', "NUM", CFG_POSITIVE , &cfg.cdw12, 1, cdw12, 0, }, {"cdw13", '7', "NUM", CFG_POSITIVE , &cfg.cdw13, 1, cdw13, 0, }, {"cdw14", '8', "NUM", CFG_POSITIVE , &cfg.cdw14, 1, cdw14, 0, }, {"cdw15", '9', "NUM", CFG_POSITIVE , &cfg.cdw15, 1, cdw15, 0, }, {"input-file", 'i', "FILE", CFG_STRING, &cfg.input_file, 1, input, 0, }, {"metadata" , 'M', "FILE", CFG_STRING, &cfg.metadata, 1, metadata, 0, }, {"raw-binary", 'b', ((void*)0), CFG_FLAG, &cfg.raw_binary , 0, raw_dump, 0, }, {"show-command", 's', ((void*)0), CFG_FLAG , &cfg.show_command, 0, show, 0, }, {"read", 'r', ((void* )0), CFG_FLAG, &cfg.read, 0, re, 0, }, {"write", 'w', ((void *)0), CFG_FLAG, &cfg.write, 0, wr, 0, }, {"latency", 'T', ((void*)0), CFG_FLAG, &cfg.latency, 0, latency, 0, }, {"" , 0, ((void*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Global options" , 0, ((void*)0)}, {"verbose", 'v', "NUM", CFG_INCREMENT, & nvme_args.verbose, 0, "Increase output verbosity", 0, }, {"quiet" , 0, ((void*)0), CFG_FLAG, &nvme_args.quiet, 0, "suppress informational output" , 0, }, {"output-format", 'o', "FMT", CFG_STRING, &nvme_args .output_format, 1, "Output format: normal|json|binary", 0, }, {"timeout", 0, "NUM", CFG_POSITIVE, &nvme_args.timeout, 1 , "timeout value, in milliseconds", 0, }, {"dry-run", 0, ((void *)0), CFG_FLAG, &nvme_args.dry_run, 0, "show command instead of executing" , 0, }, {"no-retries", 0, ((void*)0), CFG_FLAG, &nvme_args .no_retries, 0, "disable retry logic on errors", 0, }, {"no-ioctl-probing" , 0, ((void*)0), CFG_FLAG, &nvme_args.no_ioctl_probing, 0 , "disable 64-bit IOCTL support probing", 0, }, {"output-format-version" , 0, "NUM", CFG_POSITIVE, &nvme_args.output_format_ver, 1 , "output format version: 1|2", 0, }, {"human-readable", 'H', ((void*)0), CFG_FLAG, &nvme_args.verbose, 0, ((void*)0), 0, ((void*)0), 1}, {"set-options", 0, "KEY=VALUE", CFG_STRING , &nvme_args.set_options, 1, "set a libnvme library option (key=value[,key=value,...]);" , 0, }, { ((void*)0) } } | |||
| 156 | OPT_UINT("cdw10", '4', &cfg.cdw10, cdw10),nvme_args.supported_output_formats = (NORMAL | JSON | BINARY) ; struct argconfig_commandline_options opts[] = { {"", 0, ((void *)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Options", 0, ((void *)0)}, {"opcode", 'O', "NUM", CFG_BYTE, &cfg.opcode, 1, opcode , 0, }, {"flags", 'f', "NUM", CFG_BYTE, &cfg.flags, 1, cflags , 0, }, {"prefill", 'p', "NUM", CFG_BYTE, &cfg.prefill, 1 , prefill, 0, }, {"rsvd", 'R', "NUM", CFG_SHORT, &cfg.rsvd , 1, rsvd, 0, }, {"namespace-id", 'n', "NUM", CFG_POSITIVE, & cfg.namespace_id, 1, namespace_desired, 0, }, {"data-len", 'l' , "NUM", CFG_POSITIVE, &cfg.data_len, 1, data_len, 0, }, { "metadata-len", 'm', "NUM", CFG_POSITIVE, &cfg.metadata_len , 1, metadata_len, 0, }, {"cdw2", '2', "NUM", CFG_POSITIVE, & cfg.cdw2, 1, cdw2, 0, }, {"cdw3", '3', "NUM", CFG_POSITIVE, & cfg.cdw3, 1, cdw3, 0, }, {"cdw10", '4', "NUM", CFG_POSITIVE, & cfg.cdw10, 1, cdw10, 0, }, {"cdw11", '5', "NUM", CFG_POSITIVE , &cfg.cdw11, 1, cdw11, 0, }, {"cdw12", '6', "NUM", CFG_POSITIVE , &cfg.cdw12, 1, cdw12, 0, }, {"cdw13", '7', "NUM", CFG_POSITIVE , &cfg.cdw13, 1, cdw13, 0, }, {"cdw14", '8', "NUM", CFG_POSITIVE , &cfg.cdw14, 1, cdw14, 0, }, {"cdw15", '9', "NUM", CFG_POSITIVE , &cfg.cdw15, 1, cdw15, 0, }, {"input-file", 'i', "FILE", CFG_STRING, &cfg.input_file, 1, input, 0, }, {"metadata" , 'M', "FILE", CFG_STRING, &cfg.metadata, 1, metadata, 0, }, {"raw-binary", 'b', ((void*)0), CFG_FLAG, &cfg.raw_binary , 0, raw_dump, 0, }, {"show-command", 's', ((void*)0), CFG_FLAG , &cfg.show_command, 0, show, 0, }, {"read", 'r', ((void* )0), CFG_FLAG, &cfg.read, 0, re, 0, }, {"write", 'w', ((void *)0), CFG_FLAG, &cfg.write, 0, wr, 0, }, {"latency", 'T', ((void*)0), CFG_FLAG, &cfg.latency, 0, latency, 0, }, {"" , 0, ((void*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Global options" , 0, ((void*)0)}, {"verbose", 'v', "NUM", CFG_INCREMENT, & nvme_args.verbose, 0, "Increase output verbosity", 0, }, {"quiet" , 0, ((void*)0), CFG_FLAG, &nvme_args.quiet, 0, "suppress informational output" , 0, }, {"output-format", 'o', "FMT", CFG_STRING, &nvme_args .output_format, 1, "Output format: normal|json|binary", 0, }, {"timeout", 0, "NUM", CFG_POSITIVE, &nvme_args.timeout, 1 , "timeout value, in milliseconds", 0, }, {"dry-run", 0, ((void *)0), CFG_FLAG, &nvme_args.dry_run, 0, "show command instead of executing" , 0, }, {"no-retries", 0, ((void*)0), CFG_FLAG, &nvme_args .no_retries, 0, "disable retry logic on errors", 0, }, {"no-ioctl-probing" , 0, ((void*)0), CFG_FLAG, &nvme_args.no_ioctl_probing, 0 , "disable 64-bit IOCTL support probing", 0, }, {"output-format-version" , 0, "NUM", CFG_POSITIVE, &nvme_args.output_format_ver, 1 , "output format version: 1|2", 0, }, {"human-readable", 'H', ((void*)0), CFG_FLAG, &nvme_args.verbose, 0, ((void*)0), 0, ((void*)0), 1}, {"set-options", 0, "KEY=VALUE", CFG_STRING , &nvme_args.set_options, 1, "set a libnvme library option (key=value[,key=value,...]);" , 0, }, { ((void*)0) } } | |||
| 157 | OPT_UINT("cdw11", '5', &cfg.cdw11, cdw11),nvme_args.supported_output_formats = (NORMAL | JSON | BINARY) ; struct argconfig_commandline_options opts[] = { {"", 0, ((void *)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Options", 0, ((void *)0)}, {"opcode", 'O', "NUM", CFG_BYTE, &cfg.opcode, 1, opcode , 0, }, {"flags", 'f', "NUM", CFG_BYTE, &cfg.flags, 1, cflags , 0, }, {"prefill", 'p', "NUM", CFG_BYTE, &cfg.prefill, 1 , prefill, 0, }, {"rsvd", 'R', "NUM", CFG_SHORT, &cfg.rsvd , 1, rsvd, 0, }, {"namespace-id", 'n', "NUM", CFG_POSITIVE, & cfg.namespace_id, 1, namespace_desired, 0, }, {"data-len", 'l' , "NUM", CFG_POSITIVE, &cfg.data_len, 1, data_len, 0, }, { "metadata-len", 'm', "NUM", CFG_POSITIVE, &cfg.metadata_len , 1, metadata_len, 0, }, {"cdw2", '2', "NUM", CFG_POSITIVE, & cfg.cdw2, 1, cdw2, 0, }, {"cdw3", '3', "NUM", CFG_POSITIVE, & cfg.cdw3, 1, cdw3, 0, }, {"cdw10", '4', "NUM", CFG_POSITIVE, & cfg.cdw10, 1, cdw10, 0, }, {"cdw11", '5', "NUM", CFG_POSITIVE , &cfg.cdw11, 1, cdw11, 0, }, {"cdw12", '6', "NUM", CFG_POSITIVE , &cfg.cdw12, 1, cdw12, 0, }, {"cdw13", '7', "NUM", CFG_POSITIVE , &cfg.cdw13, 1, cdw13, 0, }, {"cdw14", '8', "NUM", CFG_POSITIVE , &cfg.cdw14, 1, cdw14, 0, }, {"cdw15", '9', "NUM", CFG_POSITIVE , &cfg.cdw15, 1, cdw15, 0, }, {"input-file", 'i', "FILE", CFG_STRING, &cfg.input_file, 1, input, 0, }, {"metadata" , 'M', "FILE", CFG_STRING, &cfg.metadata, 1, metadata, 0, }, {"raw-binary", 'b', ((void*)0), CFG_FLAG, &cfg.raw_binary , 0, raw_dump, 0, }, {"show-command", 's', ((void*)0), CFG_FLAG , &cfg.show_command, 0, show, 0, }, {"read", 'r', ((void* )0), CFG_FLAG, &cfg.read, 0, re, 0, }, {"write", 'w', ((void *)0), CFG_FLAG, &cfg.write, 0, wr, 0, }, {"latency", 'T', ((void*)0), CFG_FLAG, &cfg.latency, 0, latency, 0, }, {"" , 0, ((void*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Global options" , 0, ((void*)0)}, {"verbose", 'v', "NUM", CFG_INCREMENT, & nvme_args.verbose, 0, "Increase output verbosity", 0, }, {"quiet" , 0, ((void*)0), CFG_FLAG, &nvme_args.quiet, 0, "suppress informational output" , 0, }, {"output-format", 'o', "FMT", CFG_STRING, &nvme_args .output_format, 1, "Output format: normal|json|binary", 0, }, {"timeout", 0, "NUM", CFG_POSITIVE, &nvme_args.timeout, 1 , "timeout value, in milliseconds", 0, }, {"dry-run", 0, ((void *)0), CFG_FLAG, &nvme_args.dry_run, 0, "show command instead of executing" , 0, }, {"no-retries", 0, ((void*)0), CFG_FLAG, &nvme_args .no_retries, 0, "disable retry logic on errors", 0, }, {"no-ioctl-probing" , 0, ((void*)0), CFG_FLAG, &nvme_args.no_ioctl_probing, 0 , "disable 64-bit IOCTL support probing", 0, }, {"output-format-version" , 0, "NUM", CFG_POSITIVE, &nvme_args.output_format_ver, 1 , "output format version: 1|2", 0, }, {"human-readable", 'H', ((void*)0), CFG_FLAG, &nvme_args.verbose, 0, ((void*)0), 0, ((void*)0), 1}, {"set-options", 0, "KEY=VALUE", CFG_STRING , &nvme_args.set_options, 1, "set a libnvme library option (key=value[,key=value,...]);" , 0, }, { ((void*)0) } } | |||
| 158 | OPT_UINT("cdw12", '6', &cfg.cdw12, cdw12),nvme_args.supported_output_formats = (NORMAL | JSON | BINARY) ; struct argconfig_commandline_options opts[] = { {"", 0, ((void *)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Options", 0, ((void *)0)}, {"opcode", 'O', "NUM", CFG_BYTE, &cfg.opcode, 1, opcode , 0, }, {"flags", 'f', "NUM", CFG_BYTE, &cfg.flags, 1, cflags , 0, }, {"prefill", 'p', "NUM", CFG_BYTE, &cfg.prefill, 1 , prefill, 0, }, {"rsvd", 'R', "NUM", CFG_SHORT, &cfg.rsvd , 1, rsvd, 0, }, {"namespace-id", 'n', "NUM", CFG_POSITIVE, & cfg.namespace_id, 1, namespace_desired, 0, }, {"data-len", 'l' , "NUM", CFG_POSITIVE, &cfg.data_len, 1, data_len, 0, }, { "metadata-len", 'm', "NUM", CFG_POSITIVE, &cfg.metadata_len , 1, metadata_len, 0, }, {"cdw2", '2', "NUM", CFG_POSITIVE, & cfg.cdw2, 1, cdw2, 0, }, {"cdw3", '3', "NUM", CFG_POSITIVE, & cfg.cdw3, 1, cdw3, 0, }, {"cdw10", '4', "NUM", CFG_POSITIVE, & cfg.cdw10, 1, cdw10, 0, }, {"cdw11", '5', "NUM", CFG_POSITIVE , &cfg.cdw11, 1, cdw11, 0, }, {"cdw12", '6', "NUM", CFG_POSITIVE , &cfg.cdw12, 1, cdw12, 0, }, {"cdw13", '7', "NUM", CFG_POSITIVE , &cfg.cdw13, 1, cdw13, 0, }, {"cdw14", '8', "NUM", CFG_POSITIVE , &cfg.cdw14, 1, cdw14, 0, }, {"cdw15", '9', "NUM", CFG_POSITIVE , &cfg.cdw15, 1, cdw15, 0, }, {"input-file", 'i', "FILE", CFG_STRING, &cfg.input_file, 1, input, 0, }, {"metadata" , 'M', "FILE", CFG_STRING, &cfg.metadata, 1, metadata, 0, }, {"raw-binary", 'b', ((void*)0), CFG_FLAG, &cfg.raw_binary , 0, raw_dump, 0, }, {"show-command", 's', ((void*)0), CFG_FLAG , &cfg.show_command, 0, show, 0, }, {"read", 'r', ((void* )0), CFG_FLAG, &cfg.read, 0, re, 0, }, {"write", 'w', ((void *)0), CFG_FLAG, &cfg.write, 0, wr, 0, }, {"latency", 'T', ((void*)0), CFG_FLAG, &cfg.latency, 0, latency, 0, }, {"" , 0, ((void*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Global options" , 0, ((void*)0)}, {"verbose", 'v', "NUM", CFG_INCREMENT, & nvme_args.verbose, 0, "Increase output verbosity", 0, }, {"quiet" , 0, ((void*)0), CFG_FLAG, &nvme_args.quiet, 0, "suppress informational output" , 0, }, {"output-format", 'o', "FMT", CFG_STRING, &nvme_args .output_format, 1, "Output format: normal|json|binary", 0, }, {"timeout", 0, "NUM", CFG_POSITIVE, &nvme_args.timeout, 1 , "timeout value, in milliseconds", 0, }, {"dry-run", 0, ((void *)0), CFG_FLAG, &nvme_args.dry_run, 0, "show command instead of executing" , 0, }, {"no-retries", 0, ((void*)0), CFG_FLAG, &nvme_args .no_retries, 0, "disable retry logic on errors", 0, }, {"no-ioctl-probing" , 0, ((void*)0), CFG_FLAG, &nvme_args.no_ioctl_probing, 0 , "disable 64-bit IOCTL support probing", 0, }, {"output-format-version" , 0, "NUM", CFG_POSITIVE, &nvme_args.output_format_ver, 1 , "output format version: 1|2", 0, }, {"human-readable", 'H', ((void*)0), CFG_FLAG, &nvme_args.verbose, 0, ((void*)0), 0, ((void*)0), 1}, {"set-options", 0, "KEY=VALUE", CFG_STRING , &nvme_args.set_options, 1, "set a libnvme library option (key=value[,key=value,...]);" , 0, }, { ((void*)0) } } | |||
| 159 | OPT_UINT("cdw13", '7', &cfg.cdw13, cdw13),nvme_args.supported_output_formats = (NORMAL | JSON | BINARY) ; struct argconfig_commandline_options opts[] = { {"", 0, ((void *)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Options", 0, ((void *)0)}, {"opcode", 'O', "NUM", CFG_BYTE, &cfg.opcode, 1, opcode , 0, }, {"flags", 'f', "NUM", CFG_BYTE, &cfg.flags, 1, cflags , 0, }, {"prefill", 'p', "NUM", CFG_BYTE, &cfg.prefill, 1 , prefill, 0, }, {"rsvd", 'R', "NUM", CFG_SHORT, &cfg.rsvd , 1, rsvd, 0, }, {"namespace-id", 'n', "NUM", CFG_POSITIVE, & cfg.namespace_id, 1, namespace_desired, 0, }, {"data-len", 'l' , "NUM", CFG_POSITIVE, &cfg.data_len, 1, data_len, 0, }, { "metadata-len", 'm', "NUM", CFG_POSITIVE, &cfg.metadata_len , 1, metadata_len, 0, }, {"cdw2", '2', "NUM", CFG_POSITIVE, & cfg.cdw2, 1, cdw2, 0, }, {"cdw3", '3', "NUM", CFG_POSITIVE, & cfg.cdw3, 1, cdw3, 0, }, {"cdw10", '4', "NUM", CFG_POSITIVE, & cfg.cdw10, 1, cdw10, 0, }, {"cdw11", '5', "NUM", CFG_POSITIVE , &cfg.cdw11, 1, cdw11, 0, }, {"cdw12", '6', "NUM", CFG_POSITIVE , &cfg.cdw12, 1, cdw12, 0, }, {"cdw13", '7', "NUM", CFG_POSITIVE , &cfg.cdw13, 1, cdw13, 0, }, {"cdw14", '8', "NUM", CFG_POSITIVE , &cfg.cdw14, 1, cdw14, 0, }, {"cdw15", '9', "NUM", CFG_POSITIVE , &cfg.cdw15, 1, cdw15, 0, }, {"input-file", 'i', "FILE", CFG_STRING, &cfg.input_file, 1, input, 0, }, {"metadata" , 'M', "FILE", CFG_STRING, &cfg.metadata, 1, metadata, 0, }, {"raw-binary", 'b', ((void*)0), CFG_FLAG, &cfg.raw_binary , 0, raw_dump, 0, }, {"show-command", 's', ((void*)0), CFG_FLAG , &cfg.show_command, 0, show, 0, }, {"read", 'r', ((void* )0), CFG_FLAG, &cfg.read, 0, re, 0, }, {"write", 'w', ((void *)0), CFG_FLAG, &cfg.write, 0, wr, 0, }, {"latency", 'T', ((void*)0), CFG_FLAG, &cfg.latency, 0, latency, 0, }, {"" , 0, ((void*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Global options" , 0, ((void*)0)}, {"verbose", 'v', "NUM", CFG_INCREMENT, & nvme_args.verbose, 0, "Increase output verbosity", 0, }, {"quiet" , 0, ((void*)0), CFG_FLAG, &nvme_args.quiet, 0, "suppress informational output" , 0, }, {"output-format", 'o', "FMT", CFG_STRING, &nvme_args .output_format, 1, "Output format: normal|json|binary", 0, }, {"timeout", 0, "NUM", CFG_POSITIVE, &nvme_args.timeout, 1 , "timeout value, in milliseconds", 0, }, {"dry-run", 0, ((void *)0), CFG_FLAG, &nvme_args.dry_run, 0, "show command instead of executing" , 0, }, {"no-retries", 0, ((void*)0), CFG_FLAG, &nvme_args .no_retries, 0, "disable retry logic on errors", 0, }, {"no-ioctl-probing" , 0, ((void*)0), CFG_FLAG, &nvme_args.no_ioctl_probing, 0 , "disable 64-bit IOCTL support probing", 0, }, {"output-format-version" , 0, "NUM", CFG_POSITIVE, &nvme_args.output_format_ver, 1 , "output format version: 1|2", 0, }, {"human-readable", 'H', ((void*)0), CFG_FLAG, &nvme_args.verbose, 0, ((void*)0), 0, ((void*)0), 1}, {"set-options", 0, "KEY=VALUE", CFG_STRING , &nvme_args.set_options, 1, "set a libnvme library option (key=value[,key=value,...]);" , 0, }, { ((void*)0) } } | |||
| 160 | OPT_UINT("cdw14", '8', &cfg.cdw14, cdw14),nvme_args.supported_output_formats = (NORMAL | JSON | BINARY) ; struct argconfig_commandline_options opts[] = { {"", 0, ((void *)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Options", 0, ((void *)0)}, {"opcode", 'O', "NUM", CFG_BYTE, &cfg.opcode, 1, opcode , 0, }, {"flags", 'f', "NUM", CFG_BYTE, &cfg.flags, 1, cflags , 0, }, {"prefill", 'p', "NUM", CFG_BYTE, &cfg.prefill, 1 , prefill, 0, }, {"rsvd", 'R', "NUM", CFG_SHORT, &cfg.rsvd , 1, rsvd, 0, }, {"namespace-id", 'n', "NUM", CFG_POSITIVE, & cfg.namespace_id, 1, namespace_desired, 0, }, {"data-len", 'l' , "NUM", CFG_POSITIVE, &cfg.data_len, 1, data_len, 0, }, { "metadata-len", 'm', "NUM", CFG_POSITIVE, &cfg.metadata_len , 1, metadata_len, 0, }, {"cdw2", '2', "NUM", CFG_POSITIVE, & cfg.cdw2, 1, cdw2, 0, }, {"cdw3", '3', "NUM", CFG_POSITIVE, & cfg.cdw3, 1, cdw3, 0, }, {"cdw10", '4', "NUM", CFG_POSITIVE, & cfg.cdw10, 1, cdw10, 0, }, {"cdw11", '5', "NUM", CFG_POSITIVE , &cfg.cdw11, 1, cdw11, 0, }, {"cdw12", '6', "NUM", CFG_POSITIVE , &cfg.cdw12, 1, cdw12, 0, }, {"cdw13", '7', "NUM", CFG_POSITIVE , &cfg.cdw13, 1, cdw13, 0, }, {"cdw14", '8', "NUM", CFG_POSITIVE , &cfg.cdw14, 1, cdw14, 0, }, {"cdw15", '9', "NUM", CFG_POSITIVE , &cfg.cdw15, 1, cdw15, 0, }, {"input-file", 'i', "FILE", CFG_STRING, &cfg.input_file, 1, input, 0, }, {"metadata" , 'M', "FILE", CFG_STRING, &cfg.metadata, 1, metadata, 0, }, {"raw-binary", 'b', ((void*)0), CFG_FLAG, &cfg.raw_binary , 0, raw_dump, 0, }, {"show-command", 's', ((void*)0), CFG_FLAG , &cfg.show_command, 0, show, 0, }, {"read", 'r', ((void* )0), CFG_FLAG, &cfg.read, 0, re, 0, }, {"write", 'w', ((void *)0), CFG_FLAG, &cfg.write, 0, wr, 0, }, {"latency", 'T', ((void*)0), CFG_FLAG, &cfg.latency, 0, latency, 0, }, {"" , 0, ((void*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Global options" , 0, ((void*)0)}, {"verbose", 'v', "NUM", CFG_INCREMENT, & nvme_args.verbose, 0, "Increase output verbosity", 0, }, {"quiet" , 0, ((void*)0), CFG_FLAG, &nvme_args.quiet, 0, "suppress informational output" , 0, }, {"output-format", 'o', "FMT", CFG_STRING, &nvme_args .output_format, 1, "Output format: normal|json|binary", 0, }, {"timeout", 0, "NUM", CFG_POSITIVE, &nvme_args.timeout, 1 , "timeout value, in milliseconds", 0, }, {"dry-run", 0, ((void *)0), CFG_FLAG, &nvme_args.dry_run, 0, "show command instead of executing" , 0, }, {"no-retries", 0, ((void*)0), CFG_FLAG, &nvme_args .no_retries, 0, "disable retry logic on errors", 0, }, {"no-ioctl-probing" , 0, ((void*)0), CFG_FLAG, &nvme_args.no_ioctl_probing, 0 , "disable 64-bit IOCTL support probing", 0, }, {"output-format-version" , 0, "NUM", CFG_POSITIVE, &nvme_args.output_format_ver, 1 , "output format version: 1|2", 0, }, {"human-readable", 'H', ((void*)0), CFG_FLAG, &nvme_args.verbose, 0, ((void*)0), 0, ((void*)0), 1}, {"set-options", 0, "KEY=VALUE", CFG_STRING , &nvme_args.set_options, 1, "set a libnvme library option (key=value[,key=value,...]);" , 0, }, { ((void*)0) } } | |||
| 161 | OPT_UINT("cdw15", '9', &cfg.cdw15, cdw15),nvme_args.supported_output_formats = (NORMAL | JSON | BINARY) ; struct argconfig_commandline_options opts[] = { {"", 0, ((void *)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Options", 0, ((void *)0)}, {"opcode", 'O', "NUM", CFG_BYTE, &cfg.opcode, 1, opcode , 0, }, {"flags", 'f', "NUM", CFG_BYTE, &cfg.flags, 1, cflags , 0, }, {"prefill", 'p', "NUM", CFG_BYTE, &cfg.prefill, 1 , prefill, 0, }, {"rsvd", 'R', "NUM", CFG_SHORT, &cfg.rsvd , 1, rsvd, 0, }, {"namespace-id", 'n', "NUM", CFG_POSITIVE, & cfg.namespace_id, 1, namespace_desired, 0, }, {"data-len", 'l' , "NUM", CFG_POSITIVE, &cfg.data_len, 1, data_len, 0, }, { "metadata-len", 'm', "NUM", CFG_POSITIVE, &cfg.metadata_len , 1, metadata_len, 0, }, {"cdw2", '2', "NUM", CFG_POSITIVE, & cfg.cdw2, 1, cdw2, 0, }, {"cdw3", '3', "NUM", CFG_POSITIVE, & cfg.cdw3, 1, cdw3, 0, }, {"cdw10", '4', "NUM", CFG_POSITIVE, & cfg.cdw10, 1, cdw10, 0, }, {"cdw11", '5', "NUM", CFG_POSITIVE , &cfg.cdw11, 1, cdw11, 0, }, {"cdw12", '6', "NUM", CFG_POSITIVE , &cfg.cdw12, 1, cdw12, 0, }, {"cdw13", '7', "NUM", CFG_POSITIVE , &cfg.cdw13, 1, cdw13, 0, }, {"cdw14", '8', "NUM", CFG_POSITIVE , &cfg.cdw14, 1, cdw14, 0, }, {"cdw15", '9', "NUM", CFG_POSITIVE , &cfg.cdw15, 1, cdw15, 0, }, {"input-file", 'i', "FILE", CFG_STRING, &cfg.input_file, 1, input, 0, }, {"metadata" , 'M', "FILE", CFG_STRING, &cfg.metadata, 1, metadata, 0, }, {"raw-binary", 'b', ((void*)0), CFG_FLAG, &cfg.raw_binary , 0, raw_dump, 0, }, {"show-command", 's', ((void*)0), CFG_FLAG , &cfg.show_command, 0, show, 0, }, {"read", 'r', ((void* )0), CFG_FLAG, &cfg.read, 0, re, 0, }, {"write", 'w', ((void *)0), CFG_FLAG, &cfg.write, 0, wr, 0, }, {"latency", 'T', ((void*)0), CFG_FLAG, &cfg.latency, 0, latency, 0, }, {"" , 0, ((void*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Global options" , 0, ((void*)0)}, {"verbose", 'v', "NUM", CFG_INCREMENT, & nvme_args.verbose, 0, "Increase output verbosity", 0, }, {"quiet" , 0, ((void*)0), CFG_FLAG, &nvme_args.quiet, 0, "suppress informational output" , 0, }, {"output-format", 'o', "FMT", CFG_STRING, &nvme_args .output_format, 1, "Output format: normal|json|binary", 0, }, {"timeout", 0, "NUM", CFG_POSITIVE, &nvme_args.timeout, 1 , "timeout value, in milliseconds", 0, }, {"dry-run", 0, ((void *)0), CFG_FLAG, &nvme_args.dry_run, 0, "show command instead of executing" , 0, }, {"no-retries", 0, ((void*)0), CFG_FLAG, &nvme_args .no_retries, 0, "disable retry logic on errors", 0, }, {"no-ioctl-probing" , 0, ((void*)0), CFG_FLAG, &nvme_args.no_ioctl_probing, 0 , "disable 64-bit IOCTL support probing", 0, }, {"output-format-version" , 0, "NUM", CFG_POSITIVE, &nvme_args.output_format_ver, 1 , "output format version: 1|2", 0, }, {"human-readable", 'H', ((void*)0), CFG_FLAG, &nvme_args.verbose, 0, ((void*)0), 0, ((void*)0), 1}, {"set-options", 0, "KEY=VALUE", CFG_STRING , &nvme_args.set_options, 1, "set a libnvme library option (key=value[,key=value,...]);" , 0, }, { ((void*)0) } } | |||
| 162 | OPT_FILE("input-file", 'i', &cfg.input_file, input),nvme_args.supported_output_formats = (NORMAL | JSON | BINARY) ; struct argconfig_commandline_options opts[] = { {"", 0, ((void *)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Options", 0, ((void *)0)}, {"opcode", 'O', "NUM", CFG_BYTE, &cfg.opcode, 1, opcode , 0, }, {"flags", 'f', "NUM", CFG_BYTE, &cfg.flags, 1, cflags , 0, }, {"prefill", 'p', "NUM", CFG_BYTE, &cfg.prefill, 1 , prefill, 0, }, {"rsvd", 'R', "NUM", CFG_SHORT, &cfg.rsvd , 1, rsvd, 0, }, {"namespace-id", 'n', "NUM", CFG_POSITIVE, & cfg.namespace_id, 1, namespace_desired, 0, }, {"data-len", 'l' , "NUM", CFG_POSITIVE, &cfg.data_len, 1, data_len, 0, }, { "metadata-len", 'm', "NUM", CFG_POSITIVE, &cfg.metadata_len , 1, metadata_len, 0, }, {"cdw2", '2', "NUM", CFG_POSITIVE, & cfg.cdw2, 1, cdw2, 0, }, {"cdw3", '3', "NUM", CFG_POSITIVE, & cfg.cdw3, 1, cdw3, 0, }, {"cdw10", '4', "NUM", CFG_POSITIVE, & cfg.cdw10, 1, cdw10, 0, }, {"cdw11", '5', "NUM", CFG_POSITIVE , &cfg.cdw11, 1, cdw11, 0, }, {"cdw12", '6', "NUM", CFG_POSITIVE , &cfg.cdw12, 1, cdw12, 0, }, {"cdw13", '7', "NUM", CFG_POSITIVE , &cfg.cdw13, 1, cdw13, 0, }, {"cdw14", '8', "NUM", CFG_POSITIVE , &cfg.cdw14, 1, cdw14, 0, }, {"cdw15", '9', "NUM", CFG_POSITIVE , &cfg.cdw15, 1, cdw15, 0, }, {"input-file", 'i', "FILE", CFG_STRING, &cfg.input_file, 1, input, 0, }, {"metadata" , 'M', "FILE", CFG_STRING, &cfg.metadata, 1, metadata, 0, }, {"raw-binary", 'b', ((void*)0), CFG_FLAG, &cfg.raw_binary , 0, raw_dump, 0, }, {"show-command", 's', ((void*)0), CFG_FLAG , &cfg.show_command, 0, show, 0, }, {"read", 'r', ((void* )0), CFG_FLAG, &cfg.read, 0, re, 0, }, {"write", 'w', ((void *)0), CFG_FLAG, &cfg.write, 0, wr, 0, }, {"latency", 'T', ((void*)0), CFG_FLAG, &cfg.latency, 0, latency, 0, }, {"" , 0, ((void*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Global options" , 0, ((void*)0)}, {"verbose", 'v', "NUM", CFG_INCREMENT, & nvme_args.verbose, 0, "Increase output verbosity", 0, }, {"quiet" , 0, ((void*)0), CFG_FLAG, &nvme_args.quiet, 0, "suppress informational output" , 0, }, {"output-format", 'o', "FMT", CFG_STRING, &nvme_args .output_format, 1, "Output format: normal|json|binary", 0, }, {"timeout", 0, "NUM", CFG_POSITIVE, &nvme_args.timeout, 1 , "timeout value, in milliseconds", 0, }, {"dry-run", 0, ((void *)0), CFG_FLAG, &nvme_args.dry_run, 0, "show command instead of executing" , 0, }, {"no-retries", 0, ((void*)0), CFG_FLAG, &nvme_args .no_retries, 0, "disable retry logic on errors", 0, }, {"no-ioctl-probing" , 0, ((void*)0), CFG_FLAG, &nvme_args.no_ioctl_probing, 0 , "disable 64-bit IOCTL support probing", 0, }, {"output-format-version" , 0, "NUM", CFG_POSITIVE, &nvme_args.output_format_ver, 1 , "output format version: 1|2", 0, }, {"human-readable", 'H', ((void*)0), CFG_FLAG, &nvme_args.verbose, 0, ((void*)0), 0, ((void*)0), 1}, {"set-options", 0, "KEY=VALUE", CFG_STRING , &nvme_args.set_options, 1, "set a libnvme library option (key=value[,key=value,...]);" , 0, }, { ((void*)0) } } | |||
| 163 | OPT_FILE("metadata", 'M', &cfg.metadata, metadata),nvme_args.supported_output_formats = (NORMAL | JSON | BINARY) ; struct argconfig_commandline_options opts[] = { {"", 0, ((void *)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Options", 0, ((void *)0)}, {"opcode", 'O', "NUM", CFG_BYTE, &cfg.opcode, 1, opcode , 0, }, {"flags", 'f', "NUM", CFG_BYTE, &cfg.flags, 1, cflags , 0, }, {"prefill", 'p', "NUM", CFG_BYTE, &cfg.prefill, 1 , prefill, 0, }, {"rsvd", 'R', "NUM", CFG_SHORT, &cfg.rsvd , 1, rsvd, 0, }, {"namespace-id", 'n', "NUM", CFG_POSITIVE, & cfg.namespace_id, 1, namespace_desired, 0, }, {"data-len", 'l' , "NUM", CFG_POSITIVE, &cfg.data_len, 1, data_len, 0, }, { "metadata-len", 'm', "NUM", CFG_POSITIVE, &cfg.metadata_len , 1, metadata_len, 0, }, {"cdw2", '2', "NUM", CFG_POSITIVE, & cfg.cdw2, 1, cdw2, 0, }, {"cdw3", '3', "NUM", CFG_POSITIVE, & cfg.cdw3, 1, cdw3, 0, }, {"cdw10", '4', "NUM", CFG_POSITIVE, & cfg.cdw10, 1, cdw10, 0, }, {"cdw11", '5', "NUM", CFG_POSITIVE , &cfg.cdw11, 1, cdw11, 0, }, {"cdw12", '6', "NUM", CFG_POSITIVE , &cfg.cdw12, 1, cdw12, 0, }, {"cdw13", '7', "NUM", CFG_POSITIVE , &cfg.cdw13, 1, cdw13, 0, }, {"cdw14", '8', "NUM", CFG_POSITIVE , &cfg.cdw14, 1, cdw14, 0, }, {"cdw15", '9', "NUM", CFG_POSITIVE , &cfg.cdw15, 1, cdw15, 0, }, {"input-file", 'i', "FILE", CFG_STRING, &cfg.input_file, 1, input, 0, }, {"metadata" , 'M', "FILE", CFG_STRING, &cfg.metadata, 1, metadata, 0, }, {"raw-binary", 'b', ((void*)0), CFG_FLAG, &cfg.raw_binary , 0, raw_dump, 0, }, {"show-command", 's', ((void*)0), CFG_FLAG , &cfg.show_command, 0, show, 0, }, {"read", 'r', ((void* )0), CFG_FLAG, &cfg.read, 0, re, 0, }, {"write", 'w', ((void *)0), CFG_FLAG, &cfg.write, 0, wr, 0, }, {"latency", 'T', ((void*)0), CFG_FLAG, &cfg.latency, 0, latency, 0, }, {"" , 0, ((void*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Global options" , 0, ((void*)0)}, {"verbose", 'v', "NUM", CFG_INCREMENT, & nvme_args.verbose, 0, "Increase output verbosity", 0, }, {"quiet" , 0, ((void*)0), CFG_FLAG, &nvme_args.quiet, 0, "suppress informational output" , 0, }, {"output-format", 'o', "FMT", CFG_STRING, &nvme_args .output_format, 1, "Output format: normal|json|binary", 0, }, {"timeout", 0, "NUM", CFG_POSITIVE, &nvme_args.timeout, 1 , "timeout value, in milliseconds", 0, }, {"dry-run", 0, ((void *)0), CFG_FLAG, &nvme_args.dry_run, 0, "show command instead of executing" , 0, }, {"no-retries", 0, ((void*)0), CFG_FLAG, &nvme_args .no_retries, 0, "disable retry logic on errors", 0, }, {"no-ioctl-probing" , 0, ((void*)0), CFG_FLAG, &nvme_args.no_ioctl_probing, 0 , "disable 64-bit IOCTL support probing", 0, }, {"output-format-version" , 0, "NUM", CFG_POSITIVE, &nvme_args.output_format_ver, 1 , "output format version: 1|2", 0, }, {"human-readable", 'H', ((void*)0), CFG_FLAG, &nvme_args.verbose, 0, ((void*)0), 0, ((void*)0), 1}, {"set-options", 0, "KEY=VALUE", CFG_STRING , &nvme_args.set_options, 1, "set a libnvme library option (key=value[,key=value,...]);" , 0, }, { ((void*)0) } } | |||
| 164 | OPT_FLAG("raw-binary", 'b', &cfg.raw_binary, raw_dump),nvme_args.supported_output_formats = (NORMAL | JSON | BINARY) ; struct argconfig_commandline_options opts[] = { {"", 0, ((void *)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Options", 0, ((void *)0)}, {"opcode", 'O', "NUM", CFG_BYTE, &cfg.opcode, 1, opcode , 0, }, {"flags", 'f', "NUM", CFG_BYTE, &cfg.flags, 1, cflags , 0, }, {"prefill", 'p', "NUM", CFG_BYTE, &cfg.prefill, 1 , prefill, 0, }, {"rsvd", 'R', "NUM", CFG_SHORT, &cfg.rsvd , 1, rsvd, 0, }, {"namespace-id", 'n', "NUM", CFG_POSITIVE, & cfg.namespace_id, 1, namespace_desired, 0, }, {"data-len", 'l' , "NUM", CFG_POSITIVE, &cfg.data_len, 1, data_len, 0, }, { "metadata-len", 'm', "NUM", CFG_POSITIVE, &cfg.metadata_len , 1, metadata_len, 0, }, {"cdw2", '2', "NUM", CFG_POSITIVE, & cfg.cdw2, 1, cdw2, 0, }, {"cdw3", '3', "NUM", CFG_POSITIVE, & cfg.cdw3, 1, cdw3, 0, }, {"cdw10", '4', "NUM", CFG_POSITIVE, & cfg.cdw10, 1, cdw10, 0, }, {"cdw11", '5', "NUM", CFG_POSITIVE , &cfg.cdw11, 1, cdw11, 0, }, {"cdw12", '6', "NUM", CFG_POSITIVE , &cfg.cdw12, 1, cdw12, 0, }, {"cdw13", '7', "NUM", CFG_POSITIVE , &cfg.cdw13, 1, cdw13, 0, }, {"cdw14", '8', "NUM", CFG_POSITIVE , &cfg.cdw14, 1, cdw14, 0, }, {"cdw15", '9', "NUM", CFG_POSITIVE , &cfg.cdw15, 1, cdw15, 0, }, {"input-file", 'i', "FILE", CFG_STRING, &cfg.input_file, 1, input, 0, }, {"metadata" , 'M', "FILE", CFG_STRING, &cfg.metadata, 1, metadata, 0, }, {"raw-binary", 'b', ((void*)0), CFG_FLAG, &cfg.raw_binary , 0, raw_dump, 0, }, {"show-command", 's', ((void*)0), CFG_FLAG , &cfg.show_command, 0, show, 0, }, {"read", 'r', ((void* )0), CFG_FLAG, &cfg.read, 0, re, 0, }, {"write", 'w', ((void *)0), CFG_FLAG, &cfg.write, 0, wr, 0, }, {"latency", 'T', ((void*)0), CFG_FLAG, &cfg.latency, 0, latency, 0, }, {"" , 0, ((void*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Global options" , 0, ((void*)0)}, {"verbose", 'v', "NUM", CFG_INCREMENT, & nvme_args.verbose, 0, "Increase output verbosity", 0, }, {"quiet" , 0, ((void*)0), CFG_FLAG, &nvme_args.quiet, 0, "suppress informational output" , 0, }, {"output-format", 'o', "FMT", CFG_STRING, &nvme_args .output_format, 1, "Output format: normal|json|binary", 0, }, {"timeout", 0, "NUM", CFG_POSITIVE, &nvme_args.timeout, 1 , "timeout value, in milliseconds", 0, }, {"dry-run", 0, ((void *)0), CFG_FLAG, &nvme_args.dry_run, 0, "show command instead of executing" , 0, }, {"no-retries", 0, ((void*)0), CFG_FLAG, &nvme_args .no_retries, 0, "disable retry logic on errors", 0, }, {"no-ioctl-probing" , 0, ((void*)0), CFG_FLAG, &nvme_args.no_ioctl_probing, 0 , "disable 64-bit IOCTL support probing", 0, }, {"output-format-version" , 0, "NUM", CFG_POSITIVE, &nvme_args.output_format_ver, 1 , "output format version: 1|2", 0, }, {"human-readable", 'H', ((void*)0), CFG_FLAG, &nvme_args.verbose, 0, ((void*)0), 0, ((void*)0), 1}, {"set-options", 0, "KEY=VALUE", CFG_STRING , &nvme_args.set_options, 1, "set a libnvme library option (key=value[,key=value,...]);" , 0, }, { ((void*)0) } } | |||
| 165 | OPT_FLAG("show-command", 's', &cfg.show_command, show),nvme_args.supported_output_formats = (NORMAL | JSON | BINARY) ; struct argconfig_commandline_options opts[] = { {"", 0, ((void *)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Options", 0, ((void *)0)}, {"opcode", 'O', "NUM", CFG_BYTE, &cfg.opcode, 1, opcode , 0, }, {"flags", 'f', "NUM", CFG_BYTE, &cfg.flags, 1, cflags , 0, }, {"prefill", 'p', "NUM", CFG_BYTE, &cfg.prefill, 1 , prefill, 0, }, {"rsvd", 'R', "NUM", CFG_SHORT, &cfg.rsvd , 1, rsvd, 0, }, {"namespace-id", 'n', "NUM", CFG_POSITIVE, & cfg.namespace_id, 1, namespace_desired, 0, }, {"data-len", 'l' , "NUM", CFG_POSITIVE, &cfg.data_len, 1, data_len, 0, }, { "metadata-len", 'm', "NUM", CFG_POSITIVE, &cfg.metadata_len , 1, metadata_len, 0, }, {"cdw2", '2', "NUM", CFG_POSITIVE, & cfg.cdw2, 1, cdw2, 0, }, {"cdw3", '3', "NUM", CFG_POSITIVE, & cfg.cdw3, 1, cdw3, 0, }, {"cdw10", '4', "NUM", CFG_POSITIVE, & cfg.cdw10, 1, cdw10, 0, }, {"cdw11", '5', "NUM", CFG_POSITIVE , &cfg.cdw11, 1, cdw11, 0, }, {"cdw12", '6', "NUM", CFG_POSITIVE , &cfg.cdw12, 1, cdw12, 0, }, {"cdw13", '7', "NUM", CFG_POSITIVE , &cfg.cdw13, 1, cdw13, 0, }, {"cdw14", '8', "NUM", CFG_POSITIVE , &cfg.cdw14, 1, cdw14, 0, }, {"cdw15", '9', "NUM", CFG_POSITIVE , &cfg.cdw15, 1, cdw15, 0, }, {"input-file", 'i', "FILE", CFG_STRING, &cfg.input_file, 1, input, 0, }, {"metadata" , 'M', "FILE", CFG_STRING, &cfg.metadata, 1, metadata, 0, }, {"raw-binary", 'b', ((void*)0), CFG_FLAG, &cfg.raw_binary , 0, raw_dump, 0, }, {"show-command", 's', ((void*)0), CFG_FLAG , &cfg.show_command, 0, show, 0, }, {"read", 'r', ((void* )0), CFG_FLAG, &cfg.read, 0, re, 0, }, {"write", 'w', ((void *)0), CFG_FLAG, &cfg.write, 0, wr, 0, }, {"latency", 'T', ((void*)0), CFG_FLAG, &cfg.latency, 0, latency, 0, }, {"" , 0, ((void*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Global options" , 0, ((void*)0)}, {"verbose", 'v', "NUM", CFG_INCREMENT, & nvme_args.verbose, 0, "Increase output verbosity", 0, }, {"quiet" , 0, ((void*)0), CFG_FLAG, &nvme_args.quiet, 0, "suppress informational output" , 0, }, {"output-format", 'o', "FMT", CFG_STRING, &nvme_args .output_format, 1, "Output format: normal|json|binary", 0, }, {"timeout", 0, "NUM", CFG_POSITIVE, &nvme_args.timeout, 1 , "timeout value, in milliseconds", 0, }, {"dry-run", 0, ((void *)0), CFG_FLAG, &nvme_args.dry_run, 0, "show command instead of executing" , 0, }, {"no-retries", 0, ((void*)0), CFG_FLAG, &nvme_args .no_retries, 0, "disable retry logic on errors", 0, }, {"no-ioctl-probing" , 0, ((void*)0), CFG_FLAG, &nvme_args.no_ioctl_probing, 0 , "disable 64-bit IOCTL support probing", 0, }, {"output-format-version" , 0, "NUM", CFG_POSITIVE, &nvme_args.output_format_ver, 1 , "output format version: 1|2", 0, }, {"human-readable", 'H', ((void*)0), CFG_FLAG, &nvme_args.verbose, 0, ((void*)0), 0, ((void*)0), 1}, {"set-options", 0, "KEY=VALUE", CFG_STRING , &nvme_args.set_options, 1, "set a libnvme library option (key=value[,key=value,...]);" , 0, }, { ((void*)0) } } | |||
| 166 | OPT_FLAG("read", 'r', &cfg.read, re),nvme_args.supported_output_formats = (NORMAL | JSON | BINARY) ; struct argconfig_commandline_options opts[] = { {"", 0, ((void *)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Options", 0, ((void *)0)}, {"opcode", 'O', "NUM", CFG_BYTE, &cfg.opcode, 1, opcode , 0, }, {"flags", 'f', "NUM", CFG_BYTE, &cfg.flags, 1, cflags , 0, }, {"prefill", 'p', "NUM", CFG_BYTE, &cfg.prefill, 1 , prefill, 0, }, {"rsvd", 'R', "NUM", CFG_SHORT, &cfg.rsvd , 1, rsvd, 0, }, {"namespace-id", 'n', "NUM", CFG_POSITIVE, & cfg.namespace_id, 1, namespace_desired, 0, }, {"data-len", 'l' , "NUM", CFG_POSITIVE, &cfg.data_len, 1, data_len, 0, }, { "metadata-len", 'm', "NUM", CFG_POSITIVE, &cfg.metadata_len , 1, metadata_len, 0, }, {"cdw2", '2', "NUM", CFG_POSITIVE, & cfg.cdw2, 1, cdw2, 0, }, {"cdw3", '3', "NUM", CFG_POSITIVE, & cfg.cdw3, 1, cdw3, 0, }, {"cdw10", '4', "NUM", CFG_POSITIVE, & cfg.cdw10, 1, cdw10, 0, }, {"cdw11", '5', "NUM", CFG_POSITIVE , &cfg.cdw11, 1, cdw11, 0, }, {"cdw12", '6', "NUM", CFG_POSITIVE , &cfg.cdw12, 1, cdw12, 0, }, {"cdw13", '7', "NUM", CFG_POSITIVE , &cfg.cdw13, 1, cdw13, 0, }, {"cdw14", '8', "NUM", CFG_POSITIVE , &cfg.cdw14, 1, cdw14, 0, }, {"cdw15", '9', "NUM", CFG_POSITIVE , &cfg.cdw15, 1, cdw15, 0, }, {"input-file", 'i', "FILE", CFG_STRING, &cfg.input_file, 1, input, 0, }, {"metadata" , 'M', "FILE", CFG_STRING, &cfg.metadata, 1, metadata, 0, }, {"raw-binary", 'b', ((void*)0), CFG_FLAG, &cfg.raw_binary , 0, raw_dump, 0, }, {"show-command", 's', ((void*)0), CFG_FLAG , &cfg.show_command, 0, show, 0, }, {"read", 'r', ((void* )0), CFG_FLAG, &cfg.read, 0, re, 0, }, {"write", 'w', ((void *)0), CFG_FLAG, &cfg.write, 0, wr, 0, }, {"latency", 'T', ((void*)0), CFG_FLAG, &cfg.latency, 0, latency, 0, }, {"" , 0, ((void*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Global options" , 0, ((void*)0)}, {"verbose", 'v', "NUM", CFG_INCREMENT, & nvme_args.verbose, 0, "Increase output verbosity", 0, }, {"quiet" , 0, ((void*)0), CFG_FLAG, &nvme_args.quiet, 0, "suppress informational output" , 0, }, {"output-format", 'o', "FMT", CFG_STRING, &nvme_args .output_format, 1, "Output format: normal|json|binary", 0, }, {"timeout", 0, "NUM", CFG_POSITIVE, &nvme_args.timeout, 1 , "timeout value, in milliseconds", 0, }, {"dry-run", 0, ((void *)0), CFG_FLAG, &nvme_args.dry_run, 0, "show command instead of executing" , 0, }, {"no-retries", 0, ((void*)0), CFG_FLAG, &nvme_args .no_retries, 0, "disable retry logic on errors", 0, }, {"no-ioctl-probing" , 0, ((void*)0), CFG_FLAG, &nvme_args.no_ioctl_probing, 0 , "disable 64-bit IOCTL support probing", 0, }, {"output-format-version" , 0, "NUM", CFG_POSITIVE, &nvme_args.output_format_ver, 1 , "output format version: 1|2", 0, }, {"human-readable", 'H', ((void*)0), CFG_FLAG, &nvme_args.verbose, 0, ((void*)0), 0, ((void*)0), 1}, {"set-options", 0, "KEY=VALUE", CFG_STRING , &nvme_args.set_options, 1, "set a libnvme library option (key=value[,key=value,...]);" , 0, }, { ((void*)0) } } | |||
| 167 | OPT_FLAG("write", 'w', &cfg.write, wr),nvme_args.supported_output_formats = (NORMAL | JSON | BINARY) ; struct argconfig_commandline_options opts[] = { {"", 0, ((void *)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Options", 0, ((void *)0)}, {"opcode", 'O', "NUM", CFG_BYTE, &cfg.opcode, 1, opcode , 0, }, {"flags", 'f', "NUM", CFG_BYTE, &cfg.flags, 1, cflags , 0, }, {"prefill", 'p', "NUM", CFG_BYTE, &cfg.prefill, 1 , prefill, 0, }, {"rsvd", 'R', "NUM", CFG_SHORT, &cfg.rsvd , 1, rsvd, 0, }, {"namespace-id", 'n', "NUM", CFG_POSITIVE, & cfg.namespace_id, 1, namespace_desired, 0, }, {"data-len", 'l' , "NUM", CFG_POSITIVE, &cfg.data_len, 1, data_len, 0, }, { "metadata-len", 'm', "NUM", CFG_POSITIVE, &cfg.metadata_len , 1, metadata_len, 0, }, {"cdw2", '2', "NUM", CFG_POSITIVE, & cfg.cdw2, 1, cdw2, 0, }, {"cdw3", '3', "NUM", CFG_POSITIVE, & cfg.cdw3, 1, cdw3, 0, }, {"cdw10", '4', "NUM", CFG_POSITIVE, & cfg.cdw10, 1, cdw10, 0, }, {"cdw11", '5', "NUM", CFG_POSITIVE , &cfg.cdw11, 1, cdw11, 0, }, {"cdw12", '6', "NUM", CFG_POSITIVE , &cfg.cdw12, 1, cdw12, 0, }, {"cdw13", '7', "NUM", CFG_POSITIVE , &cfg.cdw13, 1, cdw13, 0, }, {"cdw14", '8', "NUM", CFG_POSITIVE , &cfg.cdw14, 1, cdw14, 0, }, {"cdw15", '9', "NUM", CFG_POSITIVE , &cfg.cdw15, 1, cdw15, 0, }, {"input-file", 'i', "FILE", CFG_STRING, &cfg.input_file, 1, input, 0, }, {"metadata" , 'M', "FILE", CFG_STRING, &cfg.metadata, 1, metadata, 0, }, {"raw-binary", 'b', ((void*)0), CFG_FLAG, &cfg.raw_binary , 0, raw_dump, 0, }, {"show-command", 's', ((void*)0), CFG_FLAG , &cfg.show_command, 0, show, 0, }, {"read", 'r', ((void* )0), CFG_FLAG, &cfg.read, 0, re, 0, }, {"write", 'w', ((void *)0), CFG_FLAG, &cfg.write, 0, wr, 0, }, {"latency", 'T', ((void*)0), CFG_FLAG, &cfg.latency, 0, latency, 0, }, {"" , 0, ((void*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Global options" , 0, ((void*)0)}, {"verbose", 'v', "NUM", CFG_INCREMENT, & nvme_args.verbose, 0, "Increase output verbosity", 0, }, {"quiet" , 0, ((void*)0), CFG_FLAG, &nvme_args.quiet, 0, "suppress informational output" , 0, }, {"output-format", 'o', "FMT", CFG_STRING, &nvme_args .output_format, 1, "Output format: normal|json|binary", 0, }, {"timeout", 0, "NUM", CFG_POSITIVE, &nvme_args.timeout, 1 , "timeout value, in milliseconds", 0, }, {"dry-run", 0, ((void *)0), CFG_FLAG, &nvme_args.dry_run, 0, "show command instead of executing" , 0, }, {"no-retries", 0, ((void*)0), CFG_FLAG, &nvme_args .no_retries, 0, "disable retry logic on errors", 0, }, {"no-ioctl-probing" , 0, ((void*)0), CFG_FLAG, &nvme_args.no_ioctl_probing, 0 , "disable 64-bit IOCTL support probing", 0, }, {"output-format-version" , 0, "NUM", CFG_POSITIVE, &nvme_args.output_format_ver, 1 , "output format version: 1|2", 0, }, {"human-readable", 'H', ((void*)0), CFG_FLAG, &nvme_args.verbose, 0, ((void*)0), 0, ((void*)0), 1}, {"set-options", 0, "KEY=VALUE", CFG_STRING , &nvme_args.set_options, 1, "set a libnvme library option (key=value[,key=value,...]);" , 0, }, { ((void*)0) } } | |||
| 168 | OPT_FLAG("latency", 'T', &cfg.latency, latency))nvme_args.supported_output_formats = (NORMAL | JSON | BINARY) ; struct argconfig_commandline_options opts[] = { {"", 0, ((void *)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Options", 0, ((void *)0)}, {"opcode", 'O', "NUM", CFG_BYTE, &cfg.opcode, 1, opcode , 0, }, {"flags", 'f', "NUM", CFG_BYTE, &cfg.flags, 1, cflags , 0, }, {"prefill", 'p', "NUM", CFG_BYTE, &cfg.prefill, 1 , prefill, 0, }, {"rsvd", 'R', "NUM", CFG_SHORT, &cfg.rsvd , 1, rsvd, 0, }, {"namespace-id", 'n', "NUM", CFG_POSITIVE, & cfg.namespace_id, 1, namespace_desired, 0, }, {"data-len", 'l' , "NUM", CFG_POSITIVE, &cfg.data_len, 1, data_len, 0, }, { "metadata-len", 'm', "NUM", CFG_POSITIVE, &cfg.metadata_len , 1, metadata_len, 0, }, {"cdw2", '2', "NUM", CFG_POSITIVE, & cfg.cdw2, 1, cdw2, 0, }, {"cdw3", '3', "NUM", CFG_POSITIVE, & cfg.cdw3, 1, cdw3, 0, }, {"cdw10", '4', "NUM", CFG_POSITIVE, & cfg.cdw10, 1, cdw10, 0, }, {"cdw11", '5', "NUM", CFG_POSITIVE , &cfg.cdw11, 1, cdw11, 0, }, {"cdw12", '6', "NUM", CFG_POSITIVE , &cfg.cdw12, 1, cdw12, 0, }, {"cdw13", '7', "NUM", CFG_POSITIVE , &cfg.cdw13, 1, cdw13, 0, }, {"cdw14", '8', "NUM", CFG_POSITIVE , &cfg.cdw14, 1, cdw14, 0, }, {"cdw15", '9', "NUM", CFG_POSITIVE , &cfg.cdw15, 1, cdw15, 0, }, {"input-file", 'i', "FILE", CFG_STRING, &cfg.input_file, 1, input, 0, }, {"metadata" , 'M', "FILE", CFG_STRING, &cfg.metadata, 1, metadata, 0, }, {"raw-binary", 'b', ((void*)0), CFG_FLAG, &cfg.raw_binary , 0, raw_dump, 0, }, {"show-command", 's', ((void*)0), CFG_FLAG , &cfg.show_command, 0, show, 0, }, {"read", 'r', ((void* )0), CFG_FLAG, &cfg.read, 0, re, 0, }, {"write", 'w', ((void *)0), CFG_FLAG, &cfg.write, 0, wr, 0, }, {"latency", 'T', ((void*)0), CFG_FLAG, &cfg.latency, 0, latency, 0, }, {"" , 0, ((void*)0), CFG_GROUP_SEPARATOR, ((void*)0), 0, "Global options" , 0, ((void*)0)}, {"verbose", 'v', "NUM", CFG_INCREMENT, & nvme_args.verbose, 0, "Increase output verbosity", 0, }, {"quiet" , 0, ((void*)0), CFG_FLAG, &nvme_args.quiet, 0, "suppress informational output" , 0, }, {"output-format", 'o', "FMT", CFG_STRING, &nvme_args .output_format, 1, "Output format: normal|json|binary", 0, }, {"timeout", 0, "NUM", CFG_POSITIVE, &nvme_args.timeout, 1 , "timeout value, in milliseconds", 0, }, {"dry-run", 0, ((void *)0), CFG_FLAG, &nvme_args.dry_run, 0, "show command instead of executing" , 0, }, {"no-retries", 0, ((void*)0), CFG_FLAG, &nvme_args .no_retries, 0, "disable retry logic on errors", 0, }, {"no-ioctl-probing" , 0, ((void*)0), CFG_FLAG, &nvme_args.no_ioctl_probing, 0 , "disable 64-bit IOCTL support probing", 0, }, {"output-format-version" , 0, "NUM", CFG_POSITIVE, &nvme_args.output_format_ver, 1 , "output format version: 1|2", 0, }, {"human-readable", 'H', ((void*)0), CFG_FLAG, &nvme_args.verbose, 0, ((void*)0), 0, ((void*)0), 1}, {"set-options", 0, "KEY=VALUE", CFG_STRING , &nvme_args.set_options, 1, "set a libnvme library option (key=value[,key=value,...]);" , 0, }, { ((void*)0) } }; | |||
| 169 | ||||
| 170 | err = parse_and_open(&ctx, &hdl, argc, argv, desc, opts); | |||
| 171 | if (err) | |||
| 172 | return err; | |||
| 173 | ||||
| 174 | err = validate_output_format(nvme_args.output_format, &flags_t); | |||
| 175 | if (err < 0) { | |||
| 176 | nvme_show_error("Invalid output format")nvme_show_message(1, "Invalid output format"); | |||
| 177 | return err; | |||
| 178 | } | |||
| 179 | ||||
| 180 | if (!argconfig_parse_seen(opts, "opcode")) { | |||
| 181 | nvme_show_error("%s: opcode parameter required", acmd->name)nvme_show_message(1, "%s: opcode parameter required", acmd-> name); | |||
| 182 | return -EINVAL22; | |||
| 183 | } | |||
| 184 | ||||
| 185 | if (cfg.opcode & 0x01) { | |||
| 186 | cfg.write = true1; | |||
| 187 | flags = O_RDONLY00; | |||
| 188 | dfd = mfd = STDIN_FILENO0; | |||
| 189 | } | |||
| 190 | ||||
| 191 | if (cfg.opcode & 0x02) { | |||
| 192 | cfg.read = true1; | |||
| 193 | flags = O_WRONLY01 | O_CREAT0100 | O_TRUNC01000; | |||
| 194 | dfd = mfd = STDOUT_FILENO1; | |||
| 195 | } | |||
| 196 | ||||
| 197 | /* | |||
| 198 | * Fallback to user specified data direction in case from opcode | |||
| 199 | * we can't decode direction. | |||
| 200 | */ | |||
| 201 | if (cfg.write && flags < 0) { | |||
| 202 | flags = O_RDONLY00; | |||
| 203 | dfd = mfd = STDIN_FILENO0; | |||
| 204 | } | |||
| 205 | ||||
| 206 | if (cfg.read && flags < 0) { | |||
| 207 | flags = O_WRONLY01 | O_CREAT0100 | O_TRUNC01000; | |||
| 208 | dfd = mfd = STDOUT_FILENO1; | |||
| 209 | } | |||
| 210 | if (strlen(cfg.input_file)) { | |||
| 211 | if (flags < 0) { | |||
| 212 | nvme_show_error("input file specified for opcode 0x%x "nvme_show_message(1, "input file specified for opcode 0x%x " "without a data transfer direction" , cfg.opcode) | |||
| 213 | "without a data transfer direction",nvme_show_message(1, "input file specified for opcode 0x%x " "without a data transfer direction" , cfg.opcode) | |||
| 214 | cfg.opcode)nvme_show_message(1, "input file specified for opcode 0x%x " "without a data transfer direction" , cfg.opcode); | |||
| 215 | return -EINVAL22; | |||
| 216 | } | |||
| 217 | dfd = shr_open_rawdata(cfg.input_file, flags, mode)open((cfg.input_file), (flags), mode); | |||
| 218 | if (dfd < 0) { | |||
| 219 | nvme_show_perror(cfg.input_file); | |||
| 220 | return -EINVAL22; | |||
| 221 | } | |||
| 222 | } | |||
| 223 | ||||
| 224 | if (cfg.metadata && strlen(cfg.metadata)) { | |||
| 225 | if (flags < 0) { | |||
| 226 | nvme_show_error("metadata file specified for opcode 0x%x "nvme_show_message(1, "metadata file specified for opcode 0x%x " "without a data transfer direction", cfg.opcode) | |||
| 227 | "without a data transfer direction",nvme_show_message(1, "metadata file specified for opcode 0x%x " "without a data transfer direction", cfg.opcode) | |||
| 228 | cfg.opcode)nvme_show_message(1, "metadata file specified for opcode 0x%x " "without a data transfer direction", cfg.opcode); | |||
| 229 | return -EINVAL22; | |||
| 230 | } | |||
| 231 | mfd = shr_open_rawdata(cfg.metadata, flags, mode)open((cfg.metadata), (flags), mode); | |||
| 232 | if (mfd < 0) { | |||
| 233 | nvme_show_perror(cfg.metadata); | |||
| 234 | return -EINVAL22; | |||
| 235 | } | |||
| 236 | } | |||
| 237 | ||||
| 238 | if (cfg.metadata_len) { | |||
| 239 | mdata = malloc(cfg.metadata_len); | |||
| 240 | if (!mdata) | |||
| 241 | return -ENOMEM12; | |||
| 242 | ||||
| 243 | if (cfg.write
| |||
| 244 | if (read(mfd, mdata, cfg.metadata_len) < 0) { | |||
| 245 | err = -errno(*__errno_location ()); | |||
| 246 | nvme_show_perror("failed to read metadata write buffer"); | |||
| 247 | return err; | |||
| 248 | } | |||
| 249 | } else { | |||
| 250 | memset(mdata, cfg.prefill, cfg.metadata_len); | |||
| 251 | } | |||
| 252 | } | |||
| 253 | ||||
| 254 | if (cfg.data_len) { | |||
| 255 | data = libnvme_alloc_huge(cfg.data_len, &mh); | |||
| 256 | if (!data) { | |||
| 257 | nvme_show_error("failed to allocate huge memory")nvme_show_message(1, "failed to allocate huge memory"); | |||
| ||||
| 258 | return -ENOMEM12; | |||
| 259 | } | |||
| 260 | ||||
| 261 | memset(data, cfg.prefill, cfg.data_len); | |||
| 262 | if (!cfg.read && !cfg.write) { | |||
| 263 | nvme_show_error("data direction not given")nvme_show_message(1, "data direction not given"); | |||
| 264 | return -EINVAL22; | |||
| 265 | } else if (cfg.write) { | |||
| 266 | if (read(dfd, data, cfg.data_len) < 0) { | |||
| 267 | err = -errno(*__errno_location ()); | |||
| 268 | nvme_show_error("failed to read write buffer %s", libnvme_strerror(errno))nvme_show_message(1, "failed to read write buffer %s", libnvme_strerror ((*__errno_location ()))); | |||
| 269 | return err; | |||
| 270 | } | |||
| 271 | } | |||
| 272 | } | |||
| 273 | ||||
| 274 | if (cfg.show_command || nvme_args.dry_run) { | |||
| 275 | nvme_show_result("opcode : %02x", cfg.opcode)nvme_show_message(0, "opcode : %02x", cfg.opcode); | |||
| 276 | nvme_show_result("flags : %02x", cfg.flags)nvme_show_message(0, "flags : %02x", cfg.flags); | |||
| 277 | nvme_show_result("rsvd1 : %04x", cfg.rsvd)nvme_show_message(0, "rsvd1 : %04x", cfg.rsvd); | |||
| 278 | nvme_show_result("nsid : %08x", cfg.namespace_id)nvme_show_message(0, "nsid : %08x", cfg.namespace_id); | |||
| 279 | nvme_show_result("cdw2 : %08x", cfg.cdw2)nvme_show_message(0, "cdw2 : %08x", cfg.cdw2); | |||
| 280 | nvme_show_result("cdw3 : %08x", cfg.cdw3)nvme_show_message(0, "cdw3 : %08x", cfg.cdw3); | |||
| 281 | nvme_show_result("data_len : %08x", cfg.data_len)nvme_show_message(0, "data_len : %08x", cfg.data_len); | |||
| 282 | nvme_show_result("metadata_len : %08x", cfg.metadata_len)nvme_show_message(0, "metadata_len : %08x", cfg.metadata_len); | |||
| 283 | nvme_show_result("addr : %"PRIx64, (uint64_t)(uintptr_t)data)nvme_show_message(0, "addr : %""l" "x", (uint64_t)(uintptr_t )data); | |||
| 284 | nvme_show_result("metadata : %"PRIx64, (uint64_t)(uintptr_t)mdata)nvme_show_message(0, "metadata : %""l" "x", (uint64_t)(uintptr_t )mdata); | |||
| 285 | nvme_show_result("cdw10 : %08x", cfg.cdw10)nvme_show_message(0, "cdw10 : %08x", cfg.cdw10); | |||
| 286 | nvme_show_result("cdw11 : %08x", cfg.cdw11)nvme_show_message(0, "cdw11 : %08x", cfg.cdw11); | |||
| 287 | nvme_show_result("cdw12 : %08x", cfg.cdw12)nvme_show_message(0, "cdw12 : %08x", cfg.cdw12); | |||
| 288 | nvme_show_result("cdw13 : %08x", cfg.cdw13)nvme_show_message(0, "cdw13 : %08x", cfg.cdw13); | |||
| 289 | nvme_show_result("cdw14 : %08x", cfg.cdw14)nvme_show_message(0, "cdw14 : %08x", cfg.cdw14); | |||
| 290 | nvme_show_result("cdw15 : %08x", cfg.cdw15)nvme_show_message(0, "cdw15 : %08x", cfg.cdw15); | |||
| 291 | nvme_show_result("timeout_ms : %08x", nvme_args.timeout)nvme_show_message(0, "timeout_ms : %08x", nvme_args.timeout ); | |||
| 292 | } | |||
| 293 | if (nvme_args.dry_run) | |||
| 294 | return 0; | |||
| 295 | ||||
| 296 | gettimeofday(&start_time, NULL((void*)0)); | |||
| 297 | ||||
| 298 | struct libnvme_passthru_cmd cmd = { | |||
| 299 | .opcode = cfg.opcode, | |||
| 300 | .flags = cfg.flags, | |||
| 301 | .nsid = cfg.namespace_id, | |||
| 302 | .cdw2 = cfg.cdw2, | |||
| 303 | .cdw3 = cfg.cdw3, | |||
| 304 | .metadata = (__u64)(uintptr_t)mdata, | |||
| 305 | .addr = (__u64)(uintptr_t)data, | |||
| 306 | .metadata_len = cfg.metadata_len, | |||
| 307 | .data_len = cfg.data_len, | |||
| 308 | .cdw10 = cfg.cdw10, | |||
| 309 | .cdw11 = cfg.cdw11, | |||
| 310 | .cdw12 = cfg.cdw12, | |||
| 311 | .cdw13 = cfg.cdw13, | |||
| 312 | .cdw14 = cfg.cdw14, | |||
| 313 | .cdw15 = cfg.cdw15, | |||
| 314 | .timeout_ms = nvme_args.timeout, | |||
| 315 | }; | |||
| 316 | if (admin) | |||
| 317 | err = libnvme_exec_admin_passthru(hdl, &cmd); | |||
| 318 | else | |||
| 319 | err = libnvme_exec_io_passthru(hdl, &cmd); | |||
| 320 | ||||
| 321 | gettimeofday(&end_time, NULL((void*)0)); | |||
| 322 | cmd_name = nvme_cmd_to_string(admin, cfg.opcode); | |||
| 323 | if (cfg.latency) | |||
| 324 | nvme_show_result("%s Command %s latency: %llu us", admin ? "Admin" : "IO",nvme_show_message(0, "%s Command %s latency: %llu us", admin ? "Admin" : "IO", strcmp(cmd_name, "Unknown") ? cmd_name : "Vendor Specific" , shr_elapsed_utime(start_time, end_time)) | |||
| 325 | strcmp(cmd_name, "Unknown") ? cmd_name : "Vendor Specific",nvme_show_message(0, "%s Command %s latency: %llu us", admin ? "Admin" : "IO", strcmp(cmd_name, "Unknown") ? cmd_name : "Vendor Specific" , shr_elapsed_utime(start_time, end_time)) | |||
| 326 | shr_elapsed_utime(start_time, end_time))nvme_show_message(0, "%s Command %s latency: %llu us", admin ? "Admin" : "IO", strcmp(cmd_name, "Unknown") ? cmd_name : "Vendor Specific" , shr_elapsed_utime(start_time, end_time)); | |||
| 327 | ||||
| 328 | if (err) { | |||
| 329 | nvme_show_err(err, __func__); | |||
| 330 | return err; | |||
| 331 | } | |||
| 332 | ||||
| 333 | nvme_show_verbose_result("%s Command %s is Success and result: 0x%" PRIx64,nvme_show_verbose_message("%s Command %s is Success and result: 0x%" "l" "x", admin ? "Admin" : "IO", strcmp(cmd_name, "Unknown") ? cmd_name : "Vendor Specific", (uint64_t)cmd.result) | |||
| 334 | admin ? "Admin" : "IO",nvme_show_verbose_message("%s Command %s is Success and result: 0x%" "l" "x", admin ? "Admin" : "IO", strcmp(cmd_name, "Unknown") ? cmd_name : "Vendor Specific", (uint64_t)cmd.result) | |||
| 335 | strcmp(cmd_name, "Unknown") ?nvme_show_verbose_message("%s Command %s is Success and result: 0x%" "l" "x", admin ? "Admin" : "IO", strcmp(cmd_name, "Unknown") ? cmd_name : "Vendor Specific", (uint64_t)cmd.result) | |||
| 336 | cmd_name : "Vendor Specific", (uint64_t)cmd.result)nvme_show_verbose_message("%s Command %s is Success and result: 0x%" "l" "x", admin ? "Admin" : "IO", strcmp(cmd_name, "Unknown") ? cmd_name : "Vendor Specific", (uint64_t)cmd.result); | |||
| 337 | if (cfg.read) | |||
| 338 | passthru_print_read_output(cfg, data, dfd, mdata, mfd, err); | |||
| 339 | ||||
| 340 | return err; | |||
| 341 | } | |||
| 342 | ||||
| 343 | static int io_passthru(int argc, char **argv, struct command *acmd, struct plugin *plugin) | |||
| 344 | { | |||
| 345 | const char *desc = | |||
| 346 | "Send a user-defined IO command to the specified device via IOCTL passthrough, return results."; | |||
| 347 | ||||
| 348 | return passthru(argc, argv, false0, desc, acmd); | |||
| 349 | } | |||
| 350 | ||||
| 351 | static int admin_passthru(int argc, char **argv, struct command *acmd, struct plugin *plugin) | |||
| 352 | { | |||
| 353 | const char *desc = | |||
| 354 | "Send a user-defined Admin command to the specified device via IOCTL passthrough, return results."; | |||
| 355 | ||||
| 356 | return passthru(argc, argv, true1, desc, acmd); | |||
| ||||
| 357 | } | |||
| 358 | ||||
| 359 | static struct command admin_passthru_cmd = { | |||
| 360 | .name = "admin-passthru", | |||
| 361 | .help = "Submit an arbitrary admin command, return results", | |||
| 362 | .fn = admin_passthru, | |||
| 363 | }; | |||
| 364 | ||||
| 365 | static struct command io_passthru_cmd = { | |||
| 366 | .name = "io-passthru", | |||
| 367 | .help = "Submit an arbitrary IO command, return results", | |||
| 368 | .fn = io_passthru, | |||
| 369 | }; | |||
| 370 | ||||
| 371 | static struct command *commands[] = { | |||
| 372 | &admin_passthru_cmd, | |||
| 373 | &io_passthru_cmd, | |||
| 374 | NULL((void*)0), | |||
| 375 | }; | |||
| 376 | ||||
| 377 | static void __shr_constructor__attribute__((constructor)) register_group(void) | |||
| 378 | { | |||
| 379 | plugin_add_group(&builtin, "Passthrough", commands); | |||
| 380 | } |