diff options
author | Vasu Dev <vasu.dev@intel.com> | 2012-05-25 13:26:48 -0400 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2012-07-20 03:31:48 -0400 |
commit | 0f02a6652803235a4893c7b01dd6eab862a913ec (patch) | |
tree | 21c80b2f5778a620da6c3e2599b6deee8e459ec0 /drivers | |
parent | 1bd49b482077e231842352621169dedff1f41931 (diff) |
[SCSI] libfc: adds FCP failures stats
Adds stats to track FCP pkt and frame alloc
failure.
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')
-rw-r--r-- | drivers/scsi/libfc/fc_fcp.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/scsi/libfc/fc_fcp.c b/drivers/scsi/libfc/fc_fcp.c index 5c4c504fc105..3c96e9300d00 100644 --- a/drivers/scsi/libfc/fc_fcp.c +++ b/drivers/scsi/libfc/fc_fcp.c | |||
@@ -158,6 +158,9 @@ static struct fc_fcp_pkt *fc_fcp_pkt_alloc(struct fc_lport *lport, gfp_t gfp) | |||
158 | fsp->timer.data = (unsigned long)fsp; | 158 | fsp->timer.data = (unsigned long)fsp; |
159 | INIT_LIST_HEAD(&fsp->list); | 159 | INIT_LIST_HEAD(&fsp->list); |
160 | spin_lock_init(&fsp->scsi_pkt_lock); | 160 | spin_lock_init(&fsp->scsi_pkt_lock); |
161 | } else { | ||
162 | per_cpu_ptr(lport->stats, get_cpu())->FcpPktAllocFails++; | ||
163 | put_cpu(); | ||
161 | } | 164 | } |
162 | return fsp; | 165 | return fsp; |
163 | } | 166 | } |
@@ -264,6 +267,9 @@ static int fc_fcp_send_abort(struct fc_fcp_pkt *fsp) | |||
264 | if (!fsp->seq_ptr) | 267 | if (!fsp->seq_ptr) |
265 | return -EINVAL; | 268 | return -EINVAL; |
266 | 269 | ||
270 | per_cpu_ptr(fsp->lp->stats, get_cpu())->FcpPktAborts++; | ||
271 | put_cpu(); | ||
272 | |||
267 | fsp->state |= FC_SRB_ABORT_PENDING; | 273 | fsp->state |= FC_SRB_ABORT_PENDING; |
268 | return fsp->lp->tt.seq_exch_abort(fsp->seq_ptr, 0); | 274 | return fsp->lp->tt.seq_exch_abort(fsp->seq_ptr, 0); |
269 | } | 275 | } |
@@ -420,6 +426,8 @@ static inline struct fc_frame *fc_fcp_frame_alloc(struct fc_lport *lport, | |||
420 | if (likely(fp)) | 426 | if (likely(fp)) |
421 | return fp; | 427 | return fp; |
422 | 428 | ||
429 | per_cpu_ptr(lport->stats, get_cpu())->FcpFrameAllocFails++; | ||
430 | put_cpu(); | ||
423 | /* error case */ | 431 | /* error case */ |
424 | fc_fcp_can_queue_ramp_down(lport); | 432 | fc_fcp_can_queue_ramp_down(lport); |
425 | return NULL; | 433 | return NULL; |