diff options
author | Vasu Dev <vasu.dev@intel.com> | 2012-05-25 13:26:54 -0400 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2012-07-20 03:31:48 -0400 |
commit | 4e5fae7adbe4f21538b9e62c0fc9b029bbd606cb (patch) | |
tree | 99c14af426c0e3f6b38583ac66e7622028d669c6 /drivers/scsi/libfc/fc_exch.c | |
parent | 0f02a6652803235a4893c7b01dd6eab862a913ec (diff) |
[SCSI] libfc: update fcp and exch stats
Updates newly added stats from fc_get_host_stats,
added new function fc_exch_update_stats to
update exches related stats from fc_exch.c
by going thru internal ema_list elements.
Signed-off-by: Vasu Dev <vasu.dev@intel.com>
Acked-by : Robert Love <robert.w.love@intel.com>
Tested-by: Ross Brattain <ross.b.brattain@intel.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/libfc/fc_exch.c')
-rw-r--r-- | drivers/scsi/libfc/fc_exch.c | 30 |
1 files changed, 25 insertions, 5 deletions
diff --git a/drivers/scsi/libfc/fc_exch.c b/drivers/scsi/libfc/fc_exch.c index 1d0334f83f78..10a6a2a7bfc5 100644 --- a/drivers/scsi/libfc/fc_exch.c +++ b/drivers/scsi/libfc/fc_exch.c | |||
@@ -99,11 +99,6 @@ struct fc_exch_mgr { | |||
99 | u16 max_xid; | 99 | u16 max_xid; |
100 | u16 pool_max_index; | 100 | u16 pool_max_index; |
101 | 101 | ||
102 | /* | ||
103 | * currently exchange mgr stats are updated but not used. | ||
104 | * either stats can be expose via sysfs or remove them | ||
105 | * all together if not used XXX | ||
106 | */ | ||
107 | struct { | 102 | struct { |
108 | atomic_t no_free_exch; | 103 | atomic_t no_free_exch; |
109 | atomic_t no_free_exch_xid; | 104 | atomic_t no_free_exch_xid; |
@@ -2156,6 +2151,31 @@ out: | |||
2156 | } | 2151 | } |
2157 | 2152 | ||
2158 | /** | 2153 | /** |
2154 | * fc_exch_update_stats() - update exches stats to lport | ||
2155 | * @lport: The local port to update exchange manager stats | ||
2156 | */ | ||
2157 | void fc_exch_update_stats(struct fc_lport *lport) | ||
2158 | { | ||
2159 | struct fc_host_statistics *st; | ||
2160 | struct fc_exch_mgr_anchor *ema; | ||
2161 | struct fc_exch_mgr *mp; | ||
2162 | |||
2163 | st = &lport->host_stats; | ||
2164 | |||
2165 | list_for_each_entry(ema, &lport->ema_list, ema_list) { | ||
2166 | mp = ema->mp; | ||
2167 | st->fc_no_free_exch += atomic_read(&mp->stats.no_free_exch); | ||
2168 | st->fc_no_free_exch_xid += | ||
2169 | atomic_read(&mp->stats.no_free_exch_xid); | ||
2170 | st->fc_xid_not_found += atomic_read(&mp->stats.xid_not_found); | ||
2171 | st->fc_xid_busy += atomic_read(&mp->stats.xid_busy); | ||
2172 | st->fc_seq_not_found += atomic_read(&mp->stats.seq_not_found); | ||
2173 | st->fc_non_bls_resp += atomic_read(&mp->stats.non_bls_resp); | ||
2174 | } | ||
2175 | } | ||
2176 | EXPORT_SYMBOL(fc_exch_update_stats); | ||
2177 | |||
2178 | /** | ||
2159 | * fc_exch_mgr_add() - Add an exchange manager to a local port's list of EMs | 2179 | * fc_exch_mgr_add() - Add an exchange manager to a local port's list of EMs |
2160 | * @lport: The local port to add the exchange manager to | 2180 | * @lport: The local port to add the exchange manager to |
2161 | * @mp: The exchange manager to be added to the local port | 2181 | * @mp: The exchange manager to be added to the local port |