Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

scsi: fc: Update formal FPIN descriptor definitions

Add Fabric Performance Impact Notification (FPIN) descriptor definitions
for the following FPINs:

- Delivery Notification Descriptor

- Peer Congestion Notification Descriptor

- Congestion Notification Descriptor

Link: https://lore.kernel.org/r/20201021092715.22669-2-njavali@marvell.com
Reviewed-by: James Smart <james.smart@broadcom.com>
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Signed-off-by: Shyam Sundar <ssundar@marvell.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

authored by

Shyam Sundar and committed by
Martin K. Petersen
874163aa 3650b228

+113 -1
+113 -1
include/uapi/scsi/fc/fc_els.h
··· 916 916 ELS_CLID_IC_LIP = 8, /* receiving LIP */ 917 917 }; 918 918 919 - 919 + /* 920 + * Link Integrity event types 921 + */ 920 922 enum fc_fpin_li_event_types { 921 923 FPIN_LI_UNKNOWN = 0x0, 922 924 FPIN_LI_LINK_FAILURE = 0x1, ··· 945 943 { FPIN_LI_DEVICE_SPEC, "Device Specific" }, \ 946 944 } 947 945 946 + /* 947 + * Delivery event types 948 + */ 949 + enum fc_fpin_deli_event_types { 950 + FPIN_DELI_UNKNOWN = 0x0, 951 + FPIN_DELI_TIMEOUT = 0x1, 952 + FPIN_DELI_UNABLE_TO_ROUTE = 0x2, 953 + FPIN_DELI_DEVICE_SPEC = 0xF, 954 + }; 955 + 956 + /* 957 + * Initializer useful for decoding table. 958 + * Please keep this in sync with the above definitions. 959 + */ 960 + #define FC_FPIN_DELI_EVT_TYPES_INIT { \ 961 + { FPIN_DELI_UNKNOWN, "Unknown" }, \ 962 + { FPIN_DELI_TIMEOUT, "Timeout" }, \ 963 + { FPIN_DELI_UNABLE_TO_ROUTE, "Unable to Route" }, \ 964 + { FPIN_DELI_DEVICE_SPEC, "Device Specific" }, \ 965 + } 966 + 967 + /* 968 + * Congestion event types 969 + */ 970 + enum fc_fpin_congn_event_types { 971 + FPIN_CONGN_CLEAR = 0x0, 972 + FPIN_CONGN_LOST_CREDIT = 0x1, 973 + FPIN_CONGN_CREDIT_STALL = 0x2, 974 + FPIN_CONGN_OVERSUBSCRIPTION = 0x3, 975 + FPIN_CONGN_DEVICE_SPEC = 0xF, 976 + }; 977 + 978 + /* 979 + * Initializer useful for decoding table. 980 + * Please keep this in sync with the above definitions. 981 + */ 982 + #define FC_FPIN_CONGN_EVT_TYPES_INIT { \ 983 + { FPIN_CONGN_CLEAR, "Clear" }, \ 984 + { FPIN_CONGN_LOST_CREDIT, "Lost Credit" }, \ 985 + { FPIN_CONGN_CREDIT_STALL, "Credit Stall" }, \ 986 + { FPIN_CONGN_OVERSUBSCRIPTION, "Oversubscription" }, \ 987 + { FPIN_CONGN_DEVICE_SPEC, "Device Specific" }, \ 988 + } 989 + 990 + enum fc_fpin_congn_severity_types { 991 + FPIN_CONGN_SEVERITY_WARNING = 0xF1, 992 + FPIN_CONGN_SEVERITY_ERROR = 0xF7, 993 + }; 948 994 949 995 /* 950 996 * Link Integrity Notification Descriptor ··· 1022 972 __be64 pname_list[0]; /* list of N_Port_Names accessible 1023 973 * through the attached port 1024 974 */ 975 + }; 976 + 977 + /* 978 + * Delivery Notification Descriptor 979 + */ 980 + struct fc_fn_deli_desc { 981 + __be32 desc_tag; /* Descriptor Tag (0x00020002) */ 982 + __be32 desc_len; /* Length of Descriptor (in bytes). 983 + * Size of descriptor excluding 984 + * desc_tag and desc_len fields. 985 + */ 986 + __be64 detecting_wwpn; /* Port Name that detected event */ 987 + __be64 attached_wwpn; /* Port Name of device attached to 988 + * detecting Port Name 989 + */ 990 + __be32 deli_reason_code;/* see enum fc_fpin_deli_event_types */ 991 + }; 992 + 993 + /* 994 + * Peer Congestion Notification Descriptor 995 + */ 996 + struct fc_fn_peer_congn_desc { 997 + __be32 desc_tag; /* Descriptor Tag (0x00020003) */ 998 + __be32 desc_len; /* Length of Descriptor (in bytes). 999 + * Size of descriptor excluding 1000 + * desc_tag and desc_len fields. 1001 + */ 1002 + __be64 detecting_wwpn; /* Port Name that detected event */ 1003 + __be64 attached_wwpn; /* Port Name of device attached to 1004 + * detecting Port Name 1005 + */ 1006 + __be16 event_type; /* see enum fc_fpin_congn_event_types */ 1007 + __be16 event_modifier; /* Implementation specific value 1008 + * describing the event type 1009 + */ 1010 + __be32 event_period; /* duration (ms) of the detected 1011 + * congestion event 1012 + */ 1013 + __be32 pname_count; /* number of portname_list elements */ 1014 + __be64 pname_list[0]; /* list of N_Port_Names accessible 1015 + * through the attached port 1016 + */ 1017 + }; 1018 + 1019 + /* 1020 + * Congestion Notification Descriptor 1021 + */ 1022 + struct fc_fn_congn_desc { 1023 + __be32 desc_tag; /* Descriptor Tag (0x00020004) */ 1024 + __be32 desc_len; /* Length of Descriptor (in bytes). 1025 + * Size of descriptor excluding 1026 + * desc_tag and desc_len fields. 1027 + */ 1028 + __be16 event_type; /* see enum fc_fpin_congn_event_types */ 1029 + __be16 event_modifier; /* Implementation specific value 1030 + * describing the event type 1031 + */ 1032 + __be32 event_period; /* duration (ms) of the detected 1033 + * congestion event 1034 + */ 1035 + __u8 severity; /* command */ 1036 + __u8 resv[3]; /* reserved - must be zero */ 1025 1037 }; 1026 1038 1027 1039 /*