linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/5] SAN Congestion Management (SCM) statistics
@ 2020-10-21  9:27 Nilesh Javali
  2020-10-21  9:27 ` [PATCH v3 1/5] scsi: fc: Update formal FPIN descriptor definitions Nilesh Javali
                   ` (6 more replies)
  0 siblings, 7 replies; 15+ messages in thread
From: Nilesh Javali @ 2020-10-21  9:27 UTC (permalink / raw)
  To: martin.petersen; +Cc: linux-scsi, GR-QLogic-Storage-Upstream

Martin,

Please apply the attached patchset implementing the SAN Congestion
Management (SCM) statistics to the scsi tree at your earliest
convenience.

v2->v3:
Incorporate review comments for patch v2 3/5.
Added Reviewed-by tag for other patches.

v1->v2:
Further break down patches based on functionality.
Remove dependency on LLDs for remote port FPIN statistics.
Optimize fc_find_rport_by_wwpn implementation.
Name changes to multiple variables/structure elements based on review
comments.

Thanks,
Nilesh

Shyam Sundar (5):
  scsi: fc: Update formal FPIN descriptor definitions
  scsi: fc: Add FPIN statistics to fc_host and fc_rport objects
  scsi: fc: Parse FPIN packets and update statistics
  scsi: fc: Add mechanism to update FPIN signal statistics
  scsi: fc: Update documentation of sysfs nodes for FPIN stats

 Documentation/ABI/testing/sysfs-class-fc_host |  23 +
 .../ABI/testing/sysfs-class-fc_remote_ports   |  23 +
 drivers/scsi/scsi_transport_fc.c              | 415 ++++++++++++++++++
 include/scsi/scsi_transport_fc.h              |  36 ++
 include/uapi/scsi/fc/fc_els.h                 | 114 ++++-
 5 files changed, 610 insertions(+), 1 deletion(-)
 create mode 100644 Documentation/ABI/testing/sysfs-class-fc_host
 create mode 100644 Documentation/ABI/testing/sysfs-class-fc_remote_ports


base-commit: 1ef16a407f544408d3559e4de2ed05591df4da75
-- 
2.19.0.rc0


^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH v3 1/5] scsi: fc: Update formal FPIN descriptor definitions
  2020-10-21  9:27 [PATCH v3 0/5] SAN Congestion Management (SCM) statistics Nilesh Javali
@ 2020-10-21  9:27 ` Nilesh Javali
  2020-10-21 14:46   ` Himanshu Madhani
  2020-10-21  9:27 ` [PATCH v3 2/5] scsi: fc: Add FPIN statistics to fc_host and fc_rport objects Nilesh Javali
                   ` (5 subsequent siblings)
  6 siblings, 1 reply; 15+ messages in thread
From: Nilesh Javali @ 2020-10-21  9:27 UTC (permalink / raw)
  To: martin.petersen; +Cc: linux-scsi, GR-QLogic-Storage-Upstream

From: Shyam Sundar <ssundar@marvell.com>

Add Fabric Performance Impact Notification (FPIN) descriptor definition
for the following FPINs:
Delivery Notification Descriptor
Peer Congestion Notification Descriptor
Congestion Notification Descriptor

Signed-off-by: Shyam Sundar <ssundar@marvell.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
Reviewed-by: James Smart <james.smart@broadcom.com>
---
 include/uapi/scsi/fc/fc_els.h | 114 +++++++++++++++++++++++++++++++++-
 1 file changed, 113 insertions(+), 1 deletion(-)

diff --git a/include/uapi/scsi/fc/fc_els.h b/include/uapi/scsi/fc/fc_els.h
index 8c704e510e39..91d4be987220 100644
--- a/include/uapi/scsi/fc/fc_els.h
+++ b/include/uapi/scsi/fc/fc_els.h
@@ -916,7 +916,9 @@ enum fc_els_clid_ic {
 	ELS_CLID_IC_LIP =	8,	/* receiving LIP */
 };
 
-
+/*
+ * Link Integrity event types
+ */
 enum fc_fpin_li_event_types {
 	FPIN_LI_UNKNOWN =		0x0,
 	FPIN_LI_LINK_FAILURE =		0x1,
@@ -943,6 +945,54 @@ enum fc_fpin_li_event_types {
 	{ FPIN_LI_DEVICE_SPEC,		"Device Specific" },		\
 }
 
+/*
+ * Delivery event types
+ */
+enum fc_fpin_deli_event_types {
+	FPIN_DELI_UNKNOWN =		0x0,
+	FPIN_DELI_TIMEOUT =		0x1,
+	FPIN_DELI_UNABLE_TO_ROUTE =	0x2,
+	FPIN_DELI_DEVICE_SPEC =		0xF,
+};
+
+/*
+ * Initializer useful for decoding table.
+ * Please keep this in sync with the above definitions.
+ */
+#define FC_FPIN_DELI_EVT_TYPES_INIT {					\
+	{ FPIN_DELI_UNKNOWN,		"Unknown" },			\
+	{ FPIN_DELI_TIMEOUT,		"Timeout" },			\
+	{ FPIN_DELI_UNABLE_TO_ROUTE,	"Unable to Route" },		\
+	{ FPIN_DELI_DEVICE_SPEC,	"Device Specific" },		\
+}
+
+/*
+ * Congestion event types
+ */
+enum fc_fpin_congn_event_types {
+	FPIN_CONGN_CLEAR =		0x0,
+	FPIN_CONGN_LOST_CREDIT =	0x1,
+	FPIN_CONGN_CREDIT_STALL =	0x2,
+	FPIN_CONGN_OVERSUBSCRIPTION =	0x3,
+	FPIN_CONGN_DEVICE_SPEC =	0xF,
+};
+
+/*
+ * Initializer useful for decoding table.
+ * Please keep this in sync with the above definitions.
+ */
+#define FC_FPIN_CONGN_EVT_TYPES_INIT {					\
+	{ FPIN_CONGN_CLEAR,		"Clear" },			\
+	{ FPIN_CONGN_LOST_CREDIT,	"Lost Credit" },		\
+	{ FPIN_CONGN_CREDIT_STALL,	"Credit Stall" },		\
+	{ FPIN_CONGN_OVERSUBSCRIPTION,	"Oversubscription" },		\
+	{ FPIN_CONGN_DEVICE_SPEC,	"Device Specific" },		\
+}
+
+enum fc_fpin_congn_severity_types {
+	FPIN_CONGN_SEVERITY_WARNING =	0xF1,
+	FPIN_CONGN_SEVERITY_ERROR =	0xF7,
+};
 
 /*
  * Link Integrity Notification Descriptor
@@ -974,6 +1024,68 @@ struct fc_fn_li_desc {
 					 */
 };
 
+/*
+ * Delivery Notification Descriptor
+ */
+struct fc_fn_deli_desc {
+	__be32		desc_tag;	/* Descriptor Tag (0x00020002) */
+	__be32		desc_len;	/* Length of Descriptor (in bytes).
+					 * Size of descriptor excluding
+					 * desc_tag and desc_len fields.
+					 */
+	__be64		detecting_wwpn;	/* Port Name that detected event */
+	__be64		attached_wwpn;	/* Port Name of device attached to
+					 * detecting Port Name
+					 */
+	__be32		deli_reason_code;/* see enum fc_fpin_deli_event_types */
+};
+
+/*
+ * Peer Congestion Notification Descriptor
+ */
+struct fc_fn_peer_congn_desc {
+	__be32		desc_tag;	/* Descriptor Tag (0x00020003) */
+	__be32		desc_len;	/* Length of Descriptor (in bytes).
+					 * Size of descriptor excluding
+					 * desc_tag and desc_len fields.
+					 */
+	__be64		detecting_wwpn;	/* Port Name that detected event */
+	__be64		attached_wwpn;	/* Port Name of device attached to
+					 * detecting Port Name
+					 */
+	__be16		event_type;	/* see enum fc_fpin_congn_event_types */
+	__be16		event_modifier;	/* Implementation specific value
+					 * describing the event type
+					 */
+	__be32		event_period;	/* duration (ms) of the detected
+					 * congestion event
+					 */
+	__be32		pname_count;	/* number of portname_list elements */
+	__be64		pname_list[0];	/* list of N_Port_Names accessible
+					 * through the attached port
+					 */
+};
+
+/*
+ * Congestion Notification Descriptor
+ */
+struct fc_fn_congn_desc {
+	__be32		desc_tag;	/* Descriptor Tag (0x00020004) */
+	__be32		desc_len;	/* Length of Descriptor (in bytes).
+					 * Size of descriptor excluding
+					 * desc_tag and desc_len fields.
+					 */
+	__be16		event_type;	/* see enum fc_fpin_congn_event_types */
+	__be16		event_modifier;	/* Implementation specific value
+					 * describing the event type
+					 */
+	__be32		event_period;	/* duration (ms) of the detected
+					 * congestion event
+					 */
+	__u8		severity;	/* command */
+	__u8		resv[3];	/* reserved - must be zero */
+};
+
 /*
  * ELS_FPIN - Fabric Performance Impact Notification
  */
