From 547aab51a914e1f18394d8238ef9fb4f76d5b491 Mon Sep 17 00:00:00 2001 From: Shyam Sundar Date: Wed, 21 Oct 2020 02:27:12 -0700 Subject: scsi: fc: Add FPIN statistics to fc_host and fc_rport objects Add a structure for holding FPIN statistics, for host & rport respectively, and add associated sysfs nodes: /sys/class/fc_host/hostXX/statistics/ /sys/class/fc_remote_ports/rport-XX\:Y-Z/statistics/ Link: https://lore.kernel.org/r/20201021092715.22669-3-njavali@marvell.com Reviewed-by: James Smart Reviewed-by: Himanshu Madhani Signed-off-by: Shyam Sundar Signed-off-by: Nilesh Javali Signed-off-by: Martin K. Petersen --- include/scsi/scsi_transport_fc.h | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'include/scsi') diff --git a/include/scsi/scsi_transport_fc.h b/include/scsi/scsi_transport_fc.h index 1c7dd35cb7a0..487a403ee51e 100644 --- a/include/scsi/scsi_transport_fc.h +++ b/include/scsi/scsi_transport_fc.h @@ -285,6 +285,36 @@ struct fc_rport_identifiers { u32 roles; }; +/* + * Fabric Performance Impact Notification Statistics + */ +struct fc_fpin_stats { + /* Delivery */ + u64 dn; + u64 dn_unknown; + u64 dn_timeout; + u64 dn_unable_to_route; + u64 dn_device_specific; + + /* Link Integrity */ + u64 li; + u64 li_failure_unknown; + u64 li_link_failure_count; + u64 li_loss_of_sync_count; + u64 li_loss_of_signals_count; + u64 li_prim_seq_err_count; + u64 li_invalid_tx_word_count; + u64 li_invalid_crc_count; + u64 li_device_specific; + + /* Congestion/Peer Congestion */ + u64 cn; + u64 cn_clear; + u64 cn_lost_credit; + u64 cn_credit_stall; + u64 cn_oversubscription; + u64 cn_device_specific; +}; /* Macro for use in defining Remote Port attributes */ #define FC_RPORT_ATTR(_name,_mode,_show,_store) \ @@ -326,6 +356,7 @@ struct fc_rport { /* aka fc_starget_attrs */ /* Dynamic Attributes */ u32 dev_loss_tmo; /* Remote Port loss timeout in seconds. */ + struct fc_fpin_stats fpin_stats; /* Private (Transport-managed) Attributes */ u64 node_name; @@ -516,6 +547,7 @@ struct fc_host_attrs { char symbolic_name[FC_SYMBOLIC_NAME_SIZE]; char system_hostname[FC_SYMBOLIC_NAME_SIZE]; u32 dev_loss_tmo; + struct fc_fpin_stats fpin_stats; /* Private (Transport-managed) Attributes */ enum fc_tgtid_binding_type tgtid_bind_type; -- cgit v1.2.3-58-ga151