| From ef2b3968c15ee02c3d1328c2ae18696120b67299 Mon Sep 17 00:00:00 2001 |
| From: James Smart <jsmart2021@gmail.com> |
| Date: Tue, 12 Mar 2019 16:30:21 -0700 |
| Subject: scsi: lpfc: Fix fc4type information for FDMI |
| |
| [ Upstream commit 32a80c093b524a0682f1c6166c910387b116ffce ] |
| |
| The driver is reporting support for NVME even when not configured for NVME |
| operation. |
| |
| Fix (and make more readable) when NVME protocol support is indicated. |
| |
| Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com> |
| Signed-off-by: James Smart <jsmart2021@gmail.com> |
| Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com> |
| Signed-off-by: Sasha Levin <sashal@kernel.org> |
| --- |
| drivers/scsi/lpfc/lpfc_ct.c | 17 ++++++++++------- |
| 1 file changed, 10 insertions(+), 7 deletions(-) |
| |
| diff --git a/drivers/scsi/lpfc/lpfc_ct.c b/drivers/scsi/lpfc/lpfc_ct.c |
| index 2e0ba206c084c..25553e7ba85c8 100644 |
| --- a/drivers/scsi/lpfc/lpfc_ct.c |
| +++ b/drivers/scsi/lpfc/lpfc_ct.c |
| @@ -2363,10 +2363,11 @@ lpfc_fdmi_port_attr_fc4type(struct lpfc_vport *vport, |
| ae = (struct lpfc_fdmi_attr_entry *)&ad->AttrValue; |
| memset(ae, 0, 32); |
| |
| - ae->un.AttrTypes[3] = 0x02; /* Type 1 - ELS */ |
| - ae->un.AttrTypes[2] = 0x01; /* Type 8 - FCP */ |
| - ae->un.AttrTypes[6] = 0x01; /* Type 40 - NVME */ |
| - ae->un.AttrTypes[7] = 0x01; /* Type 32 - CT */ |
| + ae->un.AttrTypes[3] = 0x02; /* Type 0x1 - ELS */ |
| + ae->un.AttrTypes[2] = 0x01; /* Type 0x8 - FCP */ |
| + if (vport->nvmei_support || vport->phba->nvmet_support) |
| + ae->un.AttrTypes[6] = 0x01; /* Type 0x28 - NVME */ |
| + ae->un.AttrTypes[7] = 0x01; /* Type 0x20 - CT */ |
| size = FOURBYTES + 32; |
| ad->AttrLen = cpu_to_be16(size); |
| ad->AttrType = cpu_to_be16(RPRT_SUPPORTED_FC4_TYPES); |
| @@ -2676,9 +2677,11 @@ lpfc_fdmi_port_attr_active_fc4type(struct lpfc_vport *vport, |
| ae = (struct lpfc_fdmi_attr_entry *)&ad->AttrValue; |
| memset(ae, 0, 32); |
| |
| - ae->un.AttrTypes[3] = 0x02; /* Type 1 - ELS */ |
| - ae->un.AttrTypes[2] = 0x01; /* Type 8 - FCP */ |
| - ae->un.AttrTypes[7] = 0x01; /* Type 32 - CT */ |
| + ae->un.AttrTypes[3] = 0x02; /* Type 0x1 - ELS */ |
| + ae->un.AttrTypes[2] = 0x01; /* Type 0x8 - FCP */ |
| + if (vport->phba->cfg_enable_fc4_type & LPFC_ENABLE_NVME) |
| + ae->un.AttrTypes[6] = 0x1; /* Type 0x28 - NVME */ |
| + ae->un.AttrTypes[7] = 0x01; /* Type 0x20 - CT */ |
| size = FOURBYTES + 32; |
| ad->AttrLen = cpu_to_be16(size); |
| ad->AttrType = cpu_to_be16(RPRT_ACTIVE_FC4_TYPES); |
| -- |
| 2.20.1 |
| |