-- 
2.19.0.rc0


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH v3 2/5] scsi: fc: Add FPIN statistics to fc_host and fc_rport objects
  2020-10-21  9:27 [PATCH v3 0/5] SAN Congestion Management (SCM) statistics Nilesh Javali
  2020-10-21  9:27 ` [PATCH v3 1/5] scsi: fc: Update formal FPIN descriptor definitions Nilesh Javali
@ 2020-10-21  9:27 ` Nilesh Javali
  2020-10-21 14:47   ` Himanshu Madhani
  2020-10-21  9:27 ` [PATCH v3 3/5] scsi: fc: Parse FPIN packets and update statistics Nilesh Javali
                   ` (4 subsequent siblings)
  6 siblings, 1 reply; 15+ messages in thread
From: Nilesh Javali @ 2020-10-21  9:27 UTC (permalink / raw)
  To: martin.petersen; +Cc: linux-scsi, GR-QLogic-Storage-Upstream

From: Shyam Sundar <ssundar@marvell.com>

- Adds a structure for holding fpin stats for host & rport

- Adds sysfs nodes to maintain FPIN stats:
        /sys/class/fc_host/hostXX/statistics/
        /sys/class/fc_remote_ports/rport-XX\:Y-Z/statistics/

Signed-off-by: Shyam Sundar <ssundar@marvell.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
Reviewed-by: James Smart <james.smart@broadcom.com>
---
 drivers/scsi/scsi_transport_fc.c | 117 +++++++++++++++++++++++++++++++
 include/scsi/scsi_transport_fc.h |  32 +++++++++
 2 files changed, 149 insertions(+)

diff --git a/drivers/scsi/scsi_transport_fc.c b/drivers/scsi/scsi_transport_fc.c
index 2ff7f06203da..501e165ae6f1 100644
--- a/drivers/scsi/scsi_transport_fc.c
+++ b/drivers/scsi/scsi_transport_fc.c
@@ -22,6 +22,7 @@
 #include <net/netlink.h>
 #include <scsi/scsi_netlink_fc.h>
 #include <scsi/scsi_bsg_fc.h>
+#include <uapi/scsi/fc/fc_els.h>
 #include "scsi_priv.h"
 
 static int fc_queue_work(struct Scsi_Host *, struct work_struct *);
@@ -419,6 +420,7 @@ static int fc_host_setup(struct transport_container *tc, struct device *dev,
 	fc_host->fabric_name = -1;
 	memset(fc_host->symbolic_name, 0, sizeof(fc_host->symbolic_name));
 	memset(fc_host->system_hostname, 0, sizeof(fc_host->system_hostname));
+	memset(&fc_host->fpin_stats, 0, sizeof(fc_host->fpin_stats));
 
 	fc_host->tgtid_bind_type = FC_TGTID_BIND_BY_WWPN;
 
@@ -991,6 +993,67 @@ store_fc_rport_fast_io_fail_tmo(struct device *dev,
 static FC_DEVICE_ATTR(rport, fast_io_fail_tmo, S_IRUGO | S_IWUSR,
 	show_fc_rport_fast_io_fail_tmo, store_fc_rport_fast_io_fail_tmo);
 
+#define fc_rport_fpin_statistic(name)					\
+static ssize_t fc_rport_fpinstat_##name(struct device *cd,		\
+				  struct device_attribute *attr,	\
+				  char *buf)				\
+{									\
+	struct fc_rport *rport = transport_class_to_rport(cd);		\
+									\
+	return snprintf(buf, 20, "0x%llx\n", rport->fpin_stats.name);	\
+}									\
+static FC_DEVICE_ATTR(rport, fpin_##name, 0444, fc_rport_fpinstat_##name, NULL)
+
+fc_rport_fpin_statistic(dn);
+fc_rport_fpin_statistic(dn_unknown);
+fc_rport_fpin_statistic(dn_timeout);
+fc_rport_fpin_statistic(dn_unable_to_route);
+fc_rport_fpin_statistic(dn_device_specific);
+fc_rport_fpin_statistic(cn);
+fc_rport_fpin_statistic(cn_clear);
+fc_rport_fpin_statistic(cn_lost_credit);
+fc_rport_fpin_statistic(cn_credit_stall);
+fc_rport_fpin_statistic(cn_oversubscription);
+fc_rport_fpin_statistic(cn_device_specific);
+fc_rport_fpin_statistic(li);
+fc_rport_fpin_statistic(li_failure_unknown);
+fc_rport_fpin_statistic(li_link_failure_count);
+fc_rport_fpin_statistic(li_loss_of_sync_count);
+fc_rport_fpin_statistic(li_loss_of_signals_count);
+fc_rport_fpin_statistic(li_prim_seq_err_count);
+fc_rport_fpin_statistic(li_invalid_tx_word_count);
+fc_rport_fpin_statistic(li_invalid_crc_count);
+fc_rport_fpin_statistic(li_device_specific);
+
+static struct attribute *fc_rport_statistics_attrs[] = {
+	&device_attr_rport_fpin_dn.attr,
+	&device_attr_rport_fpin_dn_unknown.attr,
+	&device_attr_rport_fpin_dn_timeout.attr,
+	&device_attr_rport_fpin_dn_unable_to_route.attr,
+	&device_attr_rport_fpin_dn_device_specific.attr,
+	&device_attr_rport_fpin_li.attr,
+	&device_attr_rport_fpin_li_failure_unknown.attr,
+	&device_attr_rport_fpin_li_link_failure_count.attr,
+	&device_attr_rport_fpin_li_loss_of_sync_count.attr,
+	&device_attr_rport_fpin_li_loss_of_signals_count.attr,
+	&device_attr_rport_fpin_li_prim_seq_err_count.attr,
+	&device_attr_rport_fpin_li_invalid_tx_word_count.attr,
+	&device_attr_rport_fpin_li_invalid_crc_count.attr,
+	&device_attr_rport_fpin_li_device_specific.attr,
+	&device_attr_rport_fpin_cn.attr,
+	&device_attr_rport_fpin_cn_clear.attr,
+	&device_attr_rport_fpin_cn_lost_credit.attr,
+	&device_attr_rport_fpin_cn_credit_stall.attr,
+	&device_attr_rport_fpin_cn_oversubscription.attr,
+	&device_attr_rport_fpin_cn_device_specific.attr,
+	NULL
+};
+
+static struct attribute_group fc_rport_statistics_group = {
+	.name = "statistics",
+	.attrs = fc_rport_statistics_attrs,
+};
+
 
 /*
  * FC SCSI Target Attribute Management
@@ -1745,6 +1808,39 @@ fc_host_statistic(fc_xid_busy);
 fc_host_statistic(fc_seq_not_found);
 fc_host_statistic(fc_non_bls_resp);
 
+#define fc_host_fpin_statistic(name)					\
+static ssize_t fc_host_fpinstat_##name(struct device *cd,		\
+				  struct device_attribute *attr,	\
+				  char *buf)				\
+{									\
+	struct Scsi_Host *shost = transport_class_to_shost(cd);		\
+	struct fc_host_attrs *fc_host = shost_to_fc_host(shost);	\
+									\
+	return snprintf(buf, 20, "0x%llx\n", fc_host->fpin_stats.name);	\
+}									\
+static FC_DEVICE_ATTR(host, fpin_##name, 0444, fc_host_fpinstat_##name, NULL)
+
+fc_host_fpin_statistic(dn);
+fc_host_fpin_statistic(dn_unknown);
+fc_host_fpin_statistic(dn_timeout);
+fc_host_fpin_statistic(dn_unable_to_route);
+fc_host_fpin_statistic(dn_device_specific);
+fc_host_fpin_statistic(cn);
+fc_host_fpin_statistic(cn_clear);
+fc_host_fpin_statistic(cn_lost_credit);
+fc_host_fpin_statistic(cn_credit_stall);
+fc_host_fpin_statistic(cn_oversubscription);
+fc_host_fpin_statistic(cn_device_specific);
+fc_host_fpin_statistic(li);
+fc_host_fpin_statistic(li_failure_unknown);
+fc_host_fpin_statistic(li_link_failure_count);
+fc_host_fpin_statistic(li_loss_of_sync_count);
+fc_host_fpin_statistic(li_loss_of_signals_count);
+fc_host_fpin_statistic(li_prim_seq_err_count);
+fc_host_fpin_statistic(li_invalid_tx_word_count);
+fc_host_fpin_statistic(li_invalid_crc_count);
+fc_host_fpin_statistic(li_device_specific);
+
 static ssize_t
 fc_reset_statistics(struct device *dev, struct device_attribute *attr,
 		    const char *buf, size_t count)
@@ -1794,6 +1890,26 @@ static struct attribute *fc_statistics_attrs[] = {
 	&device_attr_host_fc_seq_not_found.attr,
 	&device_attr_host_fc_non_bls_resp.attr,
 	&device_attr_host_reset_statistics.attr,
+	&device_attr_host_fpin_dn.attr,
+	&device_attr_host_fpin_dn_unknown.attr,
+	&device_attr_host_fpin_dn_timeout.attr,
+	&device_attr_host_fpin_dn_unable_to_route.attr,
+	&device_attr_host_fpin_dn_device_specific.attr,
+	&device_attr_host_fpin_li.attr,
+	&device_attr_host_fpin_li_failure_unknown.attr,
+	&device_attr_host_fpin_li_link_failure_count.attr,
+	&device_attr_host_fpin_li_loss_of_sync_count.attr,
+	&device_attr_host_fpin_li_loss_of_signals_count.attr,
+	&device_attr_host_fpin_li_prim_seq_err_count.attr,
+	&device_attr_host_fpin_li_invalid_tx_word_count.attr,
+	&device_attr_host_fpin_li_invalid_crc_count.attr,
+	&device_attr_host_fpin_li_device_specific.attr,
+	&device_attr_host_fpin_cn.attr,
+	&device_attr_host_fpin_cn_clear.attr,
+	&device_attr_host_fpin_cn_lost_credit.attr,
+	&device_attr_host_fpin_cn_credit_stall.attr,
+	&device_attr_host_fpin_cn_oversubscription.attr,
+	&device_attr_host_fpin_cn_device_specific.attr,
 	NULL
 };
 
@@ -2177,6 +2293,7 @@ fc_attach_transport(struct fc_function_template *ft)
 	i->rport_attr_cont.ac.attrs = &i->rport_attrs[0];
 	i->rport_attr_cont.ac.class = &fc_rport_class.class;
 	i->rport_attr_cont.ac.match = fc_rport_match;
+	i->rport_attr_cont.statistics = &fc_rport_statistics_group;
 	transport_container_register(&i->rport_attr_cont);
 
 	i->vport_attr_cont.ac.attrs = &i->vport_attrs[0];
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;
-- 
2.19.0.rc0


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH v3 3/5] scsi: fc: Parse FPIN packets and update statistics
  2020-10-21  9:27 [PATCH v3 0/5] SAN Congestion Management (SCM) statistics Nilesh Javali
  2020-10-21  9:27 ` [PATCH v3 1/5] scsi: fc: Update formal FPIN descriptor definitions Nilesh Javali
  2020-10-21  9:27 ` [PATCH v3 2/5] scsi: fc: Add FPIN statistics to fc_host and fc_rport objects Nilesh Javali
@ 2020-10-21  9:27 ` Nilesh Javali
  2020-10-21 14:55   ` Himanshu Madhani
                     ` (2 more replies)
  2020-10-21  9:27 ` [PATCH v3 4/5] scsi: fc: Add mechanism to update FPIN signal statistics Nilesh Javali
                   ` (3 subsequent siblings)
  6 siblings, 3 replies; 15+ messages in thread
From: Nilesh Javali @ 2020-10-21  9:27 UTC (permalink / raw)
  To: martin.petersen; +Cc: linux-scsi, GR-QLogic-Storage-Upstream

From: Shyam Sundar <ssundar@marvell.com>

Parse the incoming FPIN packets and update the host and rport FPIN
statistics based on the FPINs.

Signed-off-by: Shyam Sundar <ssundar@marvell.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
---
 drivers/scsi/scsi_transport_fc.c | 293 +++++++++++++++++++++++++++++++
 include/scsi/scsi_transport_fc.h |   1 +
 2 files changed, 294 insertions(+)

diff --git a/drivers/scsi/scsi_transport_fc.c b/drivers/scsi/scsi_transport_fc.c
index 501e165ae6f1..4dfa0e40d8e5 100644
--- a/drivers/scsi/scsi_transport_fc.c
+++ b/drivers/scsi/scsi_transport_fc.c
@@ -34,6 +34,11 @@ static int fc_bsg_hostadd(struct Scsi_Host *, struct fc_host_attrs *);
 static int fc_bsg_rportadd(struct Scsi_Host *, struct fc_rport *);
 static void fc_bsg_remove(struct request_queue *);
 static void fc_bsg_goose_queue(struct fc_rport *);
