scsi: fnic: Adding Check Condition counter to misc fnicstats
authorSatish Kharat <satishkh@cisco.com>
Wed, 1 Mar 2017 00:15:44 +0000 (16:15 -0800)
committerMartin K. Petersen <martin.petersen@oracle.com>
Thu, 23 Mar 2017 13:57:23 +0000 (09:57 -0400)
Just a simple counter of number of check conditions encountered on that
host.

Signed-off-by: Satish Kharat <satishkh@cisco.com>
Signed-off-by: Sesidhar Baddela <sebaddel@cisco.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/fnic/fnic_scsi.c
drivers/scsi/fnic/fnic_stats.h
drivers/scsi/fnic/fnic_trace.c

index ce5de2aa39c704d6860e077fe63aca7485a222ce..190c0663aaf4217ba4596d313368f100304f0686 100644 (file)
@@ -915,6 +915,9 @@ static void fnic_fcpio_icmnd_cmpl_handler(struct fnic *fnic,
                if (icmnd_cmpl->flags & FCPIO_ICMND_CMPL_RESID_UNDER)
                        xfer_len -= icmnd_cmpl->residual;
 
+               if (icmnd_cmpl->scsi_status == SAM_STAT_CHECK_CONDITION)
+                       atomic64_inc(&fnic_stats->misc_stats.check_condition);
+
                if (icmnd_cmpl->scsi_status == SAM_STAT_TASK_SET_FULL)
                        atomic64_inc(&fnic_stats->misc_stats.queue_fulls);
                break;
index 540cceb843cd2107bf079e9a1c323ee0bd8c4a61..69acdac7fe535932637b5685b5753a2199bd35ce 100644 (file)
@@ -88,6 +88,7 @@ struct misc_stats {
        atomic64_t devrst_cpwq_alloc_failures;
        atomic64_t io_cpwq_alloc_failures;
        atomic64_t no_icmnd_itmf_cmpls;
+       atomic64_t check_condition;
        atomic64_t queue_fulls;
        atomic64_t rport_not_ready;
        atomic64_t frame_errors;
index 5a5fa01576b751ad7a60ca0bd95cd92d4dc2684e..ec20b3e5784415cfdef7eef712fb4df8db3ce71b 100644 (file)
@@ -357,6 +357,7 @@ int fnic_get_stats_data(struct stats_debug_info *debug,
                  "Number of Copy WQ Alloc Failures for Device Reset: %lld\n"
                  "Number of Copy WQ Alloc Failures for IOs: %lld\n"
                  "Number of no icmnd itmf Completions: %lld\n"
+                 "Number of Check Conditions encountered: %lld\n"
                  "Number of QUEUE Fulls: %lld\n"
                  "Number of rport not ready: %lld\n"
                  "Number of receive frame errors: %lld\n",
@@ -377,6 +378,7 @@ int fnic_get_stats_data(struct stats_debug_info *debug,
                          &stats->misc_stats.devrst_cpwq_alloc_failures),
                  (u64)atomic64_read(&stats->misc_stats.io_cpwq_alloc_failures),
                  (u64)atomic64_read(&stats->misc_stats.no_icmnd_itmf_cmpls),
+                 (u64)atomic64_read(&stats->misc_stats.check_condition),
                  (u64)atomic64_read(&stats->misc_stats.queue_fulls),
                  (u64)atomic64_read(&stats->misc_stats.rport_not_ready),
                  (u64)atomic64_read(&stats->misc_stats.frame_errors));