diff options
author | Jing Huang <huangj@brocade.com> | 2010-07-08 19:48:49 -0700 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2010-07-27 12:04:07 -0500 |
commit | b85d045ee866011df535565bf12d684e8e5b7a9d (patch) | |
tree | b8f7d73d92d7aaf659b3eedcc417ff7614c22316 /drivers/scsi/bfa/bfa_port.c | |
parent | 15b64a835def4c784c6e62ad762677f5cb56eba2 (diff) | |
download | talos-obmc-linux-b85d045ee866011df535565bf12d684e8e5b7a9d.tar.gz talos-obmc-linux-b85d045ee866011df535565bf12d684e8e5b7a9d.zip |
[SCSI] bfa: statistics and typo fix
- Added time stamp for fcport stats reset
- Added new fileds to the statistics data structures.
- Typo removal and minor cleanup.
Signed-off-by: Jing Huang <huangj@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/bfa/bfa_port.c')
-rw-r--r-- | drivers/scsi/bfa/bfa_port.c | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/drivers/scsi/bfa/bfa_port.c b/drivers/scsi/bfa/bfa_port.c index cab19028361a..6773e2282ddc 100644 --- a/drivers/scsi/bfa/bfa_port.c +++ b/drivers/scsi/bfa/bfa_port.c @@ -102,9 +102,14 @@ bfa_port_get_stats_isr(struct bfa_port_s *port, bfa_status_t status) port->stats_busy = BFA_FALSE; if (status == BFA_STATUS_OK) { + struct bfa_timeval_s tv; + memcpy(port->stats, port->stats_dma.kva, sizeof(union bfa_pport_stats_u)); bfa_port_stats_swap(port, port->stats); + + bfa_os_gettimeofday(&tv); + port->stats->fc.secs_reset = tv.tv_sec - port->stats_reset_time; } if (port->stats_cbfn) { @@ -125,9 +130,17 @@ bfa_port_get_stats_isr(struct bfa_port_s *port, bfa_status_t status) static void bfa_port_clear_stats_isr(struct bfa_port_s *port, bfa_status_t status) { + struct bfa_timeval_s tv; + port->stats_status = status; port->stats_busy = BFA_FALSE; + /** + * re-initialize time stamp for stats reset + */ + bfa_os_gettimeofday(&tv); + port->stats_reset_time = tv.tv_sec; + if (port->stats_cbfn) { port->stats_cbfn(port->stats_cbarg, status); port->stats_cbfn = NULL; @@ -428,6 +441,8 @@ void bfa_port_attach(struct bfa_port_s *port, struct bfa_ioc_s *ioc, void *dev, struct bfa_trc_mod_s *trcmod, struct bfa_log_mod_s *logmod) { + struct bfa_timeval_s tv; + bfa_assert(port); port->dev = dev; @@ -435,13 +450,21 @@ bfa_port_attach(struct bfa_port_s *port, struct bfa_ioc_s *ioc, void *dev, port->trcmod = trcmod; port->logmod = logmod; - port->stats_busy = port->endis_pending = BFA_FALSE; - port->stats_cbfn = port->endis_cbfn = NULL; + port->stats_busy = BFA_FALSE; + port->endis_pending = BFA_FALSE; + port->stats_cbfn = NULL; + port->endis_cbfn = NULL; bfa_ioc_mbox_regisr(port->ioc, BFI_MC_PORT, bfa_port_isr, port); bfa_ioc_hbfail_init(&port->hbfail, bfa_port_hbfail, port); bfa_ioc_hbfail_register(port->ioc, &port->hbfail); + /** + * initialize time stamp for stats reset + */ + bfa_os_gettimeofday(&tv); + port->stats_reset_time = tv.tv_sec; + bfa_trc(port, 0); } |