Commit 2be21fa2 authored by Saurav Kashyap's avatar Saurav Kashyap Committed by James Bottomley

[SCSI] qla2xxx: Stats should be different from physical and virtual ports

Currently stats is part of ha data structure, common for physical and virtual
ports. Moved the stats to vha, each port will have its own stat.
Signed-off-by: default avatarSaurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: default avatarChad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: default avatarJames Bottomley <JBottomley@Parallels.com>
parent 5f28d2d7
...@@ -1105,9 +1105,8 @@ qla2x00_total_isp_aborts_show(struct device *dev, ...@@ -1105,9 +1105,8 @@ qla2x00_total_isp_aborts_show(struct device *dev,
struct device_attribute *attr, char *buf) struct device_attribute *attr, char *buf)
{ {
scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
struct qla_hw_data *ha = vha->hw;
return snprintf(buf, PAGE_SIZE, "%d\n", return snprintf(buf, PAGE_SIZE, "%d\n",
ha->qla_stats.total_isp_aborts); vha->qla_stats.total_isp_aborts);
} }
static ssize_t static ssize_t
...@@ -1537,7 +1536,7 @@ qla2x00_get_fc_host_stats(struct Scsi_Host *shost) ...@@ -1537,7 +1536,7 @@ qla2x00_get_fc_host_stats(struct Scsi_Host *shost)
dma_addr_t stats_dma; dma_addr_t stats_dma;
struct fc_host_statistics *pfc_host_stat; struct fc_host_statistics *pfc_host_stat;
pfc_host_stat = &ha->fc_host_stat; pfc_host_stat = &vha->fc_host_stat;
memset(pfc_host_stat, -1, sizeof(struct fc_host_statistics)); memset(pfc_host_stat, -1, sizeof(struct fc_host_statistics));
if (test_bit(UNLOADING, &vha->dpc_flags)) if (test_bit(UNLOADING, &vha->dpc_flags))
...@@ -1580,8 +1579,8 @@ qla2x00_get_fc_host_stats(struct Scsi_Host *shost) ...@@ -1580,8 +1579,8 @@ qla2x00_get_fc_host_stats(struct Scsi_Host *shost)
pfc_host_stat->dumped_frames = stats->dumped_frames; pfc_host_stat->dumped_frames = stats->dumped_frames;
pfc_host_stat->nos_count = stats->nos_rcvd; pfc_host_stat->nos_count = stats->nos_rcvd;
} }
pfc_host_stat->fcp_input_megabytes = ha->qla_stats.input_bytes >> 20; pfc_host_stat->fcp_input_megabytes = vha->qla_stats.input_bytes >> 20;
pfc_host_stat->fcp_output_megabytes = ha->qla_stats.output_bytes >> 20; pfc_host_stat->fcp_output_megabytes = vha->qla_stats.output_bytes >> 20;
done_free: done_free:
dma_pool_free(ha->s_dma_pool, stats, stats_dma); dma_pool_free(ha->s_dma_pool, stats, stats_dma);
......
...@@ -2804,7 +2804,6 @@ struct qla_hw_data { ...@@ -2804,7 +2804,6 @@ struct qla_hw_data {
/* ISP2322: red, green, amber. */ /* ISP2322: red, green, amber. */
uint16_t zio_mode; uint16_t zio_mode;
uint16_t zio_timer; uint16_t zio_timer;
struct fc_host_statistics fc_host_stat;
struct qla_msix_entry *msix_entries; struct qla_msix_entry *msix_entries;
...@@ -2817,7 +2816,6 @@ struct qla_hw_data { ...@@ -2817,7 +2816,6 @@ struct qla_hw_data {
int cur_vport_count; int cur_vport_count;
struct qla_chip_state_84xx *cs84xx; struct qla_chip_state_84xx *cs84xx;
struct qla_statistics qla_stats;
struct isp_operations *isp_ops; struct isp_operations *isp_ops;
struct workqueue_struct *wq; struct workqueue_struct *wq;
struct qlfc_fw fw_buf; struct qlfc_fw fw_buf;
...@@ -2979,6 +2977,8 @@ typedef struct scsi_qla_host { ...@@ -2979,6 +2977,8 @@ typedef struct scsi_qla_host {
struct req_que *req; struct req_que *req;
int fw_heartbeat_counter; int fw_heartbeat_counter;
int seconds_since_last_heartbeat; int seconds_since_last_heartbeat;
struct fc_host_statistics fc_host_stat;
struct qla_statistics qla_stats;
atomic_t vref_count; atomic_t vref_count;
} scsi_qla_host_t; } scsi_qla_host_t;
......
...@@ -3841,7 +3841,7 @@ qla2x00_abort_isp_cleanup(scsi_qla_host_t *vha) ...@@ -3841,7 +3841,7 @@ qla2x00_abort_isp_cleanup(scsi_qla_host_t *vha)
vha->flags.online = 0; vha->flags.online = 0;
ha->flags.chip_reset_done = 0; ha->flags.chip_reset_done = 0;
clear_bit(ISP_ABORT_NEEDED, &vha->dpc_flags); clear_bit(ISP_ABORT_NEEDED, &vha->dpc_flags);
ha->qla_stats.total_isp_aborts++; vha->qla_stats.total_isp_aborts++;
ql_log(ql_log_info, vha, 0x00af, ql_log(ql_log_info, vha, 0x00af,
"Performing ISP error recovery - ha=%p.\n", ha); "Performing ISP error recovery - ha=%p.\n", ha);
......
...@@ -23,18 +23,17 @@ qla2x00_get_cmd_direction(srb_t *sp) ...@@ -23,18 +23,17 @@ qla2x00_get_cmd_direction(srb_t *sp)
{ {
uint16_t cflags; uint16_t cflags;
struct scsi_cmnd *cmd = GET_CMD_SP(sp); struct scsi_cmnd *cmd = GET_CMD_SP(sp);
struct scsi_qla_host *vha = sp->fcport->vha;
cflags = 0; cflags = 0;
/* Set transfer direction */ /* Set transfer direction */
if (cmd->sc_data_direction == DMA_TO_DEVICE) { if (cmd->sc_data_direction == DMA_TO_DEVICE) {
cflags = CF_WRITE; cflags = CF_WRITE;
sp->fcport->vha->hw->qla_stats.output_bytes += vha->qla_stats.output_bytes += scsi_bufflen(cmd);
scsi_bufflen(cmd);
} else if (cmd->sc_data_direction == DMA_FROM_DEVICE) { } else if (cmd->sc_data_direction == DMA_FROM_DEVICE) {
cflags = CF_READ; cflags = CF_READ;
sp->fcport->vha->hw->qla_stats.input_bytes += vha->qla_stats.input_bytes += scsi_bufflen(cmd);
scsi_bufflen(cmd);
} }
return (cflags); return (cflags);
} }
...@@ -630,11 +629,11 @@ qla24xx_build_scsi_type_6_iocbs(srb_t *sp, struct cmd_type_6 *cmd_pkt, ...@@ -630,11 +629,11 @@ qla24xx_build_scsi_type_6_iocbs(srb_t *sp, struct cmd_type_6 *cmd_pkt,
if (cmd->sc_data_direction == DMA_TO_DEVICE) { if (cmd->sc_data_direction == DMA_TO_DEVICE) {
cmd_pkt->control_flags = cmd_pkt->control_flags =
__constant_cpu_to_le16(CF_WRITE_DATA); __constant_cpu_to_le16(CF_WRITE_DATA);
ha->qla_stats.output_bytes += scsi_bufflen(cmd); vha->qla_stats.output_bytes += scsi_bufflen(cmd);
} else if (cmd->sc_data_direction == DMA_FROM_DEVICE) { } else if (cmd->sc_data_direction == DMA_FROM_DEVICE) {
cmd_pkt->control_flags = cmd_pkt->control_flags =
__constant_cpu_to_le16(CF_READ_DATA); __constant_cpu_to_le16(CF_READ_DATA);
ha->qla_stats.input_bytes += scsi_bufflen(cmd); vha->qla_stats.input_bytes += scsi_bufflen(cmd);
} }
cur_seg = scsi_sglist(cmd); cur_seg = scsi_sglist(cmd);
...@@ -746,13 +745,11 @@ qla24xx_build_scsi_iocbs(srb_t *sp, struct cmd_type_7 *cmd_pkt, ...@@ -746,13 +745,11 @@ qla24xx_build_scsi_iocbs(srb_t *sp, struct cmd_type_7 *cmd_pkt,
if (cmd->sc_data_direction == DMA_TO_DEVICE) { if (cmd->sc_data_direction == DMA_TO_DEVICE) {
cmd_pkt->task_mgmt_flags = cmd_pkt->task_mgmt_flags =
__constant_cpu_to_le16(TMF_WRITE_DATA); __constant_cpu_to_le16(TMF_WRITE_DATA);
sp->fcport->vha->hw->qla_stats.output_bytes += vha->qla_stats.output_bytes += scsi_bufflen(cmd);
scsi_bufflen(cmd);
} else if (cmd->sc_data_direction == DMA_FROM_DEVICE) { } else if (cmd->sc_data_direction == DMA_FROM_DEVICE) {
cmd_pkt->task_mgmt_flags = cmd_pkt->task_mgmt_flags =
__constant_cpu_to_le16(TMF_READ_DATA); __constant_cpu_to_le16(TMF_READ_DATA);
sp->fcport->vha->hw->qla_stats.input_bytes += vha->qla_stats.input_bytes += scsi_bufflen(cmd);
scsi_bufflen(cmd);
} }
/* One DSD is available in the Command Type 3 IOCB */ /* One DSD is available in the Command Type 3 IOCB */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment