Skip to content

Commit 20d44e8

Browse files
Sagi GrimbergChristoph Hellwig
authored andcommitted
nvme-fabrics: allow user passing data digest
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>
1 parent 3b49fa8 commit 20d44e8

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

drivers/nvme/host/fabrics.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -615,6 +615,7 @@ static const match_table_t opt_tokens = {
615615
{ NVMF_OPT_DUP_CONNECT, "duplicate_connect" },
616616
{ NVMF_OPT_DISABLE_SQFLOW, "disable_sqflow" },
617617
{ NVMF_OPT_HDR_DIGEST, "hdr_digest" },
618+
{ NVMF_OPT_DATA_DIGEST, "data_digest" },
618619
{ NVMF_OPT_ERR, NULL }
619620
};
620621

@@ -635,6 +636,7 @@ static int nvmf_parse_options(struct nvmf_ctrl_options *opts,
635636
opts->kato = NVME_DEFAULT_KATO;
636637
opts->duplicate_connect = false;
637638
opts->hdr_digest = false;
639+
opts->data_digest = false;
638640

639641
options = o = kstrdup(buf, GFP_KERNEL);
640642
if (!options)
@@ -832,6 +834,9 @@ static int nvmf_parse_options(struct nvmf_ctrl_options *opts,
832834
case NVMF_OPT_HDR_DIGEST:
833835
opts->hdr_digest = true;
834836
break;
837+
case NVMF_OPT_DATA_DIGEST:
838+
opts->data_digest = true;
839+
break;
835840
default:
836841
pr_warn("unknown parameter or missing value '%s' in ctrl creation request\n",
837842
p);

drivers/nvme/host/fabrics.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ enum {
6060
NVMF_OPT_DUP_CONNECT = 1 << 13,
6161
NVMF_OPT_DISABLE_SQFLOW = 1 << 14,
6262
NVMF_OPT_HDR_DIGEST = 1 << 15,
63+
NVMF_OPT_DATA_DIGEST = 1 << 16,
6364
};
6465

6566
/**
@@ -105,6 +106,7 @@ struct nvmf_ctrl_options {
105106
int max_reconnects;
106107
bool disable_sqflow;
107108
bool hdr_digest;
109+
bool data_digest;
108110
};
109111

110112
/*

0 commit comments

Comments
 (0)