+static void fc_li_stats_update(struct fc_fn_li_desc *li_desc,
+			       struct fc_fpin_stats *stats);
+static void fc_delivery_stats_update(u32 reason_code,
+				     struct fc_fpin_stats *stats);
+static void fc_cn_stats_update(u16 event_type, struct fc_fpin_stats *stats);
 
 /*
  * Module Parameters
@@ -630,6 +635,262 @@ fc_host_post_vendor_event(struct Scsi_Host *shost, u32 event_number,
 }
 EXPORT_SYMBOL(fc_host_post_vendor_event);
 
+/**
+ * fc_find_rport_by_wwpn - find the fc_rport pointer for a given wwpn
+ * @shost:		host the fc_rport is associated with
+ * @wwpn:		wwpn of the fc_rport device
+ *
+ * Notes:
+ *	This routine assumes no locks are held on entry.
+ */
+struct fc_rport *
+fc_find_rport_by_wwpn(struct Scsi_Host *shost, u64 wwpn)
+{
+	struct fc_rport *rport;
+	unsigned long flags;
+
+	spin_lock_irqsave(shost->host_lock, flags);
+
+	list_for_each_entry(rport, &fc_host_rports(shost), peers) {
+		if (rport->port_state != FC_PORTSTATE_ONLINE)
+			continue;
+
+		if (rport->port_name == wwpn) {
+			spin_unlock_irqrestore(shost->host_lock, flags);
+			return rport;
+		}
+	}
+
+	spin_unlock_irqrestore(shost->host_lock, flags);
+	return NULL;
+}
+EXPORT_SYMBOL(fc_find_rport_by_wwpn);
+
+static void
+fc_li_stats_update(struct fc_fn_li_desc *li_desc,
+		   struct fc_fpin_stats *stats)
+{
+	stats->li += be32_to_cpu(li_desc->event_count);
+	switch (be16_to_cpu(li_desc->event_type)) {
+	case FPIN_LI_UNKNOWN:
+		stats->li_failure_unknown +=
+		    be32_to_cpu(li_desc->event_count);
+		break;
+	case FPIN_LI_LINK_FAILURE:
+		stats->li_link_failure_count +=
+		    be32_to_cpu(li_desc->event_count);
+		break;
+	case FPIN_LI_LOSS_OF_SYNC:
+		stats->li_loss_of_sync_count +=
+		    be32_to_cpu(li_desc->event_count);
+		break;
+	case FPIN_LI_LOSS_OF_SIG:
+		stats->li_loss_of_signals_count +=
+		    be32_to_cpu(li_desc->event_count);
+		break;
+	case FPIN_LI_PRIM_SEQ_ERR:
+		stats->li_prim_seq_err_count +=
+		    be32_to_cpu(li_desc->event_count);
+		break;
+	case FPIN_LI_INVALID_TX_WD:
+		stats->li_invalid_tx_word_count +=
+		    be32_to_cpu(li_desc->event_count);
+		break;
+	case FPIN_LI_INVALID_CRC:
+		stats->li_invalid_crc_count +=
+		    be32_to_cpu(li_desc->event_count);
+		break;
+	case FPIN_LI_DEVICE_SPEC:
+		stats->li_device_specific +=
+		    be32_to_cpu(li_desc->event_count);
+		break;
+	}
+}
+
+static void
+fc_delivery_stats_update(u32 reason_code, struct fc_fpin_stats *stats)
+{
+	stats->dn++;
+	switch (reason_code) {
+	case FPIN_DELI_UNKNOWN:
+		stats->dn_unknown++;
+		break;
+	case FPIN_DELI_TIMEOUT:
+		stats->dn_timeout++;
+		break;
+	case FPIN_DELI_UNABLE_TO_ROUTE:
+		stats->dn_unable_to_route++;
+		break;
+	case FPIN_DELI_DEVICE_SPEC:
+		stats->dn_device_specific++;
+		break;
+	}
+}
+
+static void
+fc_cn_stats_update(u16 event_type, struct fc_fpin_stats *stats)
+{
+	stats->cn++;
+	switch (event_type) {
+	case FPIN_CONGN_CLEAR:
+		stats->cn_clear++;
+		break;
+	case FPIN_CONGN_LOST_CREDIT:
+		stats->cn_lost_credit++;
+		break;
+	case FPIN_CONGN_CREDIT_STALL:
+		stats->cn_credit_stall++;
+		break;
+	case FPIN_CONGN_OVERSUBSCRIPTION:
+		stats->cn_oversubscription++;
+		break;
+	case FPIN_CONGN_DEVICE_SPEC:
+		stats->cn_device_specific++;
+	}
+}
+
+/*
+ * fc_fpin_li_stats_update - routine to update Link Integrity
+ * event statistics.
+ * @shost:		host the FPIN was received on
+ * @tlv:		pointer to link integrity descriptor
+ *
+ */
+static void
+fc_fpin_li_stats_update(struct Scsi_Host *shost, struct fc_tlv_desc *tlv)
+{
+	u8 i;
+	struct fc_rport *rport = NULL;
+	struct fc_rport *attach_rport = NULL;
+	struct fc_host_attrs *fc_host = shost_to_fc_host(shost);
+	struct fc_fn_li_desc *li_desc = (struct fc_fn_li_desc *)tlv;
+	u64 wwpn;
+
+	rport = fc_find_rport_by_wwpn(shost,
+				      be64_to_cpu(li_desc->attached_wwpn));
+	if (rport &&
+	    (rport->roles & FC_PORT_ROLE_FCP_TARGET ||
+	     rport->roles & FC_PORT_ROLE_NVME_TARGET)) {
+		attach_rport = rport;
+		fc_li_stats_update(li_desc, &attach_rport->fpin_stats);
+	}
+
+	if (be32_to_cpu(li_desc->pname_count) > 0) {
+		for (i = 0;
+		    i < be32_to_cpu(li_desc->pname_count);
+		    i++) {
+			wwpn = be64_to_cpu(li_desc->pname_list[i]);
+			rport = fc_find_rport_by_wwpn(shost, wwpn);
+			if (rport &&
+			    (rport->roles & FC_PORT_ROLE_FCP_TARGET ||
+			    rport->roles & FC_PORT_ROLE_NVME_TARGET)) {
+				if (rport == attach_rport)
+					continue;
+				fc_li_stats_update(li_desc,
+						   &rport->fpin_stats);
+			}
+		}
+	}
+
+	if (fc_host->port_name == be64_to_cpu(li_desc->attached_wwpn))
+		fc_li_stats_update(li_desc, &fc_host->fpin_stats);
+}
+
+/*
+ * fc_fpin_delivery_stats_update - routine to update Delivery Notification
+ * event statistics.
+ * @shost:		host the FPIN was received on
+ * @tlv:		pointer to delivery descriptor
+ *
+ */
+static void
+fc_fpin_delivery_stats_update(struct Scsi_Host *shost,
+			      struct fc_tlv_desc *tlv)
+{
+	struct fc_rport *rport = NULL;
+	struct fc_rport *attach_rport = NULL;
+	struct fc_host_attrs *fc_host = shost_to_fc_host(shost);
+	struct fc_fn_deli_desc *dn_desc = (struct fc_fn_deli_desc *)tlv;
+	u32 reason_code = be32_to_cpu(dn_desc->deli_reason_code);
+
+	rport = fc_find_rport_by_wwpn(shost,
+				      be64_to_cpu(dn_desc->attached_wwpn));
+	if (rport &&
+	    (rport->roles & FC_PORT_ROLE_FCP_TARGET ||
+	     rport->roles & FC_PORT_ROLE_NVME_TARGET)) {
+		attach_rport = rport;
+		fc_delivery_stats_update(reason_code,
+					 &attach_rport->fpin_stats);
+	}
+
+	if (fc_host->port_name == be64_to_cpu(dn_desc->attached_wwpn))
+		fc_delivery_stats_update(reason_code, &fc_host->fpin_stats);
+}
+
+/*
+ * fc_fpin_peer_congn_stats_update - routine to update Peer Congestion
+ * event statistics.
+ * @shost:		host the FPIN was received on
+ * @tlv:		pointer to peer congestion descriptor
+ *
+ */
+static void
+fc_fpin_peer_congn_stats_update(struct Scsi_Host *shost,
+				struct fc_tlv_desc *tlv)
+{
+	u8 i;
+	struct fc_rport *rport = NULL;
+	struct fc_rport *attach_rport = NULL;
+	struct fc_fn_peer_congn_desc *pc_desc =
+	    (struct fc_fn_peer_congn_desc *)tlv;
+	u16 event_type = be16_to_cpu(pc_desc->event_type);
+	u64 wwpn;
+
+	rport = fc_find_rport_by_wwpn(shost,
+				      be64_to_cpu(pc_desc->attached_wwpn));
+	if (rport &&
+	    (rport->roles & FC_PORT_ROLE_FCP_TARGET ||
+	     rport->roles & FC_PORT_ROLE_NVME_TARGET)) {
+		attach_rport = rport;
+		fc_cn_stats_update(event_type, &attach_rport->fpin_stats);
+	}
+
+	if (be32_to_cpu(pc_desc->pname_count) > 0) {
+		for (i = 0;
+		    i < be32_to_cpu(pc_desc->pname_count);
+		    i++) {
+			wwpn = be64_to_cpu(pc_desc->pname_list[i]);
+			rport = fc_find_rport_by_wwpn(shost, wwpn);
+			if (rport &&
+			    (rport->roles & FC_PORT_ROLE_FCP_TARGET ||
+			     rport->roles & FC_PORT_ROLE_NVME_TARGET)) {
+				if (rport == attach_rport)
+					continue;
+				fc_cn_stats_update(event_type,
+						   &rport->fpin_stats);
+			}
+		}
+	}
+}
+
+/*
+ * fc_fpin_congn_stats_update - routine to update Congestion
+ * event statistics.
+ * @shost:		host the FPIN was received on
+ * @tlv:		pointer to congestion descriptor
+ *
+ */
+static void
+fc_fpin_congn_stats_update(struct Scsi_Host *shost,
+			   struct fc_tlv_desc *tlv)
+{
+	struct fc_host_attrs *fc_host = shost_to_fc_host(shost);
+	struct fc_fn_congn_desc *congn = (struct fc_fn_congn_desc *)tlv;
+
+	fc_cn_stats_update(be16_to_cpu(congn->event_type),
+			   &fc_host->fpin_stats);
+}
+
 /**
  * fc_host_rcv_fpin - routine to process a received FPIN.
  * @shost:		host the FPIN was received on
@@ -642,6 +903,38 @@ EXPORT_SYMBOL(fc_host_post_vendor_event);
 void
 fc_host_fpin_rcv(struct Scsi_Host *shost, u32 fpin_len, char *fpin_buf)
 {
+	struct fc_els_fpin *fpin = (struct fc_els_fpin *)fpin_buf;
+	struct fc_tlv_desc *tlv;
+	u32 desc_cnt = 0, bytes_remain;
+	u32 dtag;
+
+	/* Update Statistics */
+	tlv = (struct fc_tlv_desc *)&fpin->fpin_desc[0];
+	bytes_remain = fpin_len - offsetof(struct fc_els_fpin, fpin_desc);
+	bytes_remain = min_t(u32, bytes_remain, be32_to_cpu(fpin->desc_len));
+
+	while (bytes_remain >= FC_TLV_DESC_HDR_SZ &&
+	       bytes_remain >= FC_TLV_DESC_SZ_FROM_LENGTH(tlv)) {
+		dtag = be32_to_cpu(tlv->desc_tag);
+		switch (dtag) {
+		case ELS_DTAG_LNK_INTEGRITY:
+			fc_fpin_li_stats_update(shost, tlv);
+			break;
+		case ELS_DTAG_DELIVERY:
+			fc_fpin_delivery_stats_update(shost, tlv);
+			break;
+		case ELS_DTAG_PEER_CONGEST:
+			fc_fpin_peer_congn_stats_update(shost, tlv);
+			break;
+		case ELS_DTAG_CONGESTION:
+			fc_fpin_congn_stats_update(shost, tlv);
+		}
+
+		desc_cnt++;
+		bytes_remain -= FC_TLV_DESC_SZ_FROM_LENGTH(tlv);
+		tlv = fc_tlv_next_desc(tlv);
+	}
+
 	fc_host_post_fc_event(shost, fc_get_event_number(),
 				FCH_EVT_LINK_FPIN, fpin_len, fpin_buf, 0);
 }
diff --git a/include/scsi/scsi_transport_fc.h b/include/scsi/scsi_transport_fc.h
index 487a403ee51e..a636c1986e22 100644
--- a/include/scsi/scsi_transport_fc.h
+++ b/include/scsi/scsi_transport_fc.h
@@ -819,6 +819,7 @@ void fc_host_post_event(struct Scsi_Host *shost, u32 event_number,
 		enum fc_host_event_code event_code, u32 event_data);
 void fc_host_post_vendor_event(struct Scsi_Host *shost, u32 event_number,
 		u32 data_len, char *data_buf, u64 vendor_id);
+struct fc_rport *fc_find_rport_by_wwpn(struct Scsi_Host *shost, u64 wwpn);
 void fc_host_post_fc_event(struct Scsi_Host *shost, u32 event_number,
 		enum fc_host_event_code event_code,
 		u32 data_len, char *data_buf, u64 vendor_id);
