nvmf: Allow fabrics get/set on ASQ and ACQ

This is meaningless for network devices, but will be useful
when emulating the more complete register state of local devices.

Change-Id: I37052e514101c298a1f66cc72135a8c3dd669003
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/420
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
This commit is contained in:
Ben Walker 2020-01-31 15:44:36 -07:00 committed by Tomasz Zawadzki
parent 84479ab6e3
commit 516afb9aa3
2 changed files with 32 additions and 0 deletions

View File

@ -766,6 +766,34 @@ nvmf_prop_set_aqa(struct spdk_nvmf_ctrlr *ctrlr, uint64_t value)
return true;
}
static uint64_t
nvmf_prop_get_asq(struct spdk_nvmf_ctrlr *ctrlr)
{
return ctrlr->vcprop.asq;
}
static bool
nvmf_prop_set_asq(struct spdk_nvmf_ctrlr *ctrlr, uint64_t value)
{
ctrlr->vcprop.asq = value;
return true;
}
static uint64_t
nvmf_prop_get_acq(struct spdk_nvmf_ctrlr *ctrlr)
{
return ctrlr->vcprop.acq;
}
static bool
nvmf_prop_set_acq(struct spdk_nvmf_ctrlr *ctrlr, uint64_t value)
{
ctrlr->vcprop.acq = value;
return true;
}
struct nvmf_prop {
uint32_t ofst;
uint8_t size;
@ -788,6 +816,8 @@ static const struct nvmf_prop nvmf_props[] = {
PROP(cc, 4, nvmf_prop_get_cc, nvmf_prop_set_cc),
PROP(csts, 4, nvmf_prop_get_csts, NULL),
PROP(aqa, 4, nvmf_prop_get_aqa, nvmf_prop_set_aqa),
PROP(asq, 8, nvmf_prop_get_asq, nvmf_prop_set_asq),
PROP(acq, 8, nvmf_prop_get_acq, nvmf_prop_set_acq),
};
static const struct nvmf_prop *

View File

@ -200,6 +200,8 @@ struct spdk_nvmf_ctrlr {
union spdk_nvme_cc_register cc;
union spdk_nvme_csts_register csts;
union spdk_nvme_aqa_register aqa;
uint64_t asq;
uint64_t acq;
} vcprop; /* virtual controller properties */
struct spdk_nvmf_ctrlr_feat feat;