[SCSI] fc: add some more FC specific stats to fc_host
authorVasu Dev <vasu.dev@intel.com>
Fri, 25 May 2012 17:26:38 +0000 (10:26 -0700)
committerJames Bottomley <JBottomley@Parallels.com>
Fri, 20 Jul 2012 07:31:47 +0000 (08:31 +0100)
The libfc provides more flexibility and with that
we can monitor some more FC specific stats for
FC exches or FCP error cases, this patch add
such new FC stats.

The patch adds *only* FC specific new stats to
existing fc_host attribute container.

Added stats names are self explanatory as
existing FC stats already has, however anyway
still added commentary along their definition
to describe them.

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>
drivers/scsi/scsi_transport_fc.c
include/scsi/scsi_transport_fc.h

index 5797604..2fded79 100644 (file)
@@ -1744,6 +1744,15 @@ fc_host_statistic(fcp_output_requests);
 fc_host_statistic(fcp_control_requests);
 fc_host_statistic(fcp_input_megabytes);
 fc_host_statistic(fcp_output_megabytes);
+fc_host_statistic(fcp_packet_alloc_failures);
+fc_host_statistic(fcp_packet_aborts);
+fc_host_statistic(fcp_frame_alloc_failures);
+fc_host_statistic(fc_no_free_exch);
+fc_host_statistic(fc_no_free_exch_xid);
+fc_host_statistic(fc_xid_not_found);
+fc_host_statistic(fc_xid_busy);
+fc_host_statistic(fc_seq_not_found);
+fc_host_statistic(fc_non_bls_resp);
 
 static ssize_t
 fc_reset_statistics(struct device *dev, struct device_attribute *attr,
@@ -1784,6 +1793,15 @@ static struct attribute *fc_statistics_attrs[] = {
        &device_attr_host_fcp_control_requests.attr,
        &device_attr_host_fcp_input_megabytes.attr,
        &device_attr_host_fcp_output_megabytes.attr,
+       &device_attr_host_fcp_packet_alloc_failures.attr,
+       &device_attr_host_fcp_packet_aborts.attr,
+       &device_attr_host_fcp_frame_alloc_failures.attr,
+       &device_attr_host_fc_no_free_exch.attr,
+       &device_attr_host_fc_no_free_exch_xid.attr,
+       &device_attr_host_fc_xid_not_found.attr,
+       &device_attr_host_fc_xid_busy.attr,
+       &device_attr_host_fc_seq_not_found.attr,
+       &device_attr_host_fc_non_bls_resp.attr,
        &device_attr_host_reset_statistics.attr,
        NULL
 };
index 719faf1..b797e8f 100644 (file)
@@ -426,6 +426,18 @@ struct fc_host_statistics {
        u64 fcp_control_requests;
        u64 fcp_input_megabytes;
        u64 fcp_output_megabytes;
+       u64 fcp_packet_alloc_failures;  /* fcp packet allocation failures */
+       u64 fcp_packet_aborts;          /* fcp packet aborted */
+       u64 fcp_frame_alloc_failures;   /* fcp frame allocation failures */
+
+       /* fc exches statistics */
+       u64 fc_no_free_exch;            /* no free exch memory */
+       u64 fc_no_free_exch_xid;        /* no free exch id */
+       u64 fc_xid_not_found;           /* exch not found for a response */
+       u64 fc_xid_busy;                /* exch exist for new a request */
+       u64 fc_seq_not_found;           /* seq is not found for exchange */
+       u64 fc_non_bls_resp;            /* a non BLS response frame with
+                                          a sequence responder in new exch */
 };