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 01/29] qla2xxx: Enhanced the dump routines to capture multiple request and response queues.
Date: Thu, 9 Feb 2012 11:15:33 -0800 [thread overview]
Message-ID: <1328814961-21866-2-git-send-email-chad.dupuis@qlogic.com> (raw)
In-Reply-To: <1328814961-21866-1-git-send-email-chad.dupuis@qlogic.com>
From: Giridhar Malavali <giridhar.malavali@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 | 83 ++++++++++++++++++++++++++++++++++++++-
drivers/scsi/qla2xxx/qla_dbg.h | 14 +++++++
drivers/scsi/qla2xxx/qla_init.c | 11 +++++-
3 files changed, 105 insertions(+), 3 deletions(-)
diff --git a/drivers/scsi/qla2xxx/qla_dbg.c b/drivers/scsi/qla2xxx/qla_dbg.c
index 45cbf0b..cdf0617 100644
--- a/drivers/scsi/qla2xxx/qla_dbg.c
+++ b/drivers/scsi/qla2xxx/qla_dbg.c
@@ -375,6 +375,77 @@ qla25xx_copy_fce(struct qla_hw_data *ha, void *ptr, uint32_t **last_chain)
}
static inline void *
+qla25xx_copy_mqueues(struct qla_hw_data *ha, void *ptr, uint32_t **last_chain)
+{
+ struct qla2xxx_mqueue_chain *q;
+ struct qla2xxx_mqueue_header *qh;
+ struct req_que *req;
+ struct rsp_que *rsp;
+ int que;
+
+ if (!ha->mqenable)
+ return ptr;
+
+ /* Request queues */
+ for (que = 1; que < ha->max_req_queues; que++) {
+ req = ha->req_q_map[que];
+ if (!req)
+ break;
+
+ /* Add chain. */
+ q = ptr;
+ *last_chain = &q->type;
+ q->type = __constant_htonl(DUMP_CHAIN_QUEUE);
+ q->chain_size = htonl(
+ sizeof(struct qla2xxx_mqueue_chain) +
+ sizeof(struct qla2xxx_mqueue_header) +
+ (req->length * sizeof(request_t)));
+ ptr += sizeof(struct qla2xxx_mqueue_chain);
+
+ /* Add header. */
+ qh = ptr;
+ qh->queue = __constant_htonl(TYPE_REQUEST_QUEUE);
+ qh->number = htonl(que);
+ qh->size = htonl(req->length * sizeof(request_t));
+ ptr += sizeof(struct qla2xxx_mqueue_header);
+
+ /* Add data. */
+ memcpy(ptr, req->ring, req->length * sizeof(request_t));
+ ptr += req->length * sizeof(request_t);
+ }
+
+ /* Response queues */
+ for (que = 1; que < ha->max_rsp_queues; que++) {
+ rsp = ha->rsp_q_map[que];
+ if (!rsp)
+ break;
+
+ /* Add chain. */
+ q = ptr;
+ *last_chain = &q->type;
+ q->type = __constant_htonl(DUMP_CHAIN_QUEUE);
+ q->chain_size = htonl(
+ sizeof(struct qla2xxx_mqueue_chain) +
+ sizeof(struct qla2xxx_mqueue_header) +
+ (rsp->length * sizeof(response_t)));
+ ptr += sizeof(struct qla2xxx_mqueue_chain);
+
+ /* Add header. */
+ qh = ptr;
+ qh->queue = __constant_htonl(TYPE_RESPONSE_QUEUE);
+ qh->number = htonl(que);
+ qh->size = htonl(rsp->length * sizeof(response_t));
+ ptr += sizeof(struct qla2xxx_mqueue_header);
+
+ /* Add data. */
+ memcpy(ptr, rsp->ring, rsp->length * sizeof(response_t));
+ ptr += rsp->length * sizeof(response_t);
+ }
+
+ return ptr;
+}
+
+static inline void *
qla25xx_copy_mq(struct qla_hw_data *ha, void *ptr, uint32_t **last_chain)
{
uint32_t cnt, que_idx;
@@ -1322,12 +1393,16 @@ qla25xx_fw_dump(scsi_qla_host_t *vha, int hardware_locked)
nxt = qla24xx_copy_eft(ha, nxt);
/* Chain entries -- started with MQ. */
- qla25xx_copy_fce(ha, nxt_chain, &last_chain);
+ nxt_chain = qla25xx_copy_fce(ha, nxt_chain, &last_chain);
+ nxt_chain = qla25xx_copy_mqueues(ha, nxt_chain, &last_chain);
if (last_chain) {
ha->fw_dump->version |= __constant_htonl(DUMP_CHAIN_VARIANT);
*last_chain |= __constant_htonl(DUMP_CHAIN_LAST);
}
+ /* Adjust valid length. */
+ ha->fw_dump_len = (nxt_chain - (void *)ha->fw_dump);
+
qla25xx_fw_dump_failed_0:
qla2xxx_dump_post_process(base_vha, rval);
@@ -1636,12 +1711,16 @@ qla81xx_fw_dump(scsi_qla_host_t *vha, int hardware_locked)
nxt = qla24xx_copy_eft(ha, nxt);
/* Chain entries -- started with MQ. */
- qla25xx_copy_fce(ha, nxt_chain, &last_chain);
+ nxt_chain = qla25xx_copy_fce(ha, nxt_chain, &last_chain);
+ nxt_chain = qla25xx_copy_mqueues(ha, nxt_chain, &last_chain);
if (last_chain) {
ha->fw_dump->version |= __constant_htonl(DUMP_CHAIN_VARIANT);
*last_chain |= __constant_htonl(DUMP_CHAIN_LAST);
}
+ /* Adjust valid length. */
+ ha->fw_dump_len = (nxt_chain - (void *)ha->fw_dump);
+
qla81xx_fw_dump_failed_0:
qla2xxx_dump_post_process(base_vha, rval);
diff --git a/drivers/scsi/qla2xxx/qla_dbg.h b/drivers/scsi/qla2xxx/qla_dbg.h
index 5f1b6d9..6b05cb1 100644
--- a/drivers/scsi/qla2xxx/qla_dbg.h
+++ b/drivers/scsi/qla2xxx/qla_dbg.h
@@ -192,9 +192,23 @@ struct qla2xxx_mq_chain {
uint32_t qregs[4 * QLA_MQ_SIZE];
};
+struct qla2xxx_mqueue_header {
+ uint32_t queue;
+#define TYPE_REQUEST_QUEUE 0x1
+#define TYPE_RESPONSE_QUEUE 0x2
+ uint32_t number;
+ uint32_t size;
+};
+
+struct qla2xxx_mqueue_chain {
+ uint32_t type;
+ uint32_t chain_size;
+};
+
#define DUMP_CHAIN_VARIANT 0x80000000
#define DUMP_CHAIN_FCE 0x7FFFFAF0
#define DUMP_CHAIN_MQ 0x7FFFFAF1
+#define DUMP_CHAIN_QUEUE 0x7FFFFAF2
#define DUMP_CHAIN_LAST 0x80000000
struct qla2xxx_fw_dump {
diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c
index 1fa067e..68555df 100644
--- a/drivers/scsi/qla2xxx/qla_init.c
+++ b/drivers/scsi/qla2xxx/qla_init.c
@@ -1270,8 +1270,17 @@ qla2x00_alloc_fw_dump(scsi_qla_host_t *vha)
fixed_size = offsetof(struct qla24xx_fw_dump, ext_mem);
mem_size = (ha->fw_memory_size - 0x100000 + 1) *
sizeof(uint32_t);
- if (ha->mqenable)
+ if (ha->mqenable) {
mq_size = sizeof(struct qla2xxx_mq_chain);
+ /*
+ * Allocate maximum buffer size for all queues.
+ * Resizing must be done at end-of-dump processing.
+ */
+ mq_size += ha->max_req_queues *
+ (req->length * sizeof(request_t));
+ mq_size += ha->max_rsp_queues *
+ (rsp->length * sizeof(response_t));
+ }
/* Allocate memory for Fibre Channel Event Buffer. */
if (!IS_QLA25XX(ha) && !IS_QLA81XX(ha))
goto try_eft;
--
1.6.0.2
next prev parent reply other threads:[~2012-02-09 19:32 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-09 19:15 [PATCH 00/29] qla2xxx: Patches for scsi-misc Chad Dupuis
2012-02-09 19:15 ` Chad Dupuis [this message]
2012-02-09 19:15 ` [PATCH 02/29] qla2xxx: Enhancements to support ISP83xx Chad Dupuis
2012-02-09 19:15 ` [PATCH 03/29] qla2xxx: Use a valid enode-mac if none defined Chad Dupuis
2012-02-09 19:15 ` [PATCH 04/29] qla2xxx: Consolidation of SRB processing Chad Dupuis
2012-02-09 19:15 ` [PATCH 05/29] qla2xxx: Use consistent DL mask for ELS/CT passthru requests Chad Dupuis
2012-02-09 19:15 ` [PATCH 06/29] qla2xxx: Correct print format for edc ql_log() calls Chad Dupuis
2012-02-09 19:15 ` [PATCH 07/29] qla2xxx: Handle change notifications based on switch scan results Chad Dupuis
2012-02-09 19:15 ` [PATCH 08/29] qla2xxx: Return blank sysfs string on initial get thermal failure Chad Dupuis
2012-02-09 19:15 ` [PATCH 09/29] qla2xxx: Increase speed of flash access in ISP82xx adapters to improve firmware load speed Chad Dupuis
2012-02-09 19:15 ` [PATCH 10/29] qla2xxx: Handle failure cases during fabric_login Chad Dupuis
2012-02-09 19:15 ` [PATCH 11/29] qla2xxx: Perform implicit logout during rport tear-down Chad Dupuis
2012-02-09 19:15 ` [PATCH 12/29] qla2xxx: Prep zero-length BSG data-transfer requests Chad Dupuis
2012-02-09 19:15 ` [PATCH 13/29] qla2xxx: Reduce mbx-command timeout for Login/Logout requests Chad Dupuis
2012-02-09 19:15 ` [PATCH 14/29] qla2xxx: Print mailbox command opcode and return code when a command times out Chad Dupuis
2012-02-09 19:15 ` [PATCH 15/29] qla2xxx: Convert remaining printk's to ql_log format Chad Dupuis
2012-02-09 19:15 ` [PATCH 16/29] qla2xxx: Use ql_log* #define's in ql_log() and ql_log_pci() Chad Dupuis
2012-02-09 19:15 ` [PATCH 17/29] qla2xxx: Fix ql_dbg arguments Chad Dupuis
2012-02-09 19:15 ` [PATCH 18/29] qla2xxx: Add new message when a new loopid is assigned Chad Dupuis
2012-02-09 19:15 ` [PATCH 19/29] qla2xxx: Log messages to use correct vha Chad Dupuis
2012-02-09 19:15 ` [PATCH 20/29] qla2xxx: Change the log message when previous dump is available to retrieve for ISP82xx Chad Dupuis
2012-02-09 19:15 ` [PATCH 21/29] qla2xxx: Perform firmware dump procedure on mailbox command timeout Chad Dupuis
2012-02-09 19:15 ` [PATCH 22/29] qla2xxx: Update LICENSE.qla2xxx Chad Dupuis
2012-02-09 19:15 ` [PATCH 23/29] qla2xxx: Remove EDC sysfs interface Chad Dupuis
2012-02-09 19:15 ` [PATCH 24/29] qla2xxx: Cache swl during fabric discovery Chad Dupuis
2012-02-09 19:15 ` [PATCH 25/29] qla2xxx: Add ha->max_fibre_devices to keep track of the maximum number of targets Chad Dupuis
2012-02-19 14:33 ` James Bottomley
2012-02-09 19:15 ` [PATCH 26/29] qla2xxx: Handle device mapping changes due to device logout Chad Dupuis
2012-02-09 19:15 ` [PATCH 27/29] qla2xxx: Fix incorrect register access in qla2x00_start_iocbs() Chad Dupuis
2012-02-09 19:16 ` [PATCH 28/29] qla2xxx: Stop iteration after first failure in *_id functions Chad Dupuis
2012-02-09 19:16 ` [PATCH 29/29] qla2xxx: Avoid invalid request queue dereference for bad response packets Chad Dupuis
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=1328814961-21866-2-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).