Commit 0f02a665 authored by Vasu Dev's avatar Vasu Dev Committed by James Bottomley

[SCSI] libfc: adds FCP failures stats

Adds stats to track FCP pkt and frame alloc
failure.
Signed-off-by: default avatarVasu Dev <vasu.dev@intel.com>
Acked-by : Robert Love <robert.w.love@intel.com>
Tested-by: default avatarRoss Brattain <ross.b.brattain@intel.com>
Signed-off-by: default avatarJames Bottomley <JBottomley@Parallels.com>
parent 1bd49b48
...@@ -158,6 +158,9 @@ static struct fc_fcp_pkt *fc_fcp_pkt_alloc(struct fc_lport *lport, gfp_t gfp) ...@@ -158,6 +158,9 @@ static struct fc_fcp_pkt *fc_fcp_pkt_alloc(struct fc_lport *lport, gfp_t gfp)
fsp->timer.data = (unsigned long)fsp; fsp->timer.data = (unsigned long)fsp;
INIT_LIST_HEAD(&fsp->list); INIT_LIST_HEAD(&fsp->list);
spin_lock_init(&fsp->scsi_pkt_lock); spin_lock_init(&fsp->scsi_pkt_lock);
} else {
per_cpu_ptr(lport->stats, get_cpu())->FcpPktAllocFails++;
put_cpu();
} }
return fsp; return fsp;
} }
...@@ -264,6 +267,9 @@ static int fc_fcp_send_abort(struct fc_fcp_pkt *fsp) ...@@ -264,6 +267,9 @@ static int fc_fcp_send_abort(struct fc_fcp_pkt *fsp)
if (!fsp->seq_ptr) if (!fsp->seq_ptr)
return -EINVAL; return -EINVAL;
per_cpu_ptr(fsp->lp->stats, get_cpu())->FcpPktAborts++;
put_cpu();
fsp->state |= FC_SRB_ABORT_PENDING; fsp->state |= FC_SRB_ABORT_PENDING;
return fsp->lp->tt.seq_exch_abort(fsp->seq_ptr, 0); return fsp->lp->tt.seq_exch_abort(fsp->seq_ptr, 0);
} }
...@@ -420,6 +426,8 @@ static inline struct fc_frame *fc_fcp_frame_alloc(struct fc_lport *lport, ...@@ -420,6 +426,8 @@ static inline struct fc_frame *fc_fcp_frame_alloc(struct fc_lport *lport,
if (likely(fp)) if (likely(fp))
return fp; return fp;
per_cpu_ptr(lport->stats, get_cpu())->FcpFrameAllocFails++;
put_cpu();
/* error case */ /* error case */
fc_fcp_can_queue_ramp_down(lport); fc_fcp_can_queue_ramp_down(lport);
return NULL; return NULL;
......
...@@ -232,6 +232,9 @@ struct fc_rport_priv { ...@@ -232,6 +232,9 @@ struct fc_rport_priv {
* @RxWords: Number of received words * @RxWords: Number of received words
* @ErrorFrames: Number of received error frames * @ErrorFrames: Number of received error frames
* @DumpedFrames: Number of dumped frames * @DumpedFrames: Number of dumped frames
* @FcpPktAllocFails: Number of fcp packet allocation failures
* @FcpPktAborts: Number of fcp packet aborts
* @FcpFrameAllocFails: Number of fcp frame allocation failures
* @LinkFailureCount: Number of link failures * @LinkFailureCount: Number of link failures
* @LossOfSignalCount: Number for signal losses * @LossOfSignalCount: Number for signal losses
* @InvalidTxWordCount: Number of invalid transmitted words * @InvalidTxWordCount: Number of invalid transmitted words
...@@ -252,6 +255,9 @@ struct fc_stats { ...@@ -252,6 +255,9 @@ struct fc_stats {
u64 RxWords; u64 RxWords;
u64 ErrorFrames; u64 ErrorFrames;
u64 DumpedFrames; u64 DumpedFrames;
u64 FcpPktAllocFails;
u64 FcpPktAborts;
u64 FcpFrameAllocFails;
u64 LinkFailureCount; u64 LinkFailureCount;
u64 LossOfSignalCount; u64 LossOfSignalCount;
u64 InvalidTxWordCount; u64 InvalidTxWordCount;
......
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