-- 
2.19.0.rc0


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH v3 4/5] scsi: fc: Add mechanism to update FPIN signal statistics
  2020-10-21  9:27 [PATCH v3 0/5] SAN Congestion Management (SCM) statistics Nilesh Javali
                   ` (2 preceding siblings ...)
  2020-10-21  9:27 ` [PATCH v3 3/5] scsi: fc: Parse FPIN packets and update statistics Nilesh Javali
@ 2020-10-21  9:27 ` Nilesh Javali
  2020-10-21 14:56   ` Himanshu Madhani
  2020-10-21  9:27 ` [PATCH v3 5/5] scsi: fc: Update documentation of sysfs nodes for FPIN stats Nilesh Javali
                   ` (2 subsequent siblings)
  6 siblings, 1 reply; 15+ messages in thread
From: Nilesh Javali @ 2020-10-21  9:27 UTC (permalink / raw)
  To: martin.petersen; +Cc: linux-scsi, GR-QLogic-Storage-Upstream

From: Shyam Sundar <ssundar@marvell.com>

Add statistics for Congestion Signals that are delivered to the host as
interrupt signals, under fc_host_statistics.

Signed-off-by: Shyam Sundar <ssundar@marvell.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
Reviewed-by: James Smart <james.smart@broadcom.com>
---
 drivers/scsi/scsi_transport_fc.c | 5 +++++
 include/scsi/scsi_transport_fc.h | 3 +++
 2 files changed, 8 insertions(+)

diff --git a/drivers/scsi/scsi_transport_fc.c b/drivers/scsi/scsi_transport_fc.c
index 4dfa0e40d8e5..3f816ab1d845 100644
--- a/drivers/scsi/scsi_transport_fc.c
+++ b/drivers/scsi/scsi_transport_fc.c
@@ -2100,6 +2100,9 @@ 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);
+fc_host_statistic(cn_sig_warn);
+fc_host_statistic(cn_sig_alarm);
+
 
 #define fc_host_fpin_statistic(name)					\
 static ssize_t fc_host_fpinstat_##name(struct device *cd,		\
@@ -2182,6 +2185,8 @@ static struct attribute *fc_statistics_attrs[] = {
 	&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_cn_sig_warn.attr,
+	&device_attr_host_cn_sig_alarm.attr,
 	&device_attr_host_reset_statistics.attr,
 	&device_attr_host_fpin_dn.attr,
 	&device_attr_host_fpin_dn_unknown.attr,
diff --git a/include/scsi/scsi_transport_fc.h b/include/scsi/scsi_transport_fc.h
index a636c1986e22..c759b29e46c7 100644
--- a/include/scsi/scsi_transport_fc.h
+++ b/include/scsi/scsi_transport_fc.h
@@ -468,6 +468,9 @@ struct fc_host_statistics {
 	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 */
+	/* Host Congestion Signals */
+	u64 cn_sig_warn;
+	u64 cn_sig_alarm;
 };
 
 
-- 
2.19.0.rc0


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH v3 5/5] scsi: fc: Update documentation of sysfs nodes for FPIN stats
  2020-10-21  9:27 [PATCH v3 0/5] SAN Congestion Management (SCM) statistics Nilesh Javali
                   ` (3 preceding siblings ...)
  2020-10-21  9:27 ` [PATCH v3 4/5] scsi: fc: Add mechanism to update FPIN signal statistics Nilesh Javali
@ 2020-10-21  9:27 ` Nilesh Javali
  2020-10-21 14:57   ` Himanshu Madhani
  2020-10-26 22:07 ` [PATCH v3 0/5] SAN Congestion Management (SCM) statistics Martin K. Petersen
  2020-11-11  2:59 ` Martin K. Petersen
  6 siblings, 1 reply; 15+ messages in thread
From: Nilesh Javali @ 2020-10-21  9:27 UTC (permalink / raw)
  To: martin.petersen; +Cc: linux-scsi, GR-QLogic-Storage-Upstream

From: Shyam Sundar <ssundar@marvell.com>

Update documentation for sysfs nodes within,
       /sys/class/fc_host
       /sys/class/fc_remote_ports

Signed-off-by: Shyam Sundar <ssundar@marvell.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
Reviewed-by: James Smart <james.smart@broadcom.com>
---
 Documentation/ABI/testing/sysfs-class-fc_host | 23 +++++++++++++++++++
 .../ABI/testing/sysfs-class-fc_remote_ports   | 23 +++++++++++++++++++
 2 files changed, 46 insertions(+)
 create mode 100644 Documentation/ABI/testing/sysfs-class-fc_host
 create mode 100644 Documentation/ABI/testing/sysfs-class-fc_remote_ports

diff --git a/Documentation/ABI/testing/sysfs-class-fc_host b/Documentation/ABI/testing/sysfs-class-fc_host
new file mode 100644
index 000000000000..0a696cbd8232
--- /dev/null
+++ b/Documentation/ABI/testing/sysfs-class-fc_host
@@ -0,0 +1,23 @@
+What:		/sys/class/fc_host/hostX/statistics/fpin_cn_yyy
+Date:		July 2020
+Contact:	Shyam Sundar <ssundar@marvell.com>
+Description:
+		These files contain the number of congestion notification
+		events recorded by the F_Port, reported using fabric
+		performance impact notification (FPIN) event.
+
+What:		/sys/class/fc_host/hostX/statistics/fpin_li_yyy
+Date:		July 2020
+Contact:	Shyam Sundar <ssundar@marvell.com>
+Description:
+		These files contain the number of link integrity error
+		events recorded by the F_Port/Nx_Port, reported using fabric
+		performance impact notification (FPIN) event.
+
+What:		/sys/class/fc_host/hostX/statistics/fpin_dn_yyy
+Date:		July 2020
+Contact:	Shyam Sundar <ssundar@marvell.com>
+Description:
+		These files contain the number of delivery related errors
+		recorded by the F_Port/Nx_Port, reported using fabric
+		performance impact notification (FPIN) event.
diff --git a/Documentation/ABI/testing/sysfs-class-fc_remote_ports b/Documentation/ABI/testing/sysfs-class-fc_remote_ports
new file mode 100644
index 000000000000..55a951529e03
--- /dev/null
+++ b/Documentation/ABI/testing/sysfs-class-fc_remote_ports
@@ -0,0 +1,23 @@
+What:		/sys/class/fc_remote_ports/rport-X:Y-Z/statistics/fpin_cn_yyy
+Date:		July 2020
+Contact:	Shyam Sundar <ssundar@marvell.com>
+Description:
+		These files contain the number of congestion notification
+		events recorded by the F_Port/Nx_Port, reported using fabric
+		performance impact notification (FPIN) event.
+
+What:		/sys/class/fc_remote_ports/rport-X:Y-Z/statistics/fpin_li_yyy
+Date:		July 2020
+Contact:	Shyam Sundar <ssundar@marvell.com>
+Description:
+		These files contain the number of link integrity error
+		events recorded by the F_Port/Nx_Port, reported using fabric
+		performance impact notification (FPIN) event.
+
+What:		/sys/class/fc_remote_ports/rport-X:Y-Z/statistics/fpin_dn_yyy
+Date:		July 2020
+Contact:	Shyam Sundar <ssundar@marvell.com>
+Description:
+		These files contain the number of delivery related errors
+		recorded by the F_Port/Nx_Port, reported using fabric
+		performance impact notification (FPIN) event.
-- 
2.19.0.rc0


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* Re: [PATCH v3 1/5] scsi: fc: Update formal FPIN descriptor definitions
  2020-10-21  9:27 ` [PATCH v3 1/5] scsi: fc: Update formal FPIN descriptor definitions Nilesh Javali
@ 2020-10-21 14:46   ` Himanshu Madhani
  0 siblings, 0 replies; 15+ messages in thread
From: Himanshu Madhani @ 2020-10-21 14:46 UTC (permalink / raw)
  To: Nilesh Javali; +Cc: Martin K . Petersen, linux-scsi, GR-QLogic-Storage-Upstream



> On Oct 21, 2020, at 4:27 AM, Nilesh Javali <njavali@marvell.com> wrote:
> 
> From: Shyam Sundar <ssundar@marvell.com>
> 
> Add Fabric Performance Impact Notification (FPIN) descriptor definition
> for the following FPINs:
> Delivery Notification Descriptor
> Peer Congestion Notification Descriptor
> Congestion Notification Descriptor
> 
> Signed-off-by: Shyam Sundar <ssundar@marvell.com>
> Signed-off-by: Nilesh Javali <njavali@marvell.com>
> Reviewed-by: James Smart <james.smart@broadcom.com>
> ---
> include/uapi/scsi/fc/fc_els.h | 114 +++++++++++++++++++++++++++++++++-
> 1 file changed, 113 insertions(+), 1 deletion(-)
> 
> diff --git a/include/uapi/scsi/fc/fc_els.h b/include/uapi/scsi/fc/fc_els.h
> index 8c704e510e39..91d4be987220 100644
> --- a/include/uapi/scsi/fc/fc_els.h
> +++ b/include/uapi/scsi/fc/fc_els.h
> @@ -916,7 +916,9 @@ enum fc_els_clid_ic {
> 	ELS_CLID_IC_LIP =	8,	/* receiving LIP */
> };
> 
> -
> +/*
> + * Link Integrity event types
> + */
> enum fc_fpin_li_event_types {
> 	FPIN_LI_UNKNOWN =		0x0,
> 	FPIN_LI_LINK_FAILURE =		0x1,
> @@ -943,6 +945,54 @@ enum fc_fpin_li_event_types {
> 	{ FPIN_LI_DEVICE_SPEC,		"Device Specific" },		\
> }
> 
> +/*
> + * Delivery event types
> + */
> +enum fc_fpin_deli_event_types {
> +	FPIN_DELI_UNKNOWN =		0x0,
> +	FPIN_DELI_TIMEOUT =		0x1,
> +	FPIN_DELI_UNABLE_TO_ROUTE =	0x2,
> +	FPIN_DELI_DEVICE_SPEC =		0xF,
> +};
> +
> +/*
> + * Initializer useful for decoding table.
> + * Please keep this in sync with the above definitions.
> + */
> +#define FC_FPIN_DELI_EVT_TYPES_INIT {					\
> +	{ FPIN_DELI_UNKNOWN,		"Unknown" },			\
> +	{ FPIN_DELI_TIMEOUT,		"Timeout" },			\
> +	{ FPIN_DELI_UNABLE_TO_ROUTE,	"Unable to Route" },		\
> +	{ FPIN_DELI_DEVICE_SPEC,	"Device Specific" },		\
> +}
> +
> +/*
> + * Congestion event types
> + */
> +enum fc_fpin_congn_event_types {
> +	FPIN_CONGN_CLEAR =		0x0,
> +	FPIN_CONGN_LOST_CREDIT =	0x1,
> +	FPIN_CONGN_CREDIT_STALL =	0x2,
> +	FPIN_CONGN_OVERSUBSCRIPTION =	0x3,
> +	FPIN_CONGN_DEVICE_SPEC =	0xF,
> +};
> +
> +/*
> + * Initializer useful for decoding table.
> + * Please keep this in sync with the above definitions.
> + */
> +#define FC_FPIN_CONGN_EVT_TYPES_INIT {					\
> +	{ FPIN_CONGN_CLEAR,		"Clear" },			\
> +	{ FPIN_CONGN_LOST_CREDIT,	"Lost Credit" },		\
> +	{ FPIN_CONGN_CREDIT_STALL,	"Credit Stall" },		\
> +	{ FPIN_CONGN_OVERSUBSCRIPTION,	"Oversubscription" },		\
> +	{ FPIN_CONGN_DEVICE_SPEC,	"Device Specific" },		\
> +}
> +
> +enum fc_fpin_congn_severity_types {
> +	FPIN_CONGN_SEVERITY_WARNING =	0xF1,
> +	FPIN_CONGN_SEVERITY_ERROR =	0xF7,
> +};
> 
> /*
>  * Link Integrity Notification Descriptor
> @@ -974,6 +1024,68 @@ struct fc_fn_li_desc {
> 					 */
> };
> 
> +/*
> + * Delivery Notification Descriptor
> + */
> +struct fc_fn_deli_desc {
> +	__be32		desc_tag;	/* Descriptor Tag (0x00020002) */
> +	__be32		desc_len;	/* Length of Descriptor (in bytes).
> +					 * Size of descriptor excluding
> +					 * desc_tag and desc_len fields.
> +					 */
> +	__be64		detecting_wwpn;	/* Port Name that detected event */
> +	__be64		attached_wwpn;	/* Port Name of device attached to
> +					 * detecting Port Name
> +					 */
> +	__be32		deli_reason_code;/* see enum fc_fpin_deli_event_types */
> +};
> +
> +/*
> + * Peer Congestion Notification Descriptor
> + */
> +struct fc_fn_peer_congn_desc {
> +	__be32		desc_tag;	/* Descriptor Tag (0x00020003) */
> +	__be32		desc_len;	/* Length of Descriptor (in bytes).
> +					 * Size of descriptor excluding
> +					 * desc_tag and desc_len fields.
> +					 */
> +	__be64		detecting_wwpn;	/* Port Name that detected event */
> +	__be64		attached_wwpn;	/* Port Name of device attached to
> +					 * detecting Port Name
> +					 */
> +	__be16		event_type;	/* see enum fc_fpin_congn_event_types */
> +	__be16		event_modifier;	/* Implementation specific value
> +					 * describing the event type
> +					 */
> +	__be32		event_period;	/* duration (ms) of the detected
> +					 * congestion event
> +					 */
> +	__be32		pname_count;	/* number of portname_list elements */
> +	__be64		pname_list[0];	/* list of N_Port_Names accessible
> +					 * through the attached port
> +					 */
> +};
> +
> +/*
> + * Congestion Notification Descriptor
> + */
> +struct fc_fn_congn_desc {
> +	__be32		desc_tag;	/* Descriptor Tag (0x00020004) */
> +	__be32		desc_len;	/* Length of Descriptor (in bytes).
> +					 * Size of descriptor excluding
> +					 * desc_tag and desc_len fields.
> +					 */
> +	__be16		event_type;	/* see enum fc_fpin_congn_event_types */
> +	__be16		event_modifier;	/* Implementation specific value
> +					 * describing the event type
> +					 */
> +	__be32		event_period;	/* duration (ms) of the detected
> +					 * congestion event
> +					 */
> +	__u8		severity;	/* command */
> +	__u8		resv[3];	/* reserved - must be zero */
> +};
> +
> /*
>  * ELS_FPIN - Fabric Performance Impact Notification
>  */
> -- 
> 2.19.0.rc0
> 

Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>

