nvmf: Add a flag dif_insert_or_strip to struct spdk_nvmf_ctrlr

Add a flag dif_insert_or_strip to struct spdk_nvmf_ctrlr that indicates
whether DIF insert/strip is done.

Copy the DIF insert/strip setting of the corresponding transport options
to the flag at NVMf controller creation.

The purpose of this patch is to make DIF insert/strip not per-transport
option but per-controller option because we may want to be able to
control DIF insert/strip per controller at some point. Besides this patch
will clean the implementation.

Besides align indent around the change.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I57f65960b430e55f4021ed514aacd85581ff9993
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/461313
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
This commit is contained in:
Shuhei Matsumoto 2019-07-11 07:41:54 +09:00 committed by Darek Stojaczyk
parent a4b0a2b6fd
commit 91da9aaafe
2 changed files with 7 additions and 3 deletions

View File

@ -352,6 +352,8 @@ spdk_nvmf_ctrlr_create(struct spdk_nvmf_subsystem *subsystem,
SPDK_DEBUGLOG(SPDK_LOG_NVMF, "cc 0x%x\n", ctrlr->vcprop.cc.raw);
SPDK_DEBUGLOG(SPDK_LOG_NVMF, "csts 0x%x\n", ctrlr->vcprop.csts.raw);
ctrlr->dif_insert_or_strip = transport->opts.dif_insert_or_strip;
req->qpair->ctrlr = ctrlr;
spdk_thread_send_msg(subsystem->thread, _spdk_nvmf_subsystem_add_ctrlr, req);

View File

@ -313,6 +313,8 @@ struct spdk_nvmf_ctrlr {
uint64_t last_keep_alive_tick;
struct spdk_poller *keep_alive_poller;
bool dif_insert_or_strip;
TAILQ_ENTRY(spdk_nvmf_ctrlr) link;
};