mirror of
https://github.com/torvalds/linux.git
synced 2024-11-13 15:41:39 +00:00
scsi: qla2xxx: Include Exchange offload/Extended Login into FW dump
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>
This commit is contained in:
parent
60a9eadb19
commit
b945e777f9
@ -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);
|
||||
|
@ -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 {
|
||||
|
@ -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) {
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user