scsi: qla2xxx: Include Exchange offload/Extended Login into FW dump
authorQuinn Tran <quinn.tran@cavium.com>
Wed, 14 Jun 2017 03:47:29 +0000 (20:47 -0700)
committerMartin K. Petersen <martin.petersen@oracle.com>
Wed, 28 Jun 2017 01:21:41 +0000 (21:21 -0400)
Add missing memory dump of Exchange Offload and Extended login into FW
dump.

Signed-off-by: Quinn Tran <quinn.tran@cavium.com>
Signed-off-by: Himanshu Madhani <himanshu.madhani@cavium.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/qla2xxx/qla_dbg.c
drivers/scsi/qla2xxx/qla_dbg.h
drivers/scsi/qla2xxx/qla_init.c
drivers/scsi/qla2xxx/qla_os.c

index c0c90dcc7c7b3a789307846202a7ee341d76a22e..f91ee717202d5ae0999e5dc628e658026300e6ca 100644 (file)
@@ -497,6 +497,50 @@ qla25xx_copy_fce(struct qla_hw_data *ha, void *ptr, uint32_t **last_chain)
        return (char *)iter_reg + ntohl(fcec->size);
 }
 
+static inline void *
+qla25xx_copy_exlogin(struct qla_hw_data *ha, void *ptr, uint32_t **last_chain)
+{
+       struct qla2xxx_offld_chain *c = ptr;
+
+       if (!ha->exlogin_buf)
+               return ptr;
+
+       *last_chain = &c->type;
+
+       c->type = cpu_to_be32(DUMP_CHAIN_EXLOGIN);
+       c->chain_size = cpu_to_be32(sizeof(struct qla2xxx_offld_chain) +
+           ha->exlogin_size);
+       c->size = cpu_to_be32(ha->exlogin_size);
+       c->addr = cpu_to_be64(ha->exlogin_buf_dma);
+
+       ptr += sizeof(struct qla2xxx_offld_chain);
+       memcpy(ptr, ha->exlogin_buf, ha->exlogin_size);
+
+       return (char *)ptr + cpu_to_be32(c->size);
+}
+
+static inline void *
+qla81xx_copy_exchoffld(struct qla_hw_data *ha, void *ptr, uint32_t **last_chain)
+{
+       struct qla2xxx_offld_chain *c = ptr;
+
+       if (!ha->exchoffld_buf)
+               return ptr;
+
+       *last_chain = &c->type;
+
+       c->type = cpu_to_be32(DUMP_CHAIN_EXCHG);
+       c->chain_size = cpu_to_be32(sizeof(struct qla2xxx_offld_chain) +
+           ha->exchoffld_size);
+       c->size = cpu_to_be32(ha->exchoffld_size);
+       c->addr = cpu_to_be64(ha->exchoffld_buf_dma);
+
+       ptr += sizeof(struct qla2xxx_offld_chain);
+       memcpy(ptr, ha->exchoffld_buf, ha->exchoffld_size);
+
+       return (char *)ptr + cpu_to_be32(c->size);
+}
+
 static inline void *
 qla2xxx_copy_atioqueues(struct qla_hw_data *ha, void *ptr,
        uint32_t **last_chain)
@@ -1606,6 +1650,7 @@ qla25xx_fw_dump(scsi_qla_host_t *vha, int hardware_locked)
        nxt_chain = qla25xx_copy_fce(ha, nxt_chain, &last_chain);
        nxt_chain = qla25xx_copy_mqueues(ha, nxt_chain, &last_chain);
        nxt_chain = qla2xxx_copy_atioqueues(ha, nxt_chain, &last_chain);
