diff mbox series

[v3,1/5] scsi: fc: Update formal FPIN descriptor definitions

Message ID 20201021092715.22669-2-njavali@marvell.com
State New
Headers show
Series [v3,1/5] scsi: fc: Update formal FPIN descriptor definitions | expand

Commit Message

Nilesh Javali Oct. 21, 2020, 9:27 a.m. UTC
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(-)

Comments

Himanshu Madhani Oct. 21, 2020, 2:46 p.m. UTC | #1
> 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
diff mbox series

Patch

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
  */