@@ -78,6 +78,7 @@ static struct config {
int disable_sqflow;
int hdr_digest;
int data_digest;
+ int pi_enable;
bool persistent;
bool quiet;
} cfg = { NULL };
@@ -851,7 +852,9 @@ static int build_options(char *argstr, int max_len, bool discover)
add_bool_argument(&argstr, &max_len, "disable_sqflow",
cfg.disable_sqflow) ||
add_bool_argument(&argstr, &max_len, "hdr_digest", cfg.hdr_digest) ||
- add_bool_argument(&argstr, &max_len, "data_digest", cfg.data_digest))
+ add_bool_argument(&argstr, &max_len, "data_digest",
+ cfg.data_digest) ||
+ add_bool_argument(&argstr, &max_len, "pi_enable", cfg.pi_enable))
return -EINVAL;
return 0;
@@ -980,6 +983,13 @@ retry:
p += len;
}
+ if (cfg.pi_enable) {
+ len = sprintf(p, ",pi_enable");
+ if (len < 0)
+ return -EINVAL;
+ p += len;
+ }
+
switch (e->trtype) {
case NVMF_TRTYPE_RDMA:
case NVMF_TRTYPE_TCP:
@@ -1259,6 +1269,7 @@ int discover(const char *desc, int argc, char **argv, bool connect)
OPT_INT("tos", 'T', &cfg.tos, "type of service"),
OPT_FLAG("hdr_digest", 'g', &cfg.hdr_digest, "enable transport protocol header digest (TCP transport)"),
OPT_FLAG("data_digest", 'G', &cfg.data_digest, "enable transport protocol data digest (TCP transport)"),
+ OPT_FLAG("pi_enable", 'p', &cfg.pi_enable, "enable metadata (T10-PI) support (default false)"),
OPT_INT("nr-io-queues", 'i', &cfg.nr_io_queues, "number of io queues to use (default is core count)"),
OPT_INT("nr-write-queues", 'W', &cfg.nr_write_queues, "number of write queues to use (default 0)"),
OPT_INT("nr-poll-queues", 'P', &cfg.nr_poll_queues, "number of poll queues to use (default 0)"),
@@ -1319,6 +1330,7 @@ int connect(const char *desc, int argc, char **argv)
OPT_FLAG("disable-sqflow", 'd', &cfg.disable_sqflow, "disable controller sq flow control (default false)"),
OPT_FLAG("hdr-digest", 'g', &cfg.hdr_digest, "enable transport protocol header digest (TCP transport)"),
OPT_FLAG("data-digest", 'G', &cfg.data_digest, "enable transport protocol data digest (TCP transport)"),
+ OPT_FLAG("pi_enable", 'p', &cfg.pi_enable, "enable metadata (T10-PI) support (default false)"),
OPT_END()
};