--
Himanshu Madhani	 Oracle Linux Engineering


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH v3 2/5] scsi: fc: Add FPIN statistics to fc_host and fc_rport objects
  2020-10-21  9:27 ` [PATCH v3 2/5] scsi: fc: Add FPIN statistics to fc_host and fc_rport objects Nilesh Javali
@ 2020-10-21 14:47   ` Himanshu Madhani
  0 siblings, 0 replies; 15+ messages in thread
From: Himanshu Madhani @ 2020-10-21 14:47 UTC (permalink / raw)
  To: Nilesh Javali; +Cc: Martin K . Petersen, linux-scsi, GR-QLogic-Storage-Upstream



> On Oct 21, 2020, at 4:27 AM, Nilesh Javali <njavali@marvell.com> wrote:
> 
> From: Shyam Sundar <ssundar@marvell.com>
> 
> - Adds a structure for holding fpin stats for host & rport
> 
> - Adds sysfs nodes to maintain FPIN stats:
>        /sys/class/fc_host/hostXX/statistics/
>        /sys/class/fc_remote_ports/rport-XX\:Y-Z/statistics/
> 
> Signed-off-by: Shyam Sundar <ssundar@marvell.com>
> Signed-off-by: Nilesh Javali <njavali@marvell.com>
> Reviewed-by: James Smart <james.smart@broadcom.com>
> ---
> drivers/scsi/scsi_transport_fc.c | 117 +++++++++++++++++++++++++++++++
> include/scsi/scsi_transport_fc.h |  32 +++++++++
> 2 files changed, 149 insertions(+)
> 
> diff --git a/drivers/scsi/scsi_transport_fc.c b/drivers/scsi/scsi_transport_fc.c
> index 2ff7f06203da..501e165ae6f1 100644
> --- a/drivers/scsi/scsi_transport_fc.c
> +++ b/drivers/scsi/scsi_transport_fc.c
> @@ -22,6 +22,7 @@
> #include <net/netlink.h>
> #include <scsi/scsi_netlink_fc.h>
> #include <scsi/scsi_bsg_fc.h>
> +#include <uapi/scsi/fc/fc_els.h>
> #include "scsi_priv.h"
> 
> static int fc_queue_work(struct Scsi_Host *, struct work_struct *);
> @@ -419,6 +420,7 @@ static int fc_host_setup(struct transport_container *tc, struct device *dev,
> 	fc_host->fabric_name = -1;
> 	memset(fc_host->symbolic_name, 0, sizeof(fc_host->symbolic_name));
> 	memset(fc_host->system_hostname, 0, sizeof(fc_host->system_hostname));
> +	memset(&fc_host->fpin_stats, 0, sizeof(fc_host->fpin_stats));
> 
> 	fc_host->tgtid_bind_type = FC_TGTID_BIND_BY_WWPN;
> 
> @@ -991,6 +993,67 @@ store_fc_rport_fast_io_fail_tmo(struct device *dev,
> static FC_DEVICE_ATTR(rport, fast_io_fail_tmo, S_IRUGO | S_IWUSR,
> 	show_fc_rport_fast_io_fail_tmo, store_fc_rport_fast_io_fail_tmo);
> 
> +#define fc_rport_fpin_statistic(name)					\
> +static ssize_t fc_rport_fpinstat_##name(struct device *cd,		\
> +				  struct device_attribute *attr,	\
> +				  char *buf)				\
> +{									\
> +	struct fc_rport *rport = transport_class_to_rport(cd);		\
> +									\
> +	return snprintf(buf, 20, "0x%llx\n", rport->fpin_stats.name);	\
> +}									\
> +static FC_DEVICE_ATTR(rport, fpin_##name, 0444, fc_rport_fpinstat_##name, NULL)
> +
> +fc_rport_fpin_statistic(dn);
> +fc_rport_fpin_statistic(dn_unknown);
> +fc_rport_fpin_statistic(dn_timeout);
> +fc_rport_fpin_statistic(dn_unable_to_route);
> +fc_rport_fpin_statistic(dn_device_specific);
> +fc_rport_fpin_statistic(cn);
> +fc_rport_fpin_statistic(cn_clear);
> +fc_rport_fpin_statistic(cn_lost_credit);
> +fc_rport_fpin_statistic(cn_credit_stall);
> +fc_rport_fpin_statistic(cn_oversubscription);
> +fc_rport_fpin_statistic(cn_device_specific);
> +fc_rport_fpin_statistic(li);
> +fc_rport_fpin_statistic(li_failure_unknown);
> +fc_rport_fpin_statistic(li_link_failure_count);
> +fc_rport_fpin_statistic(li_loss_of_sync_count);
> +fc_rport_fpin_statistic(li_loss_of_signals_count);
> +fc_rport_fpin_statistic(li_prim_seq_err_count);
> +fc_rport_fpin_statistic(li_invalid_tx_word_count);
> +fc_rport_fpin_statistic(li_invalid_crc_count);
> +fc_rport_fpin_statistic(li_device_specific);
> +
> +static struct attribute *fc_rport_statistics_attrs[] = {
> +	&device_attr_rport_fpin_dn.attr,
> +	&device_attr_rport_fpin_dn_unknown.attr,
> +	&device_attr_rport_fpin_dn_timeout.attr,
> +	&device_attr_rport_fpin_dn_unable_to_route.attr,
> +	&device_attr_rport_fpin_dn_device_specific.attr,
> +	&device_attr_rport_fpin_li.attr,
> +	&device_attr_rport_fpin_li_failure_unknown.attr,
> +	&device_attr_rport_fpin_li_link_failure_count.attr,
> +	&device_attr_rport_fpin_li_loss_of_sync_count.attr,
> +	&device_attr_rport_fpin_li_loss_of_signals_count.attr,
> +	&device_attr_rport_fpin_li_prim_seq_err_count.attr,
> +	&device_attr_rport_fpin_li_invalid_tx_word_count.attr,
> +	&device_attr_rport_fpin_li_invalid_crc_count.attr,
> +	&device_attr_rport_fpin_li_device_specific.attr,
> +	&device_attr_rport_fpin_cn.attr,
> +	&device_attr_rport_fpin_cn_clear.attr,
> +	&device_attr_rport_fpin_cn_lost_credit.attr,
> +	&device_attr_rport_fpin_cn_credit_stall.attr,
> +	&device_attr_rport_fpin_cn_oversubscription.attr,
> +	&device_attr_rport_fpin_cn_device_specific.attr,
> +	NULL
> +};
> +
> +static struct attribute_group fc_rport_statistics_group = {
> +	.name = "statistics",
> +	.attrs = fc_rport_statistics_attrs,
> +};
> +
> 
> /*
>  * FC SCSI Target Attribute Management
> @@ -1745,6 +1808,39 @@ fc_host_statistic(fc_xid_busy);
> fc_host_statistic(fc_seq_not_found);
> fc_host_statistic(fc_non_bls_resp);
> 
> +#define fc_host_fpin_statistic(name)					\
> +static ssize_t fc_host_fpinstat_##name(struct device *cd,		\
> +				  struct device_attribute *attr,	\
> +				  char *buf)				\
> +{									\
> +	struct Scsi_Host *shost = transport_class_to_shost(cd);		\
> +	struct fc_host_attrs *fc_host = shost_to_fc_host(shost);	\
> +									\
> +	return snprintf(buf, 20, "0x%llx\n", fc_host->fpin_stats.name);	\
> +}									\
> +static FC_DEVICE_ATTR(host, fpin_##name, 0444, fc_host_fpinstat_##name, NULL)
> +
> +fc_host_fpin_statistic(dn);
> +fc_host_fpin_statistic(dn_unknown);
> +fc_host_fpin_statistic(dn_timeout);
> +fc_host_fpin_statistic(dn_unable_to_route);
> +fc_host_fpin_statistic(dn_device_specific);
> +fc_host_fpin_statistic(cn);
> +fc_host_fpin_statistic(cn_clear);
> +fc_host_fpin_statistic(cn_lost_credit);
> +fc_host_fpin_statistic(cn_credit_stall);
> +fc_host_fpin_statistic(cn_oversubscription);
> +fc_host_fpin_statistic(cn_device_specific);
> +fc_host_fpin_statistic(li);
> +fc_host_fpin_statistic(li_failure_unknown);
> +fc_host_fpin_statistic(li_link_failure_count);
> +fc_host_fpin_statistic(li_loss_of_sync_count);
> +fc_host_fpin_statistic(li_loss_of_signals_count);
> +fc_host_fpin_statistic(li_prim_seq_err_count);
> +fc_host_fpin_statistic(li_invalid_tx_word_count);
> +fc_host_fpin_statistic(li_invalid_crc_count);
> +fc_host_fpin_statistic(li_device_specific);
> +
> static ssize_t
> fc_reset_statistics(struct device *dev, struct device_attribute *attr,
> 		    const char *buf, size_t count)
> @@ -1794,6 +1890,26 @@ static struct attribute *fc_statistics_attrs[] = {
> 	&device_attr_host_fc_seq_not_found.attr,
> 	&device_attr_host_fc_non_bls_resp.attr,
> 	&device_attr_host_reset_statistics.attr,
> +	&device_attr_host_fpin_dn.attr,
> +	&device_attr_host_fpin_dn_unknown.attr,
> +	&device_attr_host_fpin_dn_timeout.attr,
> +	&device_attr_host_fpin_dn_unable_to_route.attr,
> +	&device_attr_host_fpin_dn_device_specific.attr,
> +	&device_attr_host_fpin_li.attr,
> +	&device_attr_host_fpin_li_failure_unknown.attr,
> +	&device_attr_host_fpin_li_link_failure_count.attr,
> +	&device_attr_host_fpin_li_loss_of_sync_count.attr,
> +	&device_attr_host_fpin_li_loss_of_signals_count.attr,
> +	&device_attr_host_fpin_li_prim_seq_err_count.attr,
> +	&device_attr_host_fpin_li_invalid_tx_word_count.attr,
> +	&device_attr_host_fpin_li_invalid_crc_count.attr,
> +	&device_attr_host_fpin_li_device_specific.attr,
> +	&device_attr_host_fpin_cn.attr,
> +	&device_attr_host_fpin_cn_clear.attr,
> +	&device_attr_host_fpin_cn_lost_credit.attr,
> +	&device_attr_host_fpin_cn_credit_stall.attr,
> +	&device_attr_host_fpin_cn_oversubscription.attr,
> +	&device_attr_host_fpin_cn_device_specific.attr,
> 	NULL
> };
> 
> @@ -2177,6 +2293,7 @@ fc_attach_transport(struct fc_function_template *ft)
> 	i->rport_attr_cont.ac.attrs = &i->rport_attrs[0];
> 	i->rport_attr_cont.ac.class = &fc_rport_class.class;
> 	i->rport_attr_cont.ac.match = fc_rport_match;
> +	i->rport_attr_cont.statistics = &fc_rport_statistics_group;
> 	transport_container_register(&i->rport_attr_cont);
> 
> 	i->vport_attr_cont.ac.attrs = &i->vport_attrs[0];
> 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;
> -- 
> 2.19.0.rc0
> 

Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>

--
Himanshu Madhani	 Oracle Linux Engineering


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH v3 3/5] scsi: fc: Parse FPIN packets and update statistics
  2020-10-21  9:27 ` [PATCH v3 3/5] scsi: fc: Parse FPIN packets and update statistics Nilesh Javali
@ 2020-10-21 14:55   ` Himanshu Madhani
  2020-10-21 17:49   ` James Smart
  2021-05-28 21:49   ` scsi_transport_fc: FPIN LI statistics James Smart
  2 siblings, 0 replies; 15+ messages in thread
From: Himanshu Madhani @ 2020-10-21 14:55 UTC (permalink / raw)
  To: Nilesh Javali; +Cc: Martin K . Petersen, linux-scsi, GR-QLogic-Storage-Upstream



> On Oct 21, 2020, at 4:27 AM, Nilesh Javali <njavali@marvell.com> wrote:
> 
> From: Shyam Sundar <ssundar@marvell.com>
> 
> Parse the incoming FPIN packets and update the host and rport FPIN
> statistics based on the FPINs.
> 
> Signed-off-by: Shyam Sundar <ssundar@marvell.com>
> Signed-off-by: Nilesh Javali <njavali@marvell.com>
> ---
> drivers/scsi/scsi_transport_fc.c | 293 +++++++++++++++++++++++++++++++
> include/scsi/scsi_transport_fc.h |   1 +
> 2 files changed, 294 insertions(+)
> 
> diff --git a/drivers/scsi/scsi_transport_fc.c b/drivers/scsi/scsi_transport_fc.c
> index 501e165ae6f1..4dfa0e40d8e5 100644
> --- a/drivers/scsi/scsi_transport_fc.c
> +++ b/drivers/scsi/scsi_transport_fc.c
> @@ -34,6 +34,11 @@ static int fc_bsg_hostadd(struct Scsi_Host *, struct fc_host_attrs *);
> static int fc_bsg_rportadd(struct Scsi_Host *, struct fc_rport *);
> static void fc_bsg_remove(struct request_queue *);
> static void fc_bsg_goose_queue(struct fc_rport *);
> +static void fc_li_stats_update(struct fc_fn_li_desc *li_desc,
> +			       struct fc_fpin_stats *stats);
> +static void fc_delivery_stats_update(u32 reason_code,
> +				     struct fc_fpin_stats *stats);
> +static void fc_cn_stats_update(u16 event_type, struct fc_fpin_stats *stats);
> 
> /*
>  * Module Parameters
> @@ -630,6 +635,262 @@ fc_host_post_vendor_event(struct Scsi_Host *shost, u32 event_number,
> }
> EXPORT_SYMBOL(fc_host_post_vendor_event);
> 
> +/**
> + * fc_find_rport_by_wwpn - find the fc_rport pointer for a given wwpn
> + * @shost:		host the fc_rport is associated with
> + * @wwpn:		wwpn of the fc_rport device
> + *
> + * Notes:
> + *	This routine assumes no locks are held on entry.
> + */
> +struct fc_rport *
> +fc_find_rport_by_wwpn(struct Scsi_Host *shost, u64 wwpn)
> +{
> +	struct fc_rport *rport;
> +	unsigned long flags;
> +
> +	spin_lock_irqsave(shost->host_lock, flags);
> +
> +	list_for_each_entry(rport, &fc_host_rports(shost), peers) {
> +		if (rport->port_state != FC_PORTSTATE_ONLINE)
> +			continue;
> +
> +		if (rport->port_name == wwpn) {
> +			spin_unlock_irqrestore(shost->host_lock, flags);
> +			return rport;
> +		}
> +	}
> +
> +	spin_unlock_irqrestore(shost->host_lock, flags);
> +	return NULL;
> +}
> +EXPORT_SYMBOL(fc_find_rport_by_wwpn);
> +
> +static void
> +fc_li_stats_update(struct fc_fn_li_desc *li_desc,
> +		   struct fc_fpin_stats *stats)
> +{
> +	stats->li += be32_to_cpu(li_desc->event_count);
> +	switch (be16_to_cpu(li_desc->event_type)) {
> +	case FPIN_LI_UNKNOWN:
> +		stats->li_failure_unknown +=
> +		    be32_to_cpu(li_desc->event_count);
> +		break;
> +	case FPIN_LI_LINK_FAILURE:
> +		stats->li_link_failure_count +=
> +		    be32_to_cpu(li_desc->event_count);
> +		break;
> +	case FPIN_LI_LOSS_OF_SYNC:
> +		stats->li_loss_of_sync_count +=
> +		    be32_to_cpu(li_desc->event_count);
> +		break;
> +	case FPIN_LI_LOSS_OF_SIG:
> +		stats->li_loss_of_signals_count +=
> +		    be32_to_cpu(li_desc->event_count);
> +		break;
> +	case FPIN_LI_PRIM_SEQ_ERR:
> +		stats->li_prim_seq_err_count +=
> +		    be32_to_cpu(li_desc->event_count);
> +		break;
> +	case FPIN_LI_INVALID_TX_WD:
> +		stats->li_invalid_tx_word_count +=
> +		    be32_to_cpu(li_desc->event_count);
> +		break;
> +	case FPIN_LI_INVALID_CRC:
> +		stats->li_invalid_crc_count +=
> +		    be32_to_cpu(li_desc->event_count);
> +		break;
> +	case FPIN_LI_DEVICE_SPEC:
> +		stats->li_device_specific +=
> +		    be32_to_cpu(li_desc->event_count);
> +		break;
> +	}
> +}
> +
> +static void
> +fc_delivery_stats_update(u32 reason_code, struct fc_fpin_stats *stats)
> +{
> +	stats->dn++;
> +	switch (reason_code) {
> +	case FPIN_DELI_UNKNOWN:
> +		stats->dn_unknown++;
> +		break;
> +	case FPIN_DELI_TIMEOUT:
> +		stats->dn_timeout++;
> +		break;
> +	case FPIN_DELI_UNABLE_TO_ROUTE:
> +		stats->dn_unable_to_route++;
> +		break;
> +	case FPIN_DELI_DEVICE_SPEC:
> +		stats->dn_device_specific++;
> +		break;
> +	}
> +}
> +
> +static void
> +fc_cn_stats_update(u16 event_type, struct fc_fpin_stats *stats)
> +{
> +	stats->cn++;
> +	switch (event_type) {
> +	case FPIN_CONGN_CLEAR:
> +		stats->cn_clear++;
> +		break;
> +	case FPIN_CONGN_LOST_CREDIT:
> +		stats->cn_lost_credit++;
> +		break;
> +	case FPIN_CONGN_CREDIT_STALL:
> +		stats->cn_credit_stall++;
> +		break;
> +	case FPIN_CONGN_OVERSUBSCRIPTION:
> +		stats->cn_oversubscription++;
> +		break;
> +	case FPIN_CONGN_DEVICE_SPEC:
> +		stats->cn_device_specific++;
> +	}
> +}
> +
> +/*
> + * fc_fpin_li_stats_update - routine to update Link Integrity
> + * event statistics.
> + * @shost:		host the FPIN was received on
> + * @tlv:		pointer to link integrity descriptor
> + *
> + */
> +static void
> +fc_fpin_li_stats_update(struct Scsi_Host *shost, struct fc_tlv_desc *tlv)
> +{
> +	u8 i;
> +	struct fc_rport *rport = NULL;
> +	struct fc_rport *attach_rport = NULL;
> +	struct fc_host_attrs *fc_host = shost_to_fc_host(shost);
> +	struct fc_fn_li_desc *li_desc = (struct fc_fn_li_desc *)tlv;
> +	u64 wwpn;
> +
> +	rport = fc_find_rport_by_wwpn(shost,
> +				      be64_to_cpu(li_desc->attached_wwpn));
> +	if (rport &&
> +	    (rport->roles & FC_PORT_ROLE_FCP_TARGET ||
> +	     rport->roles & FC_PORT_ROLE_NVME_TARGET)) {
> +		attach_rport = rport;
> +		fc_li_stats_update(li_desc, &attach_rport->fpin_stats);
> +	}
> +
> +	if (be32_to_cpu(li_desc->pname_count) > 0) {
> +		for (i = 0;
> +		    i < be32_to_cpu(li_desc->pname_count);
> +		    i++) {
> +			wwpn = be64_to_cpu(li_desc->pname_list[i]);
> +			rport = fc_find_rport_by_wwpn(shost, wwpn);
> +			if (rport &&
> +			    (rport->roles & FC_PORT_ROLE_FCP_TARGET ||
> +			    rport->roles & FC_PORT_ROLE_NVME_TARGET)) {
> +				if (rport == attach_rport)
> +					continue;
> +				fc_li_stats_update(li_desc,
> +						   &rport->fpin_stats);
> +			}
> +		}
> +	}
> +
> +	if (fc_host->port_name == be64_to_cpu(li_desc->attached_wwpn))
> +		fc_li_stats_update(li_desc, &fc_host->fpin_stats);
> +}
> +
> +/*
> + * fc_fpin_delivery_stats_update - routine to update Delivery Notification
> + * event statistics.
> + * @shost:		host the FPIN was received on
> + * @tlv:		pointer to delivery descriptor
> + *
> + */
> +static void
> +fc_fpin_delivery_stats_update(struct Scsi_Host *shost,
> +			      struct fc_tlv_desc *tlv)
> +{
> +	struct fc_rport *rport = NULL;
> +	struct fc_rport *attach_rport = NULL;
> +	struct fc_host_attrs *fc_host = shost_to_fc_host(shost);
> +	struct fc_fn_deli_desc *dn_desc = (struct fc_fn_deli_desc *)tlv;
> +	u32 reason_code = be32_to_cpu(dn_desc->deli_reason_code);
> +
> +	rport = fc_find_rport_by_wwpn(shost,
> +				      be64_to_cpu(dn_desc->attached_wwpn));
> +	if (rport &&
> +	    (rport->roles & FC_PORT_ROLE_FCP_TARGET ||
> +	     rport->roles & FC_PORT_ROLE_NVME_TARGET)) {
> +		attach_rport = rport;
> +		fc_delivery_stats_update(reason_code,
> +					 &attach_rport->fpin_stats);
> +	}
> +
> +	if (fc_host->port_name == be64_to_cpu(dn_desc->attached_wwpn))
> +		fc_delivery_stats_update(reason_code, &fc_host->fpin_stats);
> +}
> +
> +/*
> + * fc_fpin_peer_congn_stats_update - routine to update Peer Congestion
> + * event statistics.
> + * @shost:		host the FPIN was received on
> + * @tlv:		pointer to peer congestion descriptor
> + *
> + */
> +static void
> +fc_fpin_peer_congn_stats_update(struct Scsi_Host *shost,
> +				struct fc_tlv_desc *tlv)
> +{
> +	u8 i;
> +	struct fc_rport *rport = NULL;
> +	struct fc_rport *attach_rport = NULL;
> +	struct fc_fn_peer_congn_desc *pc_desc =
> +	    (struct fc_fn_peer_congn_desc *)tlv;
> +	u16 event_type = be16_to_cpu(pc_desc->event_type);
> +	u64 wwpn;
> +
> +	rport = fc_find_rport_by_wwpn(shost,
> +				      be64_to_cpu(pc_desc->attached_wwpn));
> +	if (rport &&
> +	    (rport->roles & FC_PORT_ROLE_FCP_TARGET ||
> +	     rport->roles & FC_PORT_ROLE_NVME_TARGET)) {
> +		attach_rport = rport;
> +		fc_cn_stats_update(event_type, &attach_rport->fpin_stats);
> +	}
> +
> +	if (be32_to_cpu(pc_desc->pname_count) > 0) {
> +		for (i = 0;
> +		    i < be32_to_cpu(pc_desc->pname_count);
> +		    i++) {
> +			wwpn = be64_to_cpu(pc_desc->pname_list[i]);
> +			rport = fc_find_rport_by_wwpn(shost, wwpn);
> +			if (rport &&
> +			    (rport->roles & FC_PORT_ROLE_FCP_TARGET ||
> +			     rport->roles & FC_PORT_ROLE_NVME_TARGET)) {
> +				if (rport == attach_rport)
> +					continue;
> +				fc_cn_stats_update(event_type,
> +						   &rport->fpin_stats);
> +			}
> +		}
> +	}
> +}
> +
> +/*
> + * fc_fpin_congn_stats_update - routine to update Congestion
> + * event statistics.
> + * @shost:		host the FPIN was received on
> + * @tlv:		pointer to congestion descriptor
> + *
> + */
> +static void
> +fc_fpin_congn_stats_update(struct Scsi_Host *shost,
> +			   struct fc_tlv_desc *tlv)
> +{
> +	struct fc_host_attrs *fc_host = shost_to_fc_host(shost);
> +	struct fc_fn_congn_desc *congn = (struct fc_fn_congn_desc *)tlv;
> +
> +	fc_cn_stats_update(be16_to_cpu(congn->event_type),
> +			   &fc_host->fpin_stats);
> +}
> +
> /**
>  * fc_host_rcv_fpin - routine to process a received FPIN.
>  * @shost:		host the FPIN was received on
> @@ -642,6 +903,38 @@ EXPORT_SYMBOL(fc_host_post_vendor_event);
> void
> fc_host_fpin_rcv(struct Scsi_Host *shost, u32 fpin_len, char *fpin_buf)
> {
> +	struct fc_els_fpin *fpin = (struct fc_els_fpin *)fpin_buf;
> +	struct fc_tlv_desc *tlv;
> +	u32 desc_cnt = 0, bytes_remain;
> +	u32 dtag;
> +
> +	/* Update Statistics */
> +	tlv = (struct fc_tlv_desc *)&fpin->fpin_desc[0];
> +	bytes_remain = fpin_len - offsetof(struct fc_els_fpin, fpin_desc);
> +	bytes_remain = min_t(u32, bytes_remain, be32_to_cpu(fpin->desc_len));
> +
> +	while (bytes_remain >= FC_TLV_DESC_HDR_SZ &&
> +	       bytes_remain >= FC_TLV_DESC_SZ_FROM_LENGTH(tlv)) {
> +		dtag = be32_to_cpu(tlv->desc_tag);
> +		switch (dtag) {
> +		case ELS_DTAG_LNK_INTEGRITY:
> +			fc_fpin_li_stats_update(shost, tlv);
> +			break;
> +		case ELS_DTAG_DELIVERY:
> +			fc_fpin_delivery_stats_update(shost, tlv);
> +			break;
> +		case ELS_DTAG_PEER_CONGEST:
> +			fc_fpin_peer_congn_stats_update(shost, tlv);
> +			break;
> +		case ELS_DTAG_CONGESTION:
> +			fc_fpin_congn_stats_update(shost, tlv);
> +		}
> +
> +		desc_cnt++;
> +		bytes_remain -= FC_TLV_DESC_SZ_FROM_LENGTH(tlv);
> +		tlv = fc_tlv_next_desc(tlv);
> +	}
> +
> 	fc_host_post_fc_event(shost, fc_get_event_number(),
> 				FCH_EVT_LINK_FPIN, fpin_len, fpin_buf, 0);
> }
> diff --git a/include/scsi/scsi_transport_fc.h b/include/scsi/scsi_transport_fc.h
> index 487a403ee51e..a636c1986e22 100644
> --- a/include/scsi/scsi_transport_fc.h
> +++ b/include/scsi/scsi_transport_fc.h
> @@ -819,6 +819,7 @@ void fc_host_post_event(struct Scsi_Host *shost, u32 event_number,
> 		enum fc_host_event_code event_code, u32 event_data);
> void fc_host_post_vendor_event(struct Scsi_Host *shost, u32 event_number,
> 		u32 data_len, char *data_buf, u64 vendor_id);
> +struct fc_rport *fc_find_rport_by_wwpn(struct Scsi_Host *shost, u64 wwpn);
> void fc_host_post_fc_event(struct Scsi_Host *shost, u32 event_number,
> 		enum fc_host_event_code event_code,
> 		u32 data_len, char *data_buf, u64 vendor_id);
> -- 
> 2.19.0.rc0
> 

Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>

--
Himanshu Madhani	 Oracle Linux Engineering


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH v3 4/5] scsi: fc: Add mechanism to update FPIN signal statistics
  2020-10-21  9:27 ` [PATCH v3 4/5] scsi: fc: Add mechanism to update FPIN signal statistics Nilesh Javali
@ 2020-10-21 14:56   ` Himanshu Madhani
  0 siblings, 0 replies; 15+ messages in thread
