diff options
author | James Smart <jsmart2021@gmail.com> | 2017-06-02 07:06:57 +0300 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2017-06-13 04:37:30 +0300 |
commit | 7d790f04d7e4759da238cc6c46796f917af4cec2 (patch) | |
tree | 4a92f0904566ba5c41e06fd84066b86e1646e369 /drivers/scsi/lpfc/lpfc_debugfs.c | |
parent | 80cc004393619a1b3a17aaf4a9e55c5b9f4fc3c1 (diff) | |
download | linux-7d790f04d7e4759da238cc6c46796f917af4cec2.tar.xz |
scsi: lpfc: Fix nvme port role handling in sysfs and debugfs handlers.
While debugging Devloss and recovery, debugfs and sysfs were found to
not show the NVME port roles consistently.
The port role FC_PORT_ROLE_NVME_DISCOVERY was added with the devloss
bringup and the other issues were just oversight.
Add NVME Target and DISCSRVC to debugfs nodeinfo and sysfs nvme info
handlers. The full port role was added to the NVME data only not the
generic nodelist.
Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/lpfc/lpfc_debugfs.c')
-rw-r--r-- | drivers/scsi/lpfc/lpfc_debugfs.c | 32 |
1 files changed, 18 insertions, 14 deletions
diff --git a/drivers/scsi/lpfc/lpfc_debugfs.c b/drivers/scsi/lpfc/lpfc_debugfs.c index e288e59c967f..fe3215241c46 100644 --- a/drivers/scsi/lpfc/lpfc_debugfs.c +++ b/drivers/scsi/lpfc/lpfc_debugfs.c @@ -621,6 +621,13 @@ lpfc_debugfs_nodelist_data(struct lpfc_vport *vport, char *buf, int size) ndlp->nlp_sid); if (ndlp->nlp_type & NLP_FCP_INITIATOR) len += snprintf(buf+len, size-len, "FCP_INITIATOR "); + if (ndlp->nlp_type & NLP_NVME_TARGET) + len += snprintf(buf + len, + size - len, "NVME_TGT sid:%d ", + NLP_NO_SID); + if (ndlp->nlp_type & NLP_NVME_INITIATOR) + len += snprintf(buf + len, + size - len, "NVME_INITIATOR "); len += snprintf(buf+len, size-len, "usgmap:%x ", ndlp->nlp_usg_map); len += snprintf(buf+len, size-len, "refcnt:%x", @@ -698,26 +705,23 @@ lpfc_debugfs_nodelist_data(struct lpfc_vport *vport, char *buf, int size) nrport->port_name); len += snprintf(buf + len, size - len, "WWNN x%llx ", nrport->node_name); - switch (nrport->port_role) { - case FC_PORT_ROLE_NVME_INITIATOR: + + /* An NVME rport can have multiple roles. */ + if (nrport->port_role & FC_PORT_ROLE_NVME_INITIATOR) len += snprintf(buf + len, size - len, - "NVME INITIATOR "); - break; - case FC_PORT_ROLE_NVME_TARGET: + "INITIATOR "); + if (nrport->port_role & FC_PORT_ROLE_NVME_TARGET) len += snprintf(buf + len, size - len, - "NVME TARGET "); - break; - case FC_PORT_ROLE_NVME_DISCOVERY: + "TARGET "); + if (nrport->port_role & FC_PORT_ROLE_NVME_DISCOVERY) len += snprintf(buf + len, size - len, - "NVME DISCOVERY "); - break; - default: + "DISCSRVC "); + if (nrport->port_role & ~(FC_PORT_ROLE_NVME_INITIATOR | + FC_PORT_ROLE_NVME_TARGET | + FC_PORT_ROLE_NVME_DISCOVERY)) len += snprintf(buf + len, size - len, "UNKNOWN ROLE x%x", nrport->port_role); - break; - } - /* Terminate the string. */ len += snprintf(buf + len, size - len, "\n"); } |