From: Chad Dupuis <chad.dupuis@qlogic.com>
To: jbottomley@parallels.com
Cc: giridhar.malavali@qlogic.com, chad.dupuis@qlogic.com,
andrew.vasquez@qlogic.com, linux-scsi@vger.kernel.org
Subject: [PATCH 16/22] qla2xxx: Log link up and link down messages to track link flops.
Date: Tue, 15 May 2012 14:34:23 -0400 [thread overview]
Message-ID: <1337106869-14191-17-git-send-email-chad.dupuis@qlogic.com> (raw)
In-Reply-To: <1337106869-14191-1-git-send-email-chad.dupuis@qlogic.com>
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
---
drivers/scsi/qla2xxx/qla_dbg.c | 2 +-
drivers/scsi/qla2xxx/qla_gbl.h | 2 +
drivers/scsi/qla2xxx/qla_init.c | 8 +------
drivers/scsi/qla2xxx/qla_isr.c | 44 +++++++++++++++++++++++++++-----------
4 files changed, 35 insertions(+), 21 deletions(-)
diff --git a/drivers/scsi/qla2xxx/qla_dbg.c b/drivers/scsi/qla2xxx/qla_dbg.c
index 8e39f8a..1457186 100644
--- a/drivers/scsi/qla2xxx/qla_dbg.c
+++ b/drivers/scsi/qla2xxx/qla_dbg.c
@@ -19,7 +19,7 @@
* | Queue Command and IO tracing | 0x3030 | 0x3006,0x3008 |
* | | | 0x302d-0x302e |
* | DPC Thread | 0x401c | 0x4002,0x4013 |
- * | Async Events | 0x505d | 0x502b-0x502f |
+ * | Async Events | 0x505f | 0x502b-0x502f |
* | | | 0x5047,0x5052 |
* | Timer Routines | 0x6011 | |
* | User Space Interactions | 0x709f | 0x7018,0x702e, |
diff --git a/drivers/scsi/qla2xxx/qla_gbl.h b/drivers/scsi/qla2xxx/qla_gbl.h
index 9f06580..c089699 100644
--- a/drivers/scsi/qla2xxx/qla_gbl.h
+++ b/drivers/scsi/qla2xxx/qla_gbl.h
@@ -383,6 +383,8 @@ extern int qla2x00_request_irqs(struct qla_hw_data *, struct rsp_que *);
extern void qla2x00_free_irqs(scsi_qla_host_t *);
extern int qla2x00_get_data_rate(scsi_qla_host_t *);
+extern char *qla2x00_get_link_speed_str(struct qla_hw_data *);
+
/*
* Global Function Prototypes in qla_sup.c source file.
*/
diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c
index 33a23eb..34fca3e 100644
--- a/drivers/scsi/qla2xxx/qla_init.c
+++ b/drivers/scsi/qla2xxx/qla_init.c
@@ -2795,8 +2795,6 @@ cleanup_allocation:
static void
qla2x00_iidma_fcport(scsi_qla_host_t *vha, fc_port_t *fcport)
{
-#define LS_UNKNOWN 2
- static char *link_speeds[] = { "1", "2", "?", "4", "8", "10" };
char *link_speed;
int rval;
uint16_t mb[4];
@@ -2824,11 +2822,7 @@ qla2x00_iidma_fcport(scsi_qla_host_t *vha, fc_port_t *fcport)
fcport->port_name[6], fcport->port_name[7], rval,
fcport->fp_speed, mb[0], mb[1]);
} else {
- link_speed = link_speeds[LS_UNKNOWN];
- if (fcport->fp_speed < 5)
- link_speed = link_speeds[fcport->fp_speed];
- else if (fcport->fp_speed == 0x13)
- link_speed = link_speeds[5];
+ link_speed = qla2x00_get_link_speed_str(ha);
ql_dbg(ql_dbg_disc, vha, 0x2005,
"iIDMA adjusted to %s GB/s "
"on %02x%02x%02x%02x%02x%02x%02x%02x.\n", link_speed,
diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c
index f4b8a5f..0e716dc 100644
--- a/drivers/scsi/qla2xxx/qla_isr.c
+++ b/drivers/scsi/qla2xxx/qla_isr.c
@@ -309,6 +309,28 @@ qla81xx_idc_event(scsi_qla_host_t *vha, uint16_t aen, uint16_t descr)
"IDC failed to post ACK.\n");
}
+#define LS_UNKNOWN 2
+char *
+qla2x00_get_link_speed_str(struct qla_hw_data *ha)
+{
+ static char *link_speeds[] = {"1", "2", "?", "4", "8", "16", "10"};
+ char *link_speed;
+ int fw_speed = ha->link_data_rate;
+
+ if (IS_QLA2100(ha) || IS_QLA2200(ha))
+ link_speed = link_speeds[0];
+ else if (fw_speed == 0x13)
+ link_speed = link_speeds[6];
+ else {
+ link_speed = link_speeds[LS_UNKNOWN];
+ if (fw_speed < 6)
+ link_speed =
+ link_speeds[fw_speed];
+ }
+
+ return link_speed;
+}
+
/**
* qla2x00_async_event() - Process aynchronous events.
* @ha: SCSI driver HA context
@@ -317,9 +339,6 @@ qla81xx_idc_event(scsi_qla_host_t *vha, uint16_t aen, uint16_t descr)
void
qla2x00_async_event(scsi_qla_host_t *vha, struct rsp_que *rsp, uint16_t *mb)
{
-#define LS_UNKNOWN 2
- static char *link_speeds[] = { "1", "2", "?", "4", "8", "16", "10" };
- char *link_speed;
uint16_t handle_cnt;
uint16_t cnt, mbx;
uint32_t handles[5];
@@ -479,20 +498,14 @@ skip_rio:
break;
case MBA_LOOP_UP: /* Loop Up Event */
- if (IS_QLA2100(ha) || IS_QLA2200(ha)) {
- link_speed = link_speeds[0];
+ if (IS_QLA2100(ha) || IS_QLA2200(ha))
ha->link_data_rate = PORT_SPEED_1GB;
- } else {
- link_speed = link_speeds[LS_UNKNOWN];
- if (mb[1] < 6)
- link_speed = link_speeds[mb[1]];
- else if (mb[1] == 0x13)
- link_speed = link_speeds[6];
+ else
ha->link_data_rate = mb[1];
- }
ql_dbg(ql_dbg_async, vha, 0x500a,
- "LOOP UP detected (%s Gbps).\n", link_speed);
+ "LOOP UP detected (%s Gbps).\n",
+ qla2x00_get_link_speed_str(ha));
vha->flags.management_server_logged_in = 0;
qla2x00_post_aen_work(vha, FCH_EVT_LINKUP, ha->link_data_rate);
@@ -638,6 +651,8 @@ skip_rio:
ql_dbg(ql_dbg_async, vha, 0x5010,
"Port unavailable %04x %04x %04x.\n",
mb[1], mb[2], mb[3]);
+ ql_log(ql_log_warn, vha, 0x505e,
+ "Link is offline.\n");
if (atomic_read(&vha->loop_state) != LOOP_DOWN) {
atomic_set(&vha->loop_state, LOOP_DOWN);
@@ -676,6 +691,9 @@ skip_rio:
ql_dbg(ql_dbg_async, vha, 0x5012,
"Port database changed %04x %04x %04x.\n",
mb[1], mb[2], mb[3]);
+ ql_log(ql_log_warn, vha, 0x505f,
+ "Link is operational (%s Gbps).\n",
+ qla2x00_get_link_speed_str(ha));
/*
* Mark all devices as missing so we will login again.
--
1.7.7
next prev parent reply other threads:[~2012-05-15 18:57 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-15 18:34 [PATCH 00/22] qla2xxx: Updates for scsi "misc" branch Chad Dupuis
2012-05-15 18:34 ` [PATCH 01/22] qla2xxx: Fix typo in qla_init.c Chad Dupuis
2012-05-15 18:34 ` [PATCH 02/22] qla2xxx: Micro optimization in queuecommand handler Chad Dupuis
2012-05-15 18:34 ` [PATCH 03/22] qla2xxx: Fix typo in qla_mbx.c Chad Dupuis
2012-05-15 18:34 ` [PATCH 04/22] qla2xxx: Remove unneeded DPC wakeups from qla82xx_watchdog Chad Dupuis
2012-05-15 18:34 ` [PATCH 05/22] qla2xxx: Detect PEG errors Chad Dupuis
2012-05-15 18:34 ` [PATCH 06/22] qla2xxx: Change "Done" to "Entering" in the debug print statement in qla2x00_port_logout Chad Dupuis
2012-05-15 18:34 ` [PATCH 07/22] qla2xxx: Handle interrupt registration failures more gracefully Chad Dupuis
2012-05-15 18:34 ` [PATCH 08/22] qla2xxx: Add ql_dbg_verbose logging level Chad Dupuis
2012-05-15 18:34 ` [PATCH 09/22] qla2xxx: Stats should be different from physical and virtual ports Chad Dupuis
2012-05-15 18:34 ` [PATCH 10/22] qla2xxx: Fix typo in bus-reset handler Chad Dupuis
2012-05-15 18:34 ` [PATCH 11/22] qla2xxx: Display proper supported speeds for 16G FC adapters Chad Dupuis
2012-05-15 18:34 ` [PATCH 12/22] qla2xxx: Fixups for ISP83xx Chad Dupuis
2012-05-15 18:34 ` [PATCH 13/22] qla2xxx: Remove mirrored field vp_idx from struct fc_port Chad Dupuis
2012-05-15 18:34 ` [PATCH 14/22] qla2xxx: Optimize existing port name server query matching Chad Dupuis
2012-05-15 18:34 ` [PATCH 15/22] qla2xxx: Corrections to log messages Chad Dupuis
2012-05-15 18:34 ` Chad Dupuis [this message]
2012-05-15 18:34 ` [PATCH 17/22] qla2xxx: Avoid losing any fc ports when loop id's are exhausted Chad Dupuis
2012-05-15 18:34 ` [PATCH 18/22] qla2xxx: Don't capture minidump for ISP82xx on flash update from application Chad Dupuis
2012-05-15 18:34 ` [PATCH 19/22] qla2xxx: Display proper firmware version when new minidump template is gathered for ISP82xx Chad Dupuis
2012-05-15 18:34 ` [PATCH 20/22] Revert "qla2xxx: During loopdown perform Diagnostic loopback." Chad Dupuis
2012-05-15 18:34 ` [PATCH 21/22] qla2xxx: Add LLD target-mode infrastructure for >= 24xx series Chad Dupuis
2012-05-15 18:34 ` [PATCH 22/22] tcm_qla2xxx: Add >= 24xx series fabric module for target-core Chad Dupuis
2012-05-18 23:47 ` [PATCH 00/22] qla2xxx: Updates for scsi "misc" branch Nicholas A. Bellinger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1337106869-14191-17-git-send-email-chad.dupuis@qlogic.com \
--to=chad.dupuis@qlogic.com \
--cc=andrew.vasquez@qlogic.com \
--cc=giridhar.malavali@qlogic.com \
--cc=jbottomley@parallels.com \
--cc=linux-scsi@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).