From: Himanshu Madhani @ 2020-10-21 14:56 UTC (permalink / raw)
  To: Nilesh Javali; +Cc: Martin K . Petersen, linux-scsi, GR-QLogic-Storage-Upstream



> On Oct 21, 2020, at 4:27 AM, Nilesh Javali <njavali@marvell.com> wrote:
> 
> From: Shyam Sundar <ssundar@marvell.com>
> 
> Add statistics for Congestion Signals that are delivered to the host as
> interrupt signals, under fc_host_statistics.
> 
> Signed-off-by: Shyam Sundar <ssundar@marvell.com>
> Signed-off-by: Nilesh Javali <njavali@marvell.com>
> Reviewed-by: James Smart <james.smart@broadcom.com>
> ---
> drivers/scsi/scsi_transport_fc.c | 5 +++++
> include/scsi/scsi_transport_fc.h | 3 +++
> 2 files changed, 8 insertions(+)
> 
> diff --git a/drivers/scsi/scsi_transport_fc.c b/drivers/scsi/scsi_transport_fc.c
> index 4dfa0e40d8e5..3f816ab1d845 100644
> --- a/drivers/scsi/scsi_transport_fc.c
> +++ b/drivers/scsi/scsi_transport_fc.c
> @@ -2100,6 +2100,9 @@ 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);
> +fc_host_statistic(cn_sig_warn);
> +fc_host_statistic(cn_sig_alarm);
> +
> 
> #define fc_host_fpin_statistic(name)					\
> static ssize_t fc_host_fpinstat_##name(struct device *cd,		\
> @@ -2182,6 +2185,8 @@ static struct attribute *fc_statistics_attrs[] = {
> 	&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_cn_sig_warn.attr,
> +	&device_attr_host_cn_sig_alarm.attr,
> 	&device_attr_host_reset_statistics.attr,
> 	&device_attr_host_fpin_dn.attr,
> 	&device_attr_host_fpin_dn_unknown.attr,
> diff --git a/include/scsi/scsi_transport_fc.h b/include/scsi/scsi_transport_fc.h
> index a636c1986e22..c759b29e46c7 100644
> --- a/include/scsi/scsi_transport_fc.h
> +++ b/include/scsi/scsi_transport_fc.h
> @@ -468,6 +468,9 @@ struct fc_host_statistics {
> 	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 */
> +	/* Host Congestion Signals */
> +	u64 cn_sig_warn;
> +	u64 cn_sig_alarm;
> };
> 
> 
> -- 
> 2.19.0.rc0
> 

Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>

--
Himanshu Madhani	 Oracle Linux Engineering


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH v3 5/5] scsi: fc: Update documentation of sysfs nodes for FPIN stats
  2020-10-21  9:27 ` [PATCH v3 5/5] scsi: fc: Update documentation of sysfs nodes for FPIN stats Nilesh Javali
@ 2020-10-21 14:57   ` Himanshu Madhani
  0 siblings, 0 replies; 15+ messages in thread
