diff options
author | Satish Kharat <satishkh@cisco.com> | 2019-01-14 17:09:25 -0800 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2019-01-22 21:18:34 -0500 |
commit | 3567dca1bac619d8da4145602495faf9340a4688 (patch) | |
tree | 238e34664b761bfdfb93e7b9b47421308594b0e3 /drivers/scsi/fnic/fnic_scsi.c | |
parent | d948e6383ec372da488cb553d56e100787a32ace (diff) | |
download | lwn-3567dca1bac619d8da4145602495faf9340a4688.tar.gz lwn-3567dca1bac619d8da4145602495faf9340a4688.zip |
scsi: fnic: fnic stats for max CQs processed and ISR time
This change is to add fnic stats for the max number of CQs (corresponding
to copy WQ) processed in a given interrupt, max time taken by the ISR.
Signed-off-by: Satish Kharat <satishkh@cisco.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/fnic/fnic_scsi.c')
-rw-r--r-- | drivers/scsi/fnic/fnic_scsi.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/drivers/scsi/fnic/fnic_scsi.c b/drivers/scsi/fnic/fnic_scsi.c index a49b0f36b2f8..4140f07415dd 100644 --- a/drivers/scsi/fnic/fnic_scsi.c +++ b/drivers/scsi/fnic/fnic_scsi.c @@ -1325,13 +1325,32 @@ int fnic_wq_copy_cmpl_handler(struct fnic *fnic, int copy_work_to_do) unsigned int wq_work_done = 0; unsigned int i, cq_index; unsigned int cur_work_done; + struct misc_stats *misc_stats = &fnic->fnic_stats.misc_stats; + u64 start_jiffies = 0; + u64 end_jiffies = 0; + u64 delta_jiffies = 0; + u64 delta_ms = 0; for (i = 0; i < fnic->wq_copy_count; i++) { cq_index = i + fnic->raw_wq_count + fnic->rq_count; + + start_jiffies = jiffies; cur_work_done = vnic_cq_copy_service(&fnic->cq[cq_index], fnic_fcpio_cmpl_handler, copy_work_to_do); + end_jiffies = jiffies; + wq_work_done += cur_work_done; + delta_jiffies = end_jiffies - start_jiffies; + if (delta_jiffies > + (u64) atomic64_read(&misc_stats->max_isr_jiffies)) { + atomic64_set(&misc_stats->max_isr_jiffies, + delta_jiffies); + delta_ms = jiffies_to_msecs(delta_jiffies); + atomic64_set(&misc_stats->max_isr_time_ms, delta_ms); + atomic64_set(&misc_stats->corr_work_done, + cur_work_done); + } } return wq_work_done; } |