From 5969ca7aa1ac6df2edf01d4198d9a9ea3026dfe5 Mon Sep 17 00:00:00 2001 From: Ankit Kumar Date: Thu, 2 Jun 2022 21:33:29 +0530 Subject: [PATCH] include/nvme_spec.h: update cdata fields for admin command set attributes Add missing fields from identify controller data structure, for admin command set attributes. Update the identify examples file accordingly. Ignore spdk_nvme_cdata_oacs ABI changes, only reserved fields were changed. So this does not constitute an ABI/API breakage. Signed-off-by: Ankit Kumar Change-Id: I718e3647835a0706a33e7aa6bae774e133071f9b Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12866 Community-CI: Broadcom CI Community-CI: Mellanox Build Bot Tested-by: SPDK CI Jenkins Reviewed-by: Ben Walker Reviewed-by: Shuhei Matsumoto --- examples/nvme/identify/identify.c | 28 ++++++++++++++++++ include/spdk/nvme_spec.h | 49 ++++++++++++++++++++++++++----- test/make/check_so_deps.sh | 2 ++ 3 files changed, 71 insertions(+), 8 deletions(-) diff --git a/examples/nvme/identify/identify.c b/examples/nvme/identify/identify.c index 3ddf42297..32e652301 100644 --- a/examples/nvme/identify/identify.c +++ b/examples/nvme/identify/identify.c @@ -1395,6 +1395,10 @@ print_controller(struct spdk_nvme_ctrlr *ctrlr, const struct spdk_nvme_transport cdata->oacs.virtualization_management ? "Supported" : "Not Supported"); printf("Doorbell Buffer Config: %s\n", cdata->oacs.doorbell_buffer_config ? "Supported" : "Not Supported"); + printf("Get LBA Status Capability: %s\n", + cdata->oacs.get_lba_status ? "Supported" : "Not Supported"); + printf("Command & Feature Lockdown Capability: %s\n", + cdata->oacs.doorbell_buffer_config ? "Supported" : "Not Supported"); printf("Abort Command Limit: %d\n", cdata->acl + 1); printf("Async Event Request Limit: %d\n", cdata->aerl + 1); printf("Number of Firmware Slots: "); @@ -1409,6 +1413,18 @@ print_controller(struct spdk_nvme_ctrlr *ctrlr, const struct spdk_nvme_transport } else { printf("N/A\n"); } + printf("Firmware Activation Without Reset: "); + if (cdata->oacs.firmware != 0) { + printf("%s\n", cdata->frmw.activation_without_reset ? "Yes" : "No"); + } else { + printf("N/A\n"); + } + printf("Multiple Update Detection Support: "); + if (cdata->oacs.firmware != 0) { + printf("%s\n", cdata->frmw.multiple_update_detection ? "Yes" : "No"); + } else { + printf("N/A\n"); + } if (cdata->fwug == 0x00) { printf("Firmware Update Granularity: No Information Provided\n"); } else if (cdata->fwug == 0xFF) { @@ -1451,6 +1467,18 @@ print_controller(struct spdk_nvme_ctrlr *ctrlr, const struct spdk_nvme_transport cdata->lpa.edlp ? "Supported" : "Not Supported"); printf("Telemetry Log Pages: %s\n", cdata->lpa.telemetry ? "Supported" : "Not Supported"); + printf("Persistent Event Log Pages: %s\n", + cdata->lpa.pelp ? "Supported" : "Not Supported"); + printf("Supported Log Pages Log Page: %s\n", + cdata->lpa.lplp ? "Supported" : "May Support"); + printf("Commands Supported & Effects Log Page: %s\n", + cdata->lpa.lplp ? "Supported" : "Not Supported"); + printf("Feature Identifiers & Effects Log Page:%s\n", + cdata->lpa.lplp ? "Supported" : "May Support"); + printf("NVMe-MI Commands & Effects Log Page: %s\n", + cdata->lpa.lplp ? "Supported" : "May Support"); + printf("Data Area 4 for Telemetry Log: %s\n", + cdata->lpa.da4_telemetry ? "Supported" : "Not Supported"); printf("Error Log Page Entries Supported: %d\n", cdata->elpe + 1); if (cdata->kas == 0) { printf("Keep Alive: Not Supported\n"); diff --git a/include/spdk/nvme_spec.h b/include/spdk/nvme_spec.h index 3b5961e9d..63603c4ba 100644 --- a/include/spdk/nvme_spec.h +++ b/include/spdk/nvme_spec.h @@ -1776,6 +1776,7 @@ enum spdk_nvmf_ctrlr_model { #define SPDK_NVME_CTRLR_SN_LEN 20 #define SPDK_NVME_CTRLR_MN_LEN 40 #define SPDK_NVME_CTRLR_FR_LEN 8 +#define SPDK_NVME_CTRLR_MEGCAP_LEN 16 /** Identify Controller data sgls.supported values */ enum spdk_nvme_sgls_supported { @@ -1888,7 +1889,10 @@ struct spdk_nvme_cdata_oacs { /** Supports SPDK_NVME_OPC_GET_LBA_STATUS */ uint16_t get_lba_status : 1; - uint16_t oacs_rsvd : 6; + /** Supports command and feature lockdown capability */ + uint16_t command_feature_lockdown : 1; + + uint16_t oacs_rsvd : 5; }; struct spdk_nvme_cdata_fuses { @@ -2108,7 +2112,10 @@ struct __attribute__((packed)) spdk_nvme_ctrlr_data { /* support activation without reset */ uint8_t activation_without_reset : 1; - uint8_t frmw_rsvd : 3; + /* Support multiple update detection */ + uint8_t multiple_update_detection : 1; + + uint8_t frmw_rsvd : 2; } frmw; /** log page attributes */ @@ -2119,9 +2126,15 @@ struct __attribute__((packed)) spdk_nvme_ctrlr_data { uint8_t celp : 1; /* extended data for get log page */ uint8_t edlp: 1; - /** telemetry log pages and notices */ + /* telemetry log pages and notices */ uint8_t telemetry : 1; - uint8_t lpa_rsvd : 4; + /* Persistent event log */ + uint8_t pelp : 1; + /* Log pages log page */ + uint8_t lplp : 1; + /* Data Area 4 for telemetry */ + uint8_t da4_telemetry : 1; + uint8_t lpa_rsvd : 1; } lpa; /** error log page entries */ @@ -2236,8 +2249,17 @@ struct __attribute__((packed)) spdk_nvme_ctrlr_data { } bits; } sanicap; - /* bytes 332-342 */ - uint8_t reserved3[10]; + /** Host memory buffer minimum descriptor entry size */ + uint32_t hmminds; + + /** Host memory maximum descriptor entries */ + uint16_t hmmaxd; + + /** NVM set identifier maximum */ + uint16_t nsetidmax; + + /** Endurance group identifier maximum */ + uint16_t endgidmax; /** ANA transition time */ uint8_t anatt; @@ -2259,8 +2281,19 @@ struct __attribute__((packed)) spdk_nvme_ctrlr_data { /* bytes 348-351: number of ANA group identifiers */ uint32_t nanagrpid; - /* bytes 352-511 */ - uint8_t reserved352[160]; + /* bytes 352-355: persistent event log size */ + uint32_t pels; + + /* Domain identifier that contains this controller */ + uint16_t domain_identifier; + + uint8_t reserved3[10]; + + /* Maximum capacity of a single endurance group */ + uint8_t megcap[SPDK_NVME_CTRLR_MEGCAP_LEN]; + + /* bytes 384-511 */ + uint8_t reserved384[128]; /* bytes 512-703: nvm command set attributes */ diff --git a/test/make/check_so_deps.sh b/test/make/check_so_deps.sh index 5e491645d..8010eb331 100755 --- a/test/make/check_so_deps.sh +++ b/test/make/check_so_deps.sh @@ -53,6 +53,8 @@ function confirm_abi_deps() { name = spdk_nvme_power_state [suppress_type] name = spdk_nvme_ctrlr_data +[suppress_type] + name = spdk_nvme_cdata_oacs EOF for object in "$libdir"/libspdk_*.so; do