From: Himanshu Madhani @ 2020-10-21 14:57 UTC (permalink / raw)
  To: Nilesh Javali; +Cc: Martin K . Petersen, linux-scsi, GR-QLogic-Storage-Upstream



> On Oct 21, 2020, at 4:27 AM, Nilesh Javali <njavali@marvell.com> wrote:
> 
> From: Shyam Sundar <ssundar@marvell.com>
> 
> Update documentation for sysfs nodes within,
>       /sys/class/fc_host
>       /sys/class/fc_remote_ports
> 
> Signed-off-by: Shyam Sundar <ssundar@marvell.com>
> Signed-off-by: Nilesh Javali <njavali@marvell.com>
> Reviewed-by: James Smart <james.smart@broadcom.com>
> ---
> Documentation/ABI/testing/sysfs-class-fc_host | 23 +++++++++++++++++++
> .../ABI/testing/sysfs-class-fc_remote_ports   | 23 +++++++++++++++++++
> 2 files changed, 46 insertions(+)
> create mode 100644 Documentation/ABI/testing/sysfs-class-fc_host
> create mode 100644 Documentation/ABI/testing/sysfs-class-fc_remote_ports
> 
> diff --git a/Documentation/ABI/testing/sysfs-class-fc_host b/Documentation/ABI/testing/sysfs-class-fc_host
> new file mode 100644
> index 000000000000..0a696cbd8232
> --- /dev/null
> +++ b/Documentation/ABI/testing/sysfs-class-fc_host
> @@ -0,0 +1,23 @@
> +What:		/sys/class/fc_host/hostX/statistics/fpin_cn_yyy
> +Date:		July 2020
> +Contact:	Shyam Sundar <ssundar@marvell.com>
> +Description:
> +		These files contain the number of congestion notification
> +		events recorded by the F_Port, reported using fabric
> +		performance impact notification (FPIN) event.
> +
> +What:		/sys/class/fc_host/hostX/statistics/fpin_li_yyy
> +Date:		July 2020
> +Contact:	Shyam Sundar <ssundar@marvell.com>
> +Description:
> +		These files contain the number of link integrity error
> +		events recorded by the F_Port/Nx_Port, reported using fabric
> +		performance impact notification (FPIN) event.
> +
> +What:		/sys/class/fc_host/hostX/statistics/fpin_dn_yyy
> +Date:		July 2020
> +Contact:	Shyam Sundar <ssundar@marvell.com>
> +Description:
> +		These files contain the number of delivery related errors
> +		recorded by the F_Port/Nx_Port, reported using fabric
> +		performance impact notification (FPIN) event.
> diff --git a/Documentation/ABI/testing/sysfs-class-fc_remote_ports b/Documentation/ABI/testing/sysfs-class-fc_remote_ports
> new file mode 100644
> index 000000000000..55a951529e03
> --- /dev/null
> +++ b/Documentation/ABI/testing/sysfs-class-fc_remote_ports
> @@ -0,0 +1,23 @@
> +What:		/sys/class/fc_remote_ports/rport-X:Y-Z/statistics/fpin_cn_yyy
> +Date:		July 2020
> +Contact:	Shyam Sundar <ssundar@marvell.com>
> +Description:
> +		These files contain the number of congestion notification
> +		events recorded by the F_Port/Nx_Port, reported using fabric
> +		performance impact notification (FPIN) event.
> +
> +What:		/sys/class/fc_remote_ports/rport-X:Y-Z/statistics/fpin_li_yyy
> +Date:		July 2020
> +Contact:	Shyam Sundar <ssundar@marvell.com>
> +Description:
> +		These files contain the number of link integrity error
> +		events recorded by the F_Port/Nx_Port, reported using fabric
> +		performance impact notification (FPIN) event.
> +
> +What:		/sys/class/fc_remote_ports/rport-X:Y-Z/statistics/fpin_dn_yyy
> +Date:		July 2020
> +Contact:	Shyam Sundar <ssundar@marvell.com>
> +Description:
> +		These files contain the number of delivery related errors
> +		recorded by the F_Port/Nx_Port, reported using fabric
> +		performance impact notification (FPIN) event.
> -- 
> 2.19.0.rc0
> 

Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>