+       nxt_chain = qla25xx_copy_exlogin(ha, nxt_chain, &last_chain);
        if (last_chain) {
                ha->fw_dump->version |= htonl(DUMP_CHAIN_VARIANT);
                *last_chain |= htonl(DUMP_CHAIN_LAST);
@@ -1932,6 +1977,8 @@ qla81xx_fw_dump(scsi_qla_host_t *vha, int hardware_locked)
        nxt_chain = qla25xx_copy_fce(ha, nxt_chain, &last_chain);
        nxt_chain = qla25xx_copy_mqueues(ha, nxt_chain, &last_chain);
        nxt_chain = qla2xxx_copy_atioqueues(ha, nxt_chain, &last_chain);
+       nxt_chain = qla25xx_copy_exlogin(ha, nxt_chain, &last_chain);
+       nxt_chain = qla81xx_copy_exchoffld(ha, nxt_chain, &last_chain);
        if (last_chain) {
                ha->fw_dump->version |= htonl(DUMP_CHAIN_VARIANT);
                *last_chain |= htonl(DUMP_CHAIN_LAST);
@@ -2443,6 +2490,8 @@ copy_queue:
        nxt_chain = qla25xx_copy_fce(ha, nxt_chain, &last_chain);
        nxt_chain = qla25xx_copy_mqueues(ha, nxt_chain, &last_chain);
        nxt_chain = qla2xxx_copy_atioqueues(ha, nxt_chain, &last_chain);
+       nxt_chain = qla25xx_copy_exlogin(ha, nxt_chain, &last_chain);
+       nxt_chain = qla81xx_copy_exchoffld(ha, nxt_chain, &last_chain);
        if (last_chain) {
                ha->fw_dump->version |= htonl(DUMP_CHAIN_VARIANT);
                *last_chain |= htonl(DUMP_CHAIN_LAST);
index f60138f66dce0d7a31822c590919bc0c3eeb17c1..8877aa97d829f00ba72a9ae29e27c98ac6b7afdd 100644 (file)
@@ -232,6 +232,15 @@ struct qla2xxx_fce_chain {
        uint32_t eregs[8];
 };
 
+/* used by exchange off load and extended login offload */
+struct qla2xxx_offld_chain {
+       uint32_t type;
+       uint32_t chain_size;
+
+       uint32_t size;
+       u64      addr;
+};
+
 struct qla2xxx_mq_chain {
        uint32_t type;
        uint32_t chain_size;
@@ -258,6 +267,8 @@ struct qla2xxx_mqueue_chain {
 #define DUMP_CHAIN_FCE         0x7FFFFAF0
 #define DUMP_CHAIN_MQ          0x7FFFFAF1
 #define DUMP_CHAIN_QUEUE       0x7FFFFAF2
+#define DUMP_CHAIN_EXLOGIN     0x7FFFFAF3
+#define DUMP_CHAIN_EXCHG       0x7FFFFAF4
 #define DUMP_CHAIN_LAST                0x80000000
 
 struct qla2xxx_fw_dump {
index 4a659460d6e67a5ef9ca45cfc95742d6885ab772..1d815ab779eadf59deed638f1f63eae166d28606 100644 (file)
@@ -2538,6 +2538,13 @@ cont_alloc:
        ha->chain_offset = dump_size;
        dump_size += mq_size + fce_size;
 
+       if (ha->exchoffld_buf)
+               dump_size += sizeof(struct qla2xxx_offld_chain) +
+                       ha->exchoffld_size;
+       if (ha->exlogin_buf)
+               dump_size += sizeof(struct qla2xxx_offld_chain) +
+                       ha->exlogin_size;
+
 allocate:
        ha->fw_dump = vmalloc(dump_size);
        if (!ha->fw_dump) {
index 88e115fcea60b6546311eb9be26668663ce2ba2b..f7c4f723c4058b69edc798a3fa823e5b37b63078 100644 (file)
@@ -4176,9 +4176,6 @@ qla2x00_set_exchoffld_buffer(scsi_qla_host_t *vha)
        if (!IS_EXCHG_OFFLD_CAPABLE(ha))
                return QLA_SUCCESS;
 
-       ql_log(ql_log_info, vha, 0xd014,
-           "Exchange offload count: %d.\n", ql2xexlogins);
-
        max_cnt = 0;
        rval = qla_get_exchoffld_status(vha, &size, &max_cnt);
        if (rval != QLA_SUCCESS) {