nvme : Add OPTPERF definition to nvme_spec.h

When ns set OPTPERF to 1, use NPWG and NPWA to set sectors_per_stripe.

Signed-off-by: sunshihao <sunshihao@huawei.com>
Change-Id: Iaf72ba5a7f21b33c357fba8deced9616e0bfaca6
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6613
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This commit is contained in:
sunshihao520 2021-03-02 10:32:01 +08:00 committed by Tomasz Zawadzki
parent 5bdaec6322
commit 45b6720bef
2 changed files with 22 additions and 2 deletions

View File

@ -39,6 +39,8 @@ Added `spdk_nvme_qpair_get_optimal_poll_group` function and `qpair_get_optimal_p
function pointer in spdk_nvmf_transport_ops structure in order to add the qpair to the most
suitable polling group.
Add OPTPERF and namespace optimal performance fields to nvme_spec.h.
Added spdk_nvme_set_hotplug_filter API to allow applications to choose which
hot-inserted SSDs should be probed. This is useful for use cases where multiple
independent SPDK processes are running on one node. The filter function can

View File

@ -2295,7 +2295,10 @@ struct spdk_nvme_ns_data {
/** Non-zero NGUID and EUI64 for namespace are never reused */
uint8_t guid_never_reused : 1;
uint8_t reserved1 : 4;
/** Optimal Performance field */
uint8_t optperf : 1;
uint8_t reserved1 : 3;
} nsfeat;
/** number of lba formats */
@ -2444,7 +2447,22 @@ struct spdk_nvme_ns_data {
/** NVM capacity */
uint64_t nvmcap[2];
uint8_t reserved64[28];
/** Namespace Preferred Write Granularity */
uint16_t npwg;
/** Namespace Preferred Write Alignment */
uint16_t npwa;
/** Namespace Preferred Deallocate Granularity */
uint16_t npdg;
/** Namespace Preferred Deallocate Alignment */
uint16_t npda;
/** Namespace Optimal Write Size */
uint16_t nows;
uint8_t reserved64[18];
/** ANA group identifier */
uint32_t anagrpid;