--
Himanshu Madhani	 Oracle Linux Engineering


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH v3 3/5] scsi: fc: Parse FPIN packets and update statistics
  2020-10-21  9:27 ` [PATCH v3 3/5] scsi: fc: Parse FPIN packets and update statistics Nilesh Javali
  2020-10-21 14:55   ` Himanshu Madhani
@ 2020-10-21 17:49   ` James Smart
  2021-05-28 21:49   ` scsi_transport_fc: FPIN LI statistics James Smart
  2 siblings, 0 replies; 15+ messages in thread
From: James Smart @ 2020-10-21 17:49 UTC (permalink / raw)
  To: Nilesh Javali, martin.petersen; +Cc: linux-scsi, GR-QLogic-Storage-Upstream

[-- Attachment #1: Type: text/plain, Size: 381 bytes --]



On 10/21/2020 2:27 AM, Nilesh Javali wrote:
> From: Shyam Sundar <ssundar@marvell.com>
>
> Parse the incoming FPIN packets and update the host and rport FPIN
> statistics based on the FPINs.
>
> Signed-off-by: Shyam Sundar <ssundar@marvell.com>
> Signed-off-by: Nilesh Javali <njavali@marvell.com>
> ---
>

Reviewed-by: James Smart <james.smart@broadcom.com>

Thanks!

-- james


[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4163 bytes --]

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH v3 0/5] SAN Congestion Management (SCM) statistics
  2020-10-21  9:27 [PATCH v3 0/5] SAN Congestion Management (SCM) statistics Nilesh Javali
                   ` (4 preceding siblings ...)
  2020-10-21  9:27 ` [PATCH v3 5/5] scsi: fc: Update documentation of sysfs nodes for FPIN stats Nilesh Javali
@ 2020-10-26 22:07 ` Martin K. Petersen
  2020-11-11  2:59 ` Martin K. Petersen
  6 siblings, 0 replies; 15+ messages in thread
From: Martin K. Petersen @ 2020-10-26 22:07 UTC (permalink / raw)
  To: Nilesh Javali; +Cc: martin.petersen, linux-scsi, GR-QLogic-Storage-Upstream


Nilesh,

> Please apply the attached patchset implementing the SAN Congestion
> Management (SCM) statistics to the scsi tree at your earliest
> convenience.

Applied to 5.11/scsi-staging, thanks!

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH v3 0/5] SAN Congestion Management (SCM) statistics
  2020-10-21  9:27 [PATCH v3 0/5] SAN Congestion Management (SCM) statistics Nilesh Javali
                   ` (5 preceding siblings ...)
  2020-10-26 22:07 ` [PATCH v3 0/5] SAN Congestion Management (SCM) statistics Martin K. Petersen
@ 2020-11-11  2:59 ` Martin K. Petersen
  6 siblings, 0 replies; 15+ messages in thread
From: Martin K. Petersen @ 2020-11-11  2:59 UTC (permalink / raw)
  To: Nilesh Javali; +Cc: Martin K . Petersen, linux-scsi, GR-QLogic-Storage-Upstream

On Wed, 21 Oct 2020 02:27:10 -0700, Nilesh Javali wrote:

> Martin,
> 
> Please apply the attached patchset implementing the SAN Congestion
> Management (SCM) statistics to the scsi tree at your earliest
> convenience.
> 
> v2->v3:
> Incorporate review comments for patch v2 3/5.
> Added Reviewed-by tag for other patches.
> 
> [...]

Applied to 5.11/scsi-queue, thanks!

[1/5] scsi: fc: Update formal FPIN descriptor definitions
      https://git.kernel.org/mkp/scsi/c/874163aab75a
[2/5] scsi: fc: Add FPIN statistics to fc_host and fc_rport objects
      https://git.kernel.org/mkp/scsi/c/547aab51a914
[3/5] scsi: fc: Parse FPIN packets and update statistics
      https://git.kernel.org/mkp/scsi/c/3dcfe0de5a97
[4/5] scsi: fc: Add mechanism to update FPIN signal statistics
      https://git.kernel.org/mkp/scsi/c/846101960fdb
[5/5] scsi: fc: Update documentation of sysfs nodes for FPIN stats
      https://git.kernel.org/mkp/scsi/c/434ee4251950

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 15+ messages in thread

* scsi_transport_fc: FPIN LI statistics
  2020-10-21  9:27 ` [PATCH v3 3/5] scsi: fc: Parse FPIN packets and update statistics Nilesh Javali
  2020-10-21 14:55   ` Himanshu Madhani
  2020-10-21 17:49   ` James Smart
@ 2021-05-28 21:49   ` James Smart
  2 siblings, 0 replies; 15+ messages in thread
From: James Smart @ 2021-05-28 21:49 UTC (permalink / raw)
  To: Nilesh Javali, Shyam Sundar
  Cc: linux-scsi, GR-QLogic-Storage-Upstream, Himanshu Madhani

[-- Attachment #1: Type: text/plain, Size: 2615 bytes --]

Nilesh, Shyam,

I'm looking at commit 3dcfe0de5a97.  When we increment stats, we are 
incrementing by the event_count:
> +static void
> +fc_li_stats_update(struct fc_fn_li_desc *li_desc,
> +		   struct fc_fpin_stats *stats)
> +{
> +	stats->li += be32_to_cpu(li_desc->event_count);
> +	switch (be16_to_cpu(li_desc->event_type)) {
> +	case FPIN_LI_UNKNOWN:
> +		stats->li_failure_unknown +=
> +		    be32_to_cpu(li_desc->event_count);
> +		break;
> +	case FPIN_LI_LINK_FAILURE:
> +		stats->li_link_failure_count +=
> +		    be32_to_cpu(li_desc->event_count);
> +		break;
> +	case FPIN_LI_LOSS_OF_SYNC:
> +		stats->li_loss_of_sync_count +=
> +		    be32_to_cpu(li_desc->event_count);
> +		break;
> +	case FPIN_LI_LOSS_OF_SIG:
> +		stats->li_loss_of_signals_count +=
> +		    be32_to_cpu(li_desc->event_count);
> +		break;
> +	case FPIN_LI_PRIM_SEQ_ERR:
> +		stats->li_prim_seq_err_count +=
> +		    be32_to_cpu(li_desc->event_count);
> +		break;
> +	case FPIN_LI_INVALID_TX_WD:
> +		stats->li_invalid_tx_word_count +=
> +		    be32_to_cpu(li_desc->event_count);
> +		break;
> +	case FPIN_LI_INVALID_CRC:
> +		stats->li_invalid_crc_count +=
> +		    be32_to_cpu(li_desc->event_count);
> +		break;
> +	case FPIN_LI_DEVICE_SPEC:
> +		stats->li_device_specific +=
> +		    be32_to_cpu(li_desc->event_count);
> +		break;
> +	}
> +}

I'm wondering if this is really what we want.   Event_count is the 
minimum # of events that must occur before an FPIN is sent.  Thus, its 
not the actual number of events, and could be significantly off (low).   
Are we ok with that ?  Do we set the wrong impression with the user 
(here's a count, but its not necessary accurate) ?    Would it be better 
to simply count the # of FPINs (increment by 1 each time) ?

-- james


-- 
This electronic communication and the information and any files transmitted 
with it, or attached to it, are confidential and are intended solely for 
the use of the individual or entity to whom it is addressed and may contain 
information that is confidential, legally privileged, protected by privacy 
laws, or otherwise restricted from disclosure to anyone else. If you are 
not the intended recipient or the person responsible for delivering the 
e-mail to the intended recipient, you are hereby notified that any use, 
copying, distributing, dissemination, forwarding, printing, or copying of 
this e-mail is strictly prohibited. If you received this e-mail in error, 
please return the e-mail to the sender, delete it from your computer, and 
destroy any printed copy of it.

[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4206 bytes --]

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2021-05-28 21:49 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-21  9:27 [PATCH v3 0/5] SAN Congestion Management (SCM) statistics Nilesh Javali
2020-10-21  9:27 ` [PATCH v3 1/5] scsi: fc: Update formal FPIN descriptor definitions Nilesh Javali
2020-10-21 14:46   ` Himanshu Madhani
2020-10-21  9:27 ` [PATCH v3 2/5] scsi: fc: Add FPIN statistics to fc_host and fc_rport objects Nilesh Javali
2020-10-21 14:47   ` Himanshu Madhani
2020-10-21  9:27 ` [PATCH v3 3/5] scsi: fc: Parse FPIN packets and update statistics Nilesh Javali
2020-10-21 14:55   ` Himanshu Madhani
2020-10-21 17:49   ` James Smart
2021-05-28 21:49   ` scsi_transport_fc: FPIN LI statistics James Smart
2020-10-21  9:27 ` [PATCH v3 4/5] scsi: fc: Add mechanism to update FPIN signal statistics Nilesh Javali
2020-10-21 14:56   ` Himanshu Madhani
2020-10-21  9:27 ` [PATCH v3 5/5] scsi: fc: Update documentation of sysfs nodes for FPIN stats Nilesh Javali
2020-10-21 14:57   ` Himanshu Madhani
2020-10-26 22:07 ` [PATCH v3 0/5] SAN Congestion Management (SCM) statistics Martin K. Petersen
2020-11-11  2:59 ` Martin K. Petersen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).