Loading include/spdk/nvme_intel.h +9 −1 Original line number Diff line number Diff line Loading @@ -73,6 +73,7 @@ enum spdk_nvme_intel_log_page { SPDK_NVME_INTEL_LOG_WRITE_CMD_LATENCY = 0xC2, SPDK_NVME_INTEL_LOG_TEMPERATURE = 0xC5, SPDK_NVME_INTEL_LOG_SMART = 0xCA, SPDK_NVME_INTEL_MARKETING_DESCRIPTION = 0xDD, }; enum spdk_nvme_intel_smart_attribute_code { Loading Loading @@ -101,7 +102,9 @@ struct spdk_nvme_intel_log_page_directory { uint8_t temperature_statistics_log_len; uint8_t reserved4[9]; uint8_t smart_log_len; uint8_t reserved5[107]; uint8_t reserved5[37]; uint8_t marketing_description_log_len; uint8_t reserved6[69]; }; SPDK_STATIC_ASSERT(sizeof(struct spdk_nvme_intel_log_page_directory) == 512, "Incorrect size"); Loading Loading @@ -198,6 +201,11 @@ union spdk_nvme_intel_feat_latency_tracking { }; SPDK_STATIC_ASSERT(sizeof(union spdk_nvme_intel_feat_latency_tracking) == 4, "Incorrect size"); struct spdk_nvme_intel_marketing_description_page { uint8_t marketing_product[512]; }; SPDK_STATIC_ASSERT(sizeof(struct spdk_nvme_intel_marketing_description_page) == 512, "Incorrect size"); #ifdef __cplusplus } #endif Loading lib/nvme/nvme_ctrlr.c +3 −0 Original line number Diff line number Diff line Loading @@ -222,6 +222,9 @@ nvme_ctrlr_construct_intel_support_log_page_list(struct spdk_nvme_ctrlr *ctrlr, if (log_page_directory->smart_log_len) { ctrlr->log_page_supported[SPDK_NVME_INTEL_LOG_SMART] = true; } if (log_page_directory->marketing_description_log_len) { ctrlr->log_page_supported[SPDK_NVME_INTEL_MARKETING_DESCRIPTION] = true; } } static int nvme_ctrlr_set_intel_support_log_pages(struct spdk_nvme_ctrlr *ctrlr) Loading test/lib/nvme/unit/nvme_ctrlr_cmd_c/nvme_ctrlr_cmd_ut.c +25 −0 Original line number Diff line number Diff line Loading @@ -178,6 +178,18 @@ static void verify_intel_get_log_page_directory(struct nvme_request *req) CU_ASSERT(req->cmd.cdw10 == temp_cdw10); } static void verify_intel_marketing_description_log_page(struct nvme_request *req) { uint32_t temp_cdw10; CU_ASSERT(req->cmd.opc == SPDK_NVME_OPC_GET_LOG_PAGE); temp_cdw10 = ((sizeof(struct spdk_nvme_intel_marketing_description_page) / sizeof( uint32_t) - 1) << 16) | SPDK_NVME_INTEL_MARKETING_DESCRIPTION; CU_ASSERT(req->cmd.cdw10 == temp_cdw10); } static void verify_namespace_attach(struct nvme_request *req) { CU_ASSERT(req->cmd.opc == SPDK_NVME_OPC_NS_ATTACHMENT); Loading Loading @@ -369,6 +381,18 @@ static void test_intel_get_log_page_directory(void) &payload, sizeof(payload), NULL, NULL); } static void test_intel_marketing_description_get_log_page(void) { struct spdk_nvme_ctrlr ctrlr = {}; struct spdk_nvme_intel_marketing_description_page payload = {}; verify_fn = verify_intel_marketing_description_log_page; spdk_nvme_ctrlr_cmd_get_log_page(&ctrlr, SPDK_NVME_INTEL_MARKETING_DESCRIPTION, SPDK_NVME_GLOBAL_NS_TAG, &payload, sizeof(payload), NULL, NULL); } static void test_generic_get_log_pages(void) { test_error_get_log_page(); Loading @@ -383,6 +407,7 @@ static void test_intel_get_log_pages(void) test_intel_temperature_get_log_page(); test_intel_read_latency_get_log_page(); test_intel_write_latency_get_log_page(); test_intel_marketing_description_get_log_page(); } static void Loading Loading
include/spdk/nvme_intel.h +9 −1 Original line number Diff line number Diff line Loading @@ -73,6 +73,7 @@ enum spdk_nvme_intel_log_page { SPDK_NVME_INTEL_LOG_WRITE_CMD_LATENCY = 0xC2, SPDK_NVME_INTEL_LOG_TEMPERATURE = 0xC5, SPDK_NVME_INTEL_LOG_SMART = 0xCA, SPDK_NVME_INTEL_MARKETING_DESCRIPTION = 0xDD, }; enum spdk_nvme_intel_smart_attribute_code { Loading Loading @@ -101,7 +102,9 @@ struct spdk_nvme_intel_log_page_directory { uint8_t temperature_statistics_log_len; uint8_t reserved4[9]; uint8_t smart_log_len; uint8_t reserved5[107]; uint8_t reserved5[37]; uint8_t marketing_description_log_len; uint8_t reserved6[69]; }; SPDK_STATIC_ASSERT(sizeof(struct spdk_nvme_intel_log_page_directory) == 512, "Incorrect size"); Loading Loading @@ -198,6 +201,11 @@ union spdk_nvme_intel_feat_latency_tracking { }; SPDK_STATIC_ASSERT(sizeof(union spdk_nvme_intel_feat_latency_tracking) == 4, "Incorrect size"); struct spdk_nvme_intel_marketing_description_page { uint8_t marketing_product[512]; }; SPDK_STATIC_ASSERT(sizeof(struct spdk_nvme_intel_marketing_description_page) == 512, "Incorrect size"); #ifdef __cplusplus } #endif Loading
lib/nvme/nvme_ctrlr.c +3 −0 Original line number Diff line number Diff line Loading @@ -222,6 +222,9 @@ nvme_ctrlr_construct_intel_support_log_page_list(struct spdk_nvme_ctrlr *ctrlr, if (log_page_directory->smart_log_len) { ctrlr->log_page_supported[SPDK_NVME_INTEL_LOG_SMART] = true; } if (log_page_directory->marketing_description_log_len) { ctrlr->log_page_supported[SPDK_NVME_INTEL_MARKETING_DESCRIPTION] = true; } } static int nvme_ctrlr_set_intel_support_log_pages(struct spdk_nvme_ctrlr *ctrlr) Loading
test/lib/nvme/unit/nvme_ctrlr_cmd_c/nvme_ctrlr_cmd_ut.c +25 −0 Original line number Diff line number Diff line Loading @@ -178,6 +178,18 @@ static void verify_intel_get_log_page_directory(struct nvme_request *req) CU_ASSERT(req->cmd.cdw10 == temp_cdw10); } static void verify_intel_marketing_description_log_page(struct nvme_request *req) { uint32_t temp_cdw10; CU_ASSERT(req->cmd.opc == SPDK_NVME_OPC_GET_LOG_PAGE); temp_cdw10 = ((sizeof(struct spdk_nvme_intel_marketing_description_page) / sizeof( uint32_t) - 1) << 16) | SPDK_NVME_INTEL_MARKETING_DESCRIPTION; CU_ASSERT(req->cmd.cdw10 == temp_cdw10); } static void verify_namespace_attach(struct nvme_request *req) { CU_ASSERT(req->cmd.opc == SPDK_NVME_OPC_NS_ATTACHMENT); Loading Loading @@ -369,6 +381,18 @@ static void test_intel_get_log_page_directory(void) &payload, sizeof(payload), NULL, NULL); } static void test_intel_marketing_description_get_log_page(void) { struct spdk_nvme_ctrlr ctrlr = {}; struct spdk_nvme_intel_marketing_description_page payload = {}; verify_fn = verify_intel_marketing_description_log_page; spdk_nvme_ctrlr_cmd_get_log_page(&ctrlr, SPDK_NVME_INTEL_MARKETING_DESCRIPTION, SPDK_NVME_GLOBAL_NS_TAG, &payload, sizeof(payload), NULL, NULL); } static void test_generic_get_log_pages(void) { test_error_get_log_page(); Loading @@ -383,6 +407,7 @@ static void test_intel_get_log_pages(void) test_intel_temperature_get_log_page(); test_intel_read_latency_get_log_page(); test_intel_write_latency_get_log_page(); test_intel_marketing_description_get_log_page(); } static void Loading