scsi: qla2xxx: Add NVMe parameters support in Auxiliary Image Status
authorAnil Gurumurthy <agurumurthy@marvell.com>
Fri, 26 Aug 2022 10:25:56 +0000 (03:25 -0700)
committerMartin K. Petersen <martin.petersen@oracle.com>
Thu, 1 Sep 2022 04:30:55 +0000 (00:30 -0400)
Add new API to obtain the NVMe Parameters region status from the Auxiliary
Image Status bitmap.

Link: https://lore.kernel.org/r/20220826102559.17474-5-njavali@marvell.com
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Signed-off-by: Anil Gurumurthy <agurumurthy@marvell.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/qla2xxx/qla_bsg.c
drivers/scsi/qla2xxx/qla_bsg.h
drivers/scsi/qla2xxx/qla_def.h
drivers/scsi/qla2xxx/qla_fw.h
drivers/scsi/qla2xxx/qla_init.c

index 5db9bf69dcff04ec68bac1579dff5b461518761c..cd75b179410d78e2add57805abac420927a2d4e9 100644 (file)
@@ -2519,19 +2519,23 @@ qla2x00_get_flash_image_status(struct bsg_job *bsg_job)
        qla27xx_get_active_image(vha, &active_regions);
        regions.global_image = active_regions.global;
 
+       if (IS_QLA27XX(ha))
+               regions.nvme_params = QLA27XX_PRIMARY_IMAGE;
+
        if (IS_QLA28XX(ha)) {
                qla28xx_get_aux_images(vha, &active_regions);
                regions.board_config = active_regions.aux.board_config;
                regions.vpd_nvram = active_regions.aux.vpd_nvram;
                regions.npiv_config_0_1 = active_regions.aux.npiv_config_0_1;
                regions.npiv_config_2_3 = active_regions.aux.npiv_config_2_3;
+               regions.nvme_params = active_regions.aux.nvme_params;
        }
 
        ql_dbg(ql_dbg_user, vha, 0x70e1,
-           "%s(%lu): FW=%u BCFG=%u VPDNVR=%u NPIV01=%u NPIV02=%u\n",
+           "%s(%lu): FW=%u BCFG=%u VPDNVR=%u NPIV01=%u NPIV02=%u NVME_PARAMS=%u\n",
            __func__, vha->host_no, regions.global_image,
            regions.board_config, regions.vpd_nvram,
-           regions.npiv_config_0_1, regions.npiv_config_2_3);
+           regions.npiv_config_0_1, regions.npiv_config_2_3, regions.nvme_params);
 
        sg_copy_from_buffer(bsg_job->reply_payload.sg_list,
            bsg_job->reply_payload.sg_cnt, &regions, sizeof(regions));
index bb64b9c5a74bbe7a39f62d23128f8ca9705836a9..d38dab0a07e83357b8bbf522e5398312b0793d9d 100644 (file)
@@ -314,7 +314,8 @@ struct qla_active_regions {
        uint8_t vpd_nvram;
        uint8_t npiv_config_0_1;
        uint8_t npiv_config_2_3;
-       uint8_t reserved[32];
+       uint8_t nvme_params;
+       uint8_t reserved[31];
 } __packed;
 
 #include "qla_edif_bsg.h"
index 22274b405d0101ce3677a2611d88d7e85dfaaa7d..802eec6407d9accf0a9b480487550e8be97940bd 100644 (file)
@@ -4773,6 +4773,7 @@ struct active_regions {
                uint8_t vpd_nvram;
                uint8_t npiv_config_0_1;
                uint8_t npiv_config_2_3;
+               uint8_t nvme_params;
        } aux;
 };
 
@@ -5057,6 +5058,7 @@ struct qla27xx_image_status {
 #define QLA28XX_AUX_IMG_VPD_NVRAM              BIT_1
 #define QLA28XX_AUX_IMG_NPIV_CONFIG_0_1                BIT_2
 #define QLA28XX_AUX_IMG_NPIV_CONFIG_2_3                BIT_3
+#define QLA28XX_AUX_IMG_NVME_PARAMS            BIT_4
 
 #define SET_VP_IDX     1
 #define SET_AL_PA      2
index 361015b5763ef5e944c50d74907384bdeea69168..f307beed9d29d9ccbb61edad8c40216db6bf6046 100644 (file)
@@ -1675,6 +1675,7 @@ struct qla_flt_location {
 #define FLT_REG_VPD_SEC_27XX_1 0x52
 #define FLT_REG_VPD_SEC_27XX_2 0xD8
 #define FLT_REG_VPD_SEC_27XX_3 0xDA
+#define FLT_REG_NVME_PARAMS_27XX       0x21
 
 /* 28xx */
 #define FLT_REG_AUX_IMG_PRI_28XX       0x125
@@ -1691,6 +1692,8 @@ struct qla_flt_location {
 #define FLT_REG_MPI_SEC_28XX           0xF0
 #define FLT_REG_PEP_PRI_28XX           0xD1
 #define FLT_REG_PEP_SEC_28XX           0xF1
+#define FLT_REG_NVME_PARAMS_PRI_28XX   0x14E
+#define FLT_REG_NVME_PARAMS_SEC_28XX   0x179
 
 struct qla_flt_region {
        __le16  code;
index e7fe0e52c11d4a4bbf4986427dc25ec590055ed1..e12db95de6883f351bed957f8ce0b35f871ba7d6 100644 (file)
@@ -7933,6 +7933,9 @@ qla28xx_component_status(
 
        active_regions->aux.npiv_config_2_3 =
            qla28xx_component_bitmask(aux, QLA28XX_AUX_IMG_NPIV_CONFIG_2_3);
+
+       active_regions->aux.nvme_params =
+           qla28xx_component_bitmask(aux, QLA28XX_AUX_IMG_NVME_PARAMS);
 }
 
 static int
@@ -8041,11 +8044,12 @@ check_valid_image:
        }
 
        ql_dbg(ql_dbg_init, vha, 0x018f,
-           "aux images active: BCFG=%u VPD/NVR=%u NPIV0/1=%u NPIV2/3=%u\n",
+           "aux images active: BCFG=%u VPD/NVR=%u NPIV0/1=%u NPIV2/3=%u, NVME=%u\n",
            active_regions->aux.board_config,
            active_regions->aux.vpd_nvram,
            active_regions->aux.npiv_config_0_1,
-           active_regions->aux.npiv_config_2_3);
+           active_regions->aux.npiv_config_2_3,
+           active_regions->aux.nvme_params);
 }
 
 void