Skip to content

Commit

Permalink
nvme-fabrics: allow user passing data digest
Browse files Browse the repository at this point in the history
Data digest is a nvme-tcp specific feature, but nothing prevents other
transports reusing the concept so do not associate with tcp transport
solely.

Signed-off-by: Sagi Grimberg <sagi@lightbitslabs.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
  • Loading branch information
Sagi Grimberg authored and Christoph Hellwig committed Dec 13, 2018
1 parent 3b49fa8 commit 20d44e8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/nvme/host/fabrics.c
Original file line number Diff line number Diff line change
Expand Up @@ -615,6 +615,7 @@ static const match_table_t opt_tokens = {
{ NVMF_OPT_DUP_CONNECT, "duplicate_connect" },
{ NVMF_OPT_DISABLE_SQFLOW, "disable_sqflow" },
{ NVMF_OPT_HDR_DIGEST, "hdr_digest" },
{ NVMF_OPT_DATA_DIGEST, "data_digest" },
{ NVMF_OPT_ERR, NULL }
};

Expand All @@ -635,6 +636,7 @@ static int nvmf_parse_options(struct nvmf_ctrl_options *opts,
opts->kato = NVME_DEFAULT_KATO;
opts->duplicate_connect = false;
opts->hdr_digest = false;
opts->data_digest = false;

options = o = kstrdup(buf, GFP_KERNEL);
if (!options)
Expand Down Expand Up @@ -832,6 +834,9 @@ static int nvmf_parse_options(struct nvmf_ctrl_options *opts,
case NVMF_OPT_HDR_DIGEST:
opts->hdr_digest = true;
break;
case NVMF_OPT_DATA_DIGEST:
opts->data_digest = true;
break;
default:
pr_warn("unknown parameter or missing value '%s' in ctrl creation request\n",
p);
Expand Down
2 changes: 2 additions & 0 deletions drivers/nvme/host/fabrics.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ enum {
NVMF_OPT_DUP_CONNECT = 1 << 13,
NVMF_OPT_DISABLE_SQFLOW = 1 << 14,
NVMF_OPT_HDR_DIGEST = 1 << 15,
NVMF_OPT_DATA_DIGEST = 1 << 16,
};

/**
Expand Down Expand Up @@ -105,6 +106,7 @@ struct nvmf_ctrl_options {
int max_reconnects;
bool disable_sqflow;
bool hdr_digest;
bool data_digest;
};

/*
Expand Down

0 comments on commit 20d44e8

Please sign in to comment.