[ofw] [PATCH] ib_types.h mods to support opensm 3.3.6

Smith, Stan stan.smith at intel.com
Tue May 25 17:13:42 PDT 2010


Additions from OFED for Linux ib_types.h required to support opensm 3.3.6 on Windows.
OFED-W is currently on opensm 3.3.3.
Moved some items in the file to be compatible with OFED-L ib_types.h for compares.
Some name changes for OFED-L compatibility: IB_NOTICE_NODE_TYPE_CA --> IB_NOTICE_PRODUCER_TYPE_CA
Added Congestion Control MAD definitions.

signed-off-by: stan smith <stan.smith at intel.com>

--- A/inc/iba/ib_types.h        Tue May 25 16:59:33 2010
+++ B/inc/iba/ib_types.h        Tue May 25 16:59:06 2010
@@ -585,6 +585,18 @@
 #define IB_MCLASS_BIS 0x12
 /**********/

+/****d* IBA Base: Constants/IB_MCLASS_CC
+* NAME
+*      IB_MCLASS_CC
+*
+* DESCRIPTION
+*      Management Class, Congestion Control (A10.4.1)
+*
+* SOURCE
+*/
+#define IB_MCLASS_CC 0x21
+/**********/
+
 /****d* IBA Base: Constants/IB_MCLASS_VENDOR_HIGH_RANGE_MIN
 * NAME
 *      IB_MCLASS_VENDOR_HIGH_RANGE_MIN
@@ -974,6 +986,8 @@
 #define IB_SA_MAD_STATUS_TOO_MANY_RECORDS      (CL_HTON16(0x0400))
 #define IB_SA_MAD_STATUS_INVALID_GID           (CL_HTON16(0x0500))
 #define IB_SA_MAD_STATUS_INSUF_COMPS           (CL_HTON16(0x0600))
+#define IB_SA_MAD_STATUS_DENIED                                (CL_HTON16(0x0700))
+#define IB_SA_MAD_STATUS_PRIO_SUGGESTED                (CL_HTON16(0x0800))

 #define IB_DM_MAD_STATUS_NO_IOC_RESP           (CL_HTON16(0x0100))
 #define IB_DM_MAD_STATUS_NO_SVC_ENTRIES                (CL_HTON16(0x0200))
@@ -1410,18 +1424,6 @@
 #define IB_MAD_ATTR_MULTIPATH_RECORD                   (CL_NTOH16(0x003A))
 /**********/

-/****d* IBA Base: Constants/IB_MAD_ATTR_SVC_ASSOCIATION_RECORD
-* NAME
-*      IB_MAD_ATTR_SVC_ASSOCIATION_RECORD
-*
-* DESCRIPTION
-*      Service Association Record attribute (15.2.5)
-*
-* SOURCE
-*/
-#define IB_MAD_ATTR_SVC_ASSOCIATION_RECORD             (CL_NTOH16(0x003B))
-/**********/
-
 /****d* IBA Base: Constants/IB_MAD_ATTR_INFORM_INFO_RECORD
 * NAME
 *      IB_MAD_ATTR_INFORM_INFO_RECORD
@@ -1529,6 +1531,114 @@
 #define IB_MAD_ATTR_DIAG_CODE                          (CL_NTOH16(0x0024))
 /**********/

+/****d* IBA Base: Constants/IB_MAD_ATTR_SVC_ASSOCIATION_RECORD
+* NAME
+*      IB_MAD_ATTR_SVC_ASSOCIATION_RECORD
+*
+* DESCRIPTION
+*      Service Association Record attribute (15.2.5)
+*
+* SOURCE
+*/
+#define IB_MAD_ATTR_SVC_ASSOCIATION_RECORD     (CL_HTON16(0x003B))
+/**********/
+
+/****d* IBA Base: Constants/IB_MAD_ATTR_CONG_INFO
+* NAME
+*      IB_MAD_ATTR_CONG_INFO
+*
+* DESCRIPTION
+*      CongestionInfo attribute (A10.4.3)
+*
+* SOURCE
+*/
+#define IB_MAD_ATTR_CONG_INFO                          (CL_HTON16(0x0011))
+/**********/
+
+/****d* IBA Base: Constants/IB_MAD_ATTR_CONG_KEY_INFO
+* NAME
+*      IB_MAD_ATTR_CONG_KEY_INFO
+*
+* DESCRIPTION
+*      CongestionKeyInfo attribute (A10.4.3)
+*
+* SOURCE
+*/
+#define IB_MAD_ATTR_CONG_KEY_INFO                      (CL_HTON16(0x0012))
+/**********/
+
+/****d* IBA Base: Constants/IB_MAD_ATTR_CONG_LOG
+* NAME
+*      IB_MAD_ATTR_CONG_LOG
+*
+* DESCRIPTION
+*      CongestionLog attribute (A10.4.3)
+*
+* SOURCE
+*/
+#define IB_MAD_ATTR_CONG_LOG                           (CL_HTON16(0x0013))
+/**********/
+
+/****d* IBA Base: Constants/IB_MAD_ATTR_SW_CONG_SETTING
+* NAME
+*      IB_MAD_ATTR_SW_CONG_SETTING
+*
+* DESCRIPTION
+*      SwitchCongestionSetting attribute (A10.4.3)
+*
+* SOURCE
+*/
+#define IB_MAD_ATTR_SW_CONG_SETTING                    (CL_HTON16(0x0014))
+/**********/
+
+/****d* IBA Base: Constants/IB_MAD_ATTR_SW_PORT_CONG_SETTING
+* NAME
+*      IB_MAD_ATTR_SW_PORT_CONG_SETTING
+*
+* DESCRIPTION
+*      SwitchPortCongestionSetting attribute (A10.4.3)
+*
+* SOURCE
+*/
+#define IB_MAD_ATTR_SW_PORT_CONG_SETTING               (CL_HTON16(0x0015))
+/**********/
+
+/****d* IBA Base: Constants/IB_MAD_ATTR_CA_CONG_SETTING
+* NAME
+*      IB_MAD_ATTR_CA_CONG_SETTING
+*
+* DESCRIPTION
+*      CACongestionSetting attribute (A10.4.3)
+*
+* SOURCE
+*/
+#define IB_MAD_ATTR_CA_CONG_SETTING                    (CL_HTON16(0x0016))
+/**********/
+
+/****d* IBA Base: Constants/IB_MAD_ATTR_CC_TBL
+* NAME
+*      IB_MAD_ATTR_CC_TBL
+*
+* DESCRIPTION
+*      CongestionControlTable attribute (A10.4.3)
+*
+* SOURCE
+*/
+#define IB_MAD_ATTR_CC_TBL                             (CL_HTON16(0x0017))
+/**********/
+
+/****d* IBA Base: Constants/IB_MAD_ATTR_TIME_STAMP
+* NAME
+*      IB_MAD_ATTR_TIME_STAMP
+*
+* DESCRIPTION
+*      TimeStamp attribute (A10.4.3)
+*
+* SOURCE
+*/
+#define IB_MAD_ATTR_TIME_STAMP                         (CL_HTON16(0x0018))
+/**********/
+
 /****d* IBA Base: Constants/IB_NODE_TYPE_CA
 * NAME
 *      IB_NODE_TYPE_CA
@@ -1565,40 +1675,40 @@
 #define IB_NODE_TYPE_ROUTER                                    0x03
 /**********/

-/****d* IBA Base: Constants/IB_NOTICE_NODE_TYPE_CA
+/****d* IBA Base: Constants/IB_NOTICE_PRODUCER_TYPE_CA
 * NAME
-*      IB_NOTICE_NODE_TYPE_CA
+*      IB_NOTICE_PRODUCER_TYPE_CA
 *
 * DESCRIPTION
-*      Encoded generic node type used in MAD attributes (13.4.8.2)
+*      Encoded generic producer type used in Notice attribute (13.4.8.2)
 *
 * SOURCE
 */
-#define IB_NOTICE_NODE_TYPE_CA                         (CL_NTOH32(0x000001))
+#define IB_NOTICE_PRODUCER_TYPE_CA                     (CL_HTON32(0x000001))
 /**********/

-/****d* IBA Base: Constants/IB_NOTICE_NODE_TYPE_SWITCH
+/****d* IBA Base: Constants/IB_NOTICE_PRODUCER_TYPE_SWITCH
 * NAME
-*      IB_NOTICE_NODE_TYPE_SWITCH
+*      IB_NOTICE_PRODUCER_TYPE_SWITCH
 *
 * DESCRIPTION
-*      Encoded generic node type used in MAD attributes (13.4.8.2)
+*      Encoded generic producer type used in Notice attribute (13.4.8.2)
 *
 * SOURCE
 */
-#define IB_NOTICE_NODE_TYPE_SWITCH                     (CL_NTOH32(0x000002))
+#define IB_NOTICE_PRODUCER_TYPE_SWITCH                 (CL_HTON32(0x000002))
 /**********/

-/****d* IBA Base: Constants/IB_NOTICE_NODE_TYPE_ROUTER
+/****d* IBA Base: Constants/IB_NOTICE_PRODUCER_TYPE_ROUTER
 * NAME
-*      IB_NOTICE_NODE_TYPE_ROUTER
+*      IB_NOTICE_PRODUCER_TYPE_ROUTER
 *
 * DESCRIPTION
-*      Encoded generic node type used in MAD attributes (13.4.8.2)
+*      Encoded generic producer type used in Notice attribute (13.4.8.2)
 *
 * SOURCE
 */
-#define IB_NOTICE_NODE_TYPE_ROUTER                     (CL_NTOH32(0x000003))
+#define IB_NOTICE_PRODUCER_TYPE_ROUTER                 (CL_HTON32(0x000003))
 /**********/

 /****d* IBA Base: Constants/IB_NOTICE_PRODUCER_TYPE_CLASS_MGR
@@ -2328,7 +2438,8 @@
 ib_gid_is_link_local(
        IN              const   ib_gid_t* const                         p_gid )
 {
-       return( ib_gid_get_subnet_prefix( p_gid ) == IB_DEFAULT_SUBNET_PREFIX );
+       return ((ib_gid_get_subnet_prefix(p_gid) &
+                CL_HTON64(0xFFC0000000000000ULL)) == IB_DEFAULT_SUBNET_PREFIX);
 }
 /*
 * PARAMETERS
@@ -3376,6 +3487,23 @@
 #define IB_CLASS_CAP_GETSET                                    0x0002
 /*********/

+/****s* IBA Base: Constants/IB_CLASS_ENH_PORT0_CC_MASK
+* NAME
+*      IB_CLASS_ENH_PORT0_CC_MASK
+*
+* DESCRIPTION
+*      ClassPortInfo CapabilityMask bits.
+*      Switch only: This bit will be set if the EnhacedPort0
+*      supports CA Congestion Control (A10.4.3.1).
+*
+* SEE ALSO
+*      ib_class_port_info_t
+*
+* SOURCE
+*/
+#define IB_CLASS_ENH_PORT0_CC_MASK                     0x0100
+/*********/
+
 /****s* IBA Base: Constants/IB_CLASS_RESP_TIME_MASK
 * NAME
 *      IB_CLASS_RESP_TIME_MASK
@@ -3482,6 +3610,10 @@
 *
 *********/

+#define IB_PM_ALL_PORT_SELECT                  (CL_HTON16(((uint16_t)1)<<8))
+#define IB_PM_EXT_WIDTH_SUPPORTED              (CL_HTON16(((uint16_t)1)<<9))
+#define IB_PM_EXT_WIDTH_NOIETF_SUP             (CL_HTON16(((uint16_t)1)<<10))
+
 /****f* IBA Base: Types/ib_class_set_resp_time_val
 * NAME
 *      ib_class_set_resp_time_val
@@ -5129,6 +5261,9 @@
       rate = IB_PATH_RECORD_RATE_10_GBS;
       break;

+       case IB_LINK_WIDTH_ACTIVE_8X:
+               rate = IB_PATH_RECORD_RATE_20_GBS;
+               break;
     case IB_LINK_WIDTH_ACTIVE_12X:
       rate = IB_PATH_RECORD_RATE_30_GBS;
       break;
@@ -6265,6 +6400,34 @@
 * SEE ALSO
 *********/

+/****f* IBA Base: Types/ib_switch_info_get_opt_sl2vlmapping
+* NAME
+*      ib_switch_info_get_state_opt_sl2vlmapping
+*
+* DESCRIPTION
+*       Returns the value of the optimized SLtoVLMapping programming flag.
+*
+* SYNOPSIS
+*/
+static inline boolean_t AL_API
+ib_switch_info_get_opt_sl2vlmapping(IN const ib_switch_info_t * const p_si)
+{
+        return ((p_si->life_state & 0x01) == 0x01);
+}
+
+/*
+* PARAMETERS
+*      p_si
+*              [in] Pointer to a SwitchInfo attribute.
+*
+* RETURN VALUES
+*      Returns the value of the optimized SLtoVLMapping programming flag.
+*
+* NOTES
+*
+* SEE ALSO
+*********/
+
 /****f* IBA Base: Types/ib_switch_info_is_enhanced_port0
 * NAME
 *      ib_switch_info_is_enhanced_port0
@@ -7719,6 +7882,20 @@
                 ib_gid_t gid;
          } PACK_SUFFIX ntc_bkey_259;

+         struct _ntc_cckey_0   // CC key violation
+         {
+               ib_net16_t slid;     // source LID from offending packet LRH
+               uint8_t method;      // method, from common MAD header
+               uint8_t resv0;
+               ib_net16_t attribute_id; // Attribute ID, from common MAD header
+               ib_net16_t resv1;
+               ib_net32_t attribute_modifier;// Attribute Modif, from common MAD header
+               ib_net32_t qp;       // 8b pad, 24b dest QP from BTH
+               ib_net64_t cc_key;   // CC key of the offending packet
+               ib_gid_t source_gid; // GID from GRH of the offending packet
+               uint8_t padding[14]; // Padding - ignored on read
+         } PACK_SUFFIX ntc_cckey_0;
+
        } data_details;

   ib_gid_t                     issuer_gid;    // 16          80
@@ -8171,7 +8348,7 @@
 {
        ib_gid_t                                subscriber_gid;
        net16_t                                 subscriber_enum;
-       uint16_t                                reserved[3];
+       uint8_t                                 reserved[6];
        ib_inform_info_t                inform_info;
        uint8_t                                 pad[4];

@@ -8212,6 +8389,25 @@
 * ib_mad_t
 *********/

+/****s* IBA Base: Types/ib_port_rcv_data_sl
+* NAME
+*      ib_port_rcv_data_sl_t
+*
+* DESCRIPTION
+*      IBA defined PortRcvDataSL Attribute. (A13.6.4)
+*
+* SYNOPSIS
+*/
+#include <complib/cl_packon.h>
+typedef struct _ib_port_rcv_data_sl {
+       uint8_t reserved;
+       uint8_t port_select;
+       ib_net16_t counter_select;
+       ib_net32_t port_rcv_data_sl[16];
+       uint8_t resv[124];
+} PACK_SUFFIX ib_port_rcv_data_sl_t;
+#include <complib/cl_packoff.h>
+
 /****d* IBA Base: Types/DM_SVC_NAME
 * NAME
 *      DM_SVC_NAME
@@ -11638,6 +11834,644 @@
 *      on the structure command field or the usage context.
 *****/

+/****s* IBA Base: Types/ib_cc_mad_t
+* NAME
+*      ib_cc_mad_t
+*
+* DESCRIPTION
+*      IBA defined Congestion Control MAD format. (A10.4.1)
+*
+* SYNOPSIS
+*/
+#define IB_CC_LOG_DATA_SIZE 32
+#define IB_CC_MGT_DATA_SIZE 192
+#define IB_CC_MAD_HDR_SIZE (sizeof(ib_sa_mad_t) - IB_CC_LOG_DATA_SIZE \
+                                               - IB_CC_MGT_DATA_SIZE)
+
+#include <complib/cl_packon.h>
+typedef struct _ib_cc_mad {
+       ib_mad_t header;
+       ib_net64_t cc_key;
+       uint8_t log_data[IB_CC_LOG_DATA_SIZE];
+       uint8_t mgt_data[IB_CC_MGT_DATA_SIZE];
+} PACK_SUFFIX ib_cc_mad_t;
+#include <complib/cl_packoff.h>
+/*
+* FIELDS
+*      header
+*              Common MAD header.
+*
+*      cc_key
+*              CC_Key of the Congestion Control MAD.
+*
+*      log_data
+*              Congestion Control log data of the CC MAD.
+*
+*      mgt_data
+*              Congestion Control management data of the CC MAD.
+*
+* SEE ALSO
+* ib_mad_t
+*********/
+
+/****f* IBA Base: Types/ib_cc_mad_get_cc_key
+* NAME
+*      ib_cc_mad_get_cc_key
+*
+* DESCRIPTION
+*      Gets a CC_Key of the CC MAD.
+*
+* SYNOPSIS
+*/
+static inline ib_net64_t AL_API
+ib_cc_mad_get_cc_key(IN const ib_cc_mad_t * const p_cc_mad)
+{
+       return p_cc_mad->cc_key;
+}
+/*
+* PARAMETERS
+*      p_cc_mad
+*              [in] Pointer to the CC MAD packet.
+*
+* RETURN VALUES
+*      CC_Key of the provided CC MAD packet.
+*
+* NOTES
+*
+* SEE ALSO
+*      ib_cc_mad_t
+*********/
+
+/****f* IBA Base: Types/ib_cc_mad_get_log_data_ptr
+* NAME
+*      ib_cc_mad_get_mgt_data_ptr
+*
+* DESCRIPTION
+*      Gets a pointer to the CC MAD's log data area.
+*
+* SYNOPSIS
+*/
+static inline void * AL_API
+ib_cc_mad_get_log_data_ptr(IN const ib_cc_mad_t * const p_cc_mad)
+{
+       return ((void *)p_cc_mad->log_data);
+}
+/*
+* PARAMETERS
+*      p_cc_mad
+*              [in] Pointer to the CC MAD packet.
+*
+* RETURN VALUES
+*      Pointer to CC MAD log data area.
+*
+* NOTES
+*
+* SEE ALSO
+*      ib_cc_mad_t
+*********/
+
+/****f* IBA Base: Types/ib_cc_mad_get_mgt_data_ptr
+* NAME
+*      ib_cc_mad_get_mgt_data_ptr
+*
+* DESCRIPTION
+*      Gets a pointer to the CC MAD's management data area.
+*
+* SYNOPSIS
+*/
+static inline void * AL_API
+ib_cc_mad_get_mgt_data_ptr(IN const ib_cc_mad_t * const p_cc_mad)
+{
+       return ((void *)p_cc_mad->mgt_data);
+}
+/*
+* PARAMETERS
+*      p_cc_mad
+*              [in] Pointer to the CC MAD packet.
+*
+* RETURN VALUES
+*      Pointer to CC MAD management data area.
+*
+* NOTES
+*
+* SEE ALSO
+*      ib_cc_mad_t
+*********/
+
+/****s* IBA Base: Types/ib_cong_info_t
+* NAME
+*      ib_cong_info_t
+*
+* DESCRIPTION
+*      IBA defined CongestionInfo attribute (A10.4.3.3)
+*
+* SYNOPSIS
+*/
+#include <complib/cl_packon.h>
+typedef struct _ib_cong_info {
+       uint8_t cong_info;
+       uint8_t resv;
+       uint8_t ctrl_table_cap;
+} PACK_SUFFIX ib_cong_info_t;
+#include <complib/cl_packoff.h>
+/*
+* FIELDS
+*      cong_info
+*              Congestion control capabilities of the node.
+*
+*      ctrl_table_cap
+*              Number of 64 entry blocks in the CongestionControlTable.
+*
+* SEE ALSO
+*      ib_cc_mad_t
+*********/
+
+/****s* IBA Base: Types/ib_cong_key_info_t
+* NAME
+*      ib_cong_key_info_t
+*
+* DESCRIPTION
+*      IBA defined CongestionKeyInfo attribute (A10.4.3.4)
+*
+* SYNOPSIS
+*/
+#include <complib/cl_packon.h>
+typedef struct _ib_cong_key_info {
+       ib_net64_t cc_key;
+       ib_net16_t protect_bit;
+       ib_net16_t lease_period;
+       ib_net16_t violations;
+} PACK_SUFFIX ib_cong_key_info_t;
+#include <complib/cl_packoff.h>
+/*
+* FIELDS
+*      cc_key
+*              8-byte CC Key.
+*
+*      protect_bit
+*              Bit 0 is a CC Key Protect Bit, other 15 bits are reserved.
+*
+*      lease_period
+*              How long the CC Key protect bit is to remain non-zero.
+*
+*      violations
+*              Number of received MADs that violated CC Key.
+*
+* SEE ALSO
+*      ib_cc_mad_t
+*********/
+
+/****s* IBA Base: Types/ib_cong_log_event_sw_t
+* NAME
+*      ib_cong_log_event_sw_t
+*
+* DESCRIPTION
+*      IBA defined CongestionLogEvent (SW) entry (A10.4.3.5)
+*
+* SYNOPSIS
+*/
+#include <complib/cl_packon.h>
+typedef struct _ib_cong_log_event_sw {
+       ib_net16_t slid;
+       ib_net16_t dlid;
+       ib_net32_t sl;
+       ib_net32_t time_stamp;
+} PACK_SUFFIX ib_cong_log_event_sw_t;
+#include <complib/cl_packoff.h>
+/*
+* FIELDS
+*      slid
+*              Source LID of congestion event.
+*
+*      dlid
+*              Destination LID of congestion event.
+*
+*      sl
+*              4 bits - SL of congestion event.
+*              rest of the bits are reserved.
+*
+*      time_stamp
+*              Timestamp of congestion event.
+*
+* SEE ALSO
+*      ib_cc_mad_t, ib_cong_log_t
+*********/
+
+/****s* IBA Base: Types/ib_cong_log_event_ca_t
+* NAME
+*      ib_cong_log_event_ca_t
+*
+* DESCRIPTION
+*      IBA defined CongestionLogEvent (CA) entry (A10.4.3.5)
+*
+* SYNOPSIS
+*/
+#include <complib/cl_packon.h>
+typedef struct _ib_cong_log_event_ca {
+       ib_net32_t local_qp_resv0;
+       ib_net32_t remote_qp_sl_service_type;
+       ib_net16_t remote_lid;
+       ib_net16_t resv1;
+       ib_net32_t time_stamp;
+} PACK_SUFFIX ib_cong_log_event_ca_t;
+#include <complib/cl_packoff.h>
+/*
+* FIELDS
+*      resv0_local_qp
+*              bits [31:8] local QP that reached CN threshold.
+*              bits [7:0] reserved.
+*
+*      remote_qp_sl_service_type
+*              bits [31:8] remote QP that is connected to local QP.
+*              bits [7:4] SL of the local QP.
+*              bits [3:0] Service Type of the local QP.
+*
+*      remote_lid
+*              LID of the remote port that is connected to local QP.
+*
+*      time_stamp
+*              Timestamp when threshold reached.
+*
+* SEE ALSO
+*      ib_cc_mad_t, ib_cong_log_t
+*********/
+
+/****s* IBA Base: Types/ib_cong_log_t
+* NAME
+*      ib_cong_log_t
+*
+* DESCRIPTION
+*      IBA defined CongestionLog attribute (A10.4.3.5)
+*
+* SYNOPSIS
+*/
+#include <complib/cl_packon.h>
+typedef struct _ib_cong_log {
+       uint8_t log_type;
+       union _log_details
+       {
+               struct _log_sw {
+                       uint8_t cong_flags;
+                       ib_net16_t event_counter;
+                       ib_net32_t time_stamp;
+                       uint8_t port_map[32];
+                       ib_cong_log_event_sw_t entry_list[15];
+               } PACK_SUFFIX log_sw;
+
+               struct _log_ca {
+                       uint8_t cong_flags;
+                       ib_net16_t event_counter;
+                       ib_net16_t event_map;
+                       ib_net16_t resv;
+                       ib_net32_t time_stamp;
+                       ib_cong_log_event_ca_t log_event[13];
+               } PACK_SUFFIX log_ca;
+
+       } log_details;
+} PACK_SUFFIX ib_cong_log_t;
+#include <complib/cl_packoff.h>
+/*
+* FIELDS
+*
+*      log_{sw,ca}.log_type
+*              Log type: 0x1 is for Switch, 0x2 is for CA
+*
+*      log_{sw,ca}.cong_flags
+*              Congestion Flags.
+*
+*      log_{sw,ca}.event_counter
+*              Number of events since log last sent.
+*
+*      log_{sw,ca}.time_stamp
+*              Timestamp when log sent.
+*
+*      log_sw.port_map
+*              If a bit set to 1, then the corresponding port
+*              has marked packets with a FECN.
+*              bits 0 and 255 - reserved
+*              bits [254..1] - ports [254..1].
+*
+*      log_sw.entry_list
+*              Array of 13 most recent congestion log events.
+*
+*      log_ca.event_map
+*              array 16 bits, one for each SL.
+*
+*      log_ca.log_event
+*              Array of 13 most recent congestion log events.
+*
+* SEE ALSO
+*      ib_cc_mad_t, ib_cong_log_event_sw_t, ib_cong_log_event_ca_t
+*********/
+
+/****s* IBA Base: Types/ib_sw_cong_setting_t
+* NAME
+*      ib_sw_cong_setting_t
+*
+* DESCRIPTION
+*      IBA defined SwitchCongestionSetting attribute (A10.4.3.6)
+*
+* SYNOPSIS
+*/
+#include <complib/cl_packon.h>
+typedef struct _ib_sw_cong_setting {
+       ib_net32_t control_map;
+       uint8_t victim_mask[32];
+       uint8_t credit_mask[32];
+       uint8_t threshold_resv;
+       uint8_t packet_size;
+       ib_net16_t cs_threshold_resv;
+       ib_net16_t cs_return_delay;
+       ib_net16_t marking_rate;
+} PACK_SUFFIX ib_sw_cong_setting_t;
+#include <complib/cl_packoff.h>
+/*
+* FIELDS
+*
+*      control_map
+*              Indicates which components of this attribute are valid
+*
+*      victim_mask
+*              If the bit set to 1, then the port corresponding to
+*              that bit shall mark packets that encounter congestion
+*              with a FECN, whether they are the source or victim
+*              of congestion. (See A10.2.1.1.1)
+*                bit 0: port 0 (enhanced port 0 only)
+*                bits [254..1]: ports [254..1]
+*                bit 255: reserved
+*
+*      credit_mask
+*              If the bit set to 1, then the port corresponding
+*              to that bit shall apply Credit Starvation.
+*                bit 0: port 0 (enhanced port 0 only)
+*                bits [254..1]: ports [254..1]
+*                bit 255: reserved
+*
+*      threshold
+*              bits [15..12] Indicates how agressive cong. marking should be
+*              bits [11..0] Reserved
+*
+*      packet_size
+*              Any packet less than this size won't be marked with FECN
+*
+*      cs_threshold
+*              bits [7..4] How agressive Credit Starvation should be
+*              bits [3..0] Reserved
+*
+*      cs_return_delay
+*              Value that controls credit return rate.
+*
+*      marking_rate
+*              The value that provides the mean number of packets
+*              between marking eligible packets with FECN.
+*
+* SEE ALSO
+*      ib_cc_mad_t
+*********/
+
+/****s* IBA Base: Types/ib_sw_port_cong_setting_element_t
+* NAME
+*      ib_sw_port_cong_setting_element_t
+*
+* DESCRIPTION
+*      IBA defined SwitchPortCongestionSettingElement (A10.4.3.7)
+*
+* SYNOPSIS
+*/
+#include <complib/cl_packon.h>
+typedef struct _ib_sw_port_cong_setting_element {
+       uint8_t valid_ctrl_type_res_threshold;
+       uint8_t packet_size;
+       ib_net16_t cong_param;
+} PACK_SUFFIX ib_sw_port_cong_setting_element_t;
+#include <complib/cl_packoff.h>
+/*
+* FIELDS
+*
+*      valid_ctrl_type_res_threshold
+*              bit 7: "Valid"
+*                      when set to 1, indicates this switch
+*                      port congestion setting element is valid.
+*              bit 6: "Control Type"
+*                      Indicates which type of attribute is being set:
+*                      0b = Congestion Control parameters are being set.
+*                      1b = Credit Starvation parameters are being set.
+*              bits [5..4]: reserved
+*              bits [3..0]: "Threshold"
+*                      When Control Type is 0, contains the congestion
+*                      threshold value (Threshold) for this port.
+*                      When Control Type is 1, contains the credit
+*                      starvation threshold (CS_Threshold) value for
+*                      this port.
+*
+*      packet_size
+*              When Control Type is 0, this field contains the minimum
+*              size of packets that may be marked with a FECN.
+*              When Control Type is 1, this field is reserved.
+*
+*      cong_parm
+*              When Control Type is 0, this field contains the port
+*              marking_rate.
+*              When Control Type is 1, this field is reserved.
+*
+* SEE ALSO
+*      ib_cc_mad_t, ib_sw_port_cong_setting_t
+*********/
+
+/****d* IBA Base: Types/ib_sw_port_cong_setting_block_t
+* NAME
+*      ib_sw_port_cong_setting_block_t
+*
+* DESCRIPTION
+*      Defines the SwitchPortCongestionSetting Block (A10.4.3.7).
+*
+* SOURCE
+*/
+typedef ib_sw_port_cong_setting_element_t ib_sw_port_cong_setting_block_t[32];
+/**********/
+
+/****s* IBA Base: Types/ib_sw_port_cong_setting_t
+* NAME
+*      ib_sw_port_cong_setting_t
+*
+* DESCRIPTION
+*      IBA defined SwitchPortCongestionSetting attribute (A10.4.3.7)
+*
+* SYNOPSIS
+*/
+
+#include <complib/cl_packon.h>
+typedef struct _ib_sw_port_cong_setting {
+       ib_sw_port_cong_setting_block_t block;
+} PACK_SUFFIX ib_sw_port_cong_setting_t;
+#include <complib/cl_packoff.h>
+/*
+* FIELDS
+*
+*      block
+*              SwitchPortCongestionSetting block.
+*
+* SEE ALSO
+*      ib_cc_mad_t, ib_sw_port_cong_setting_element_t
+*********/
+
+/****s* IBA Base: Types/ib_ca_cong_entry_t
+* NAME
+*      ib_ca_cong_entry_t
+*
+* DESCRIPTION
+*      IBA defined CACongestionEntry (A10.4.3.8)
+*
+* SYNOPSIS
+*/
+#include <complib/cl_packon.h>
+typedef struct _ib_ca_cong_entry {
+       ib_net16_t ccti_timer;
+       uint8_t ccti_increase;
+       uint8_t trigger_threshold;
+       uint8_t ccti_min;
+       uint8_t resv0;
+       ib_net16_t resv1;
+} PACK_SUFFIX ib_ca_cong_entry_t;
+#include <complib/cl_packoff.h>
+/*
+* FIELDS
+*
+*      ccti_timer
+*              When the timer expires it will be reset to its specified
+*              value, and 1 will be decremented from the CCTI.
+*
+*      ccti_increase
+*              The number to be added to the table Index (CCTI)
+*              on the receipt of a BECN.
+*
+*      trigger_threshold
+*              When the CCTI is equal to this value, an event
+*              is logged in the CAs cyclic event log.
+*
+*      ccti_min
+*              The minimum value permitted for the CCTI.
+*
+* SEE ALSO
+*      ib_cc_mad_t
+*********/
+
+/****s* IBA Base: Types/ib_ca_cong_setting_t
+* NAME
+*      ib_ca_cong_setting_t
+*
+* DESCRIPTION
+*      IBA defined CACongestionSetting attribute (A10.4.3.8)
+*
+* SYNOPSIS
+*/
+#include <complib/cl_packon.h>
+typedef struct _ib_ca_cong_setting {
+       ib_net16_t port_control;
+       ib_net16_t control_map;
+       ib_ca_cong_entry_t entry_list[16];
+} PACK_SUFFIX ib_ca_cong_setting_t;
+#include <complib/cl_packoff.h>
+/*
+* FIELDS
+*
+*      port_control
+*              Congestion attributes for this port:
+*                bit0 = 0: QP based CC
+*                bit0 = 1: SL/Port based CC
+*              All other bits are reserved
+*
+*      control_map
+*              An array of sixteen bits, one for each SL. Each bit indicates
+*              whether or not the corresponding entry is to be modified.
+*
+*      entry_list
+*              List of 16 CACongestionEntries, one per SL.
+*
+* SEE ALSO
+*      ib_cc_mad_t
+*********/
+
+/****s* IBA Base: Types/ib_cc_tbl_entry_t
+* NAME
+*      ib_cc_tbl_entry_t
+*
+* DESCRIPTION
+*      IBA defined CongestionControlTableEntry (A10.4.3.9)
+*
+* SYNOPSIS
+*/
+#include <complib/cl_packon.h>
+typedef struct _ib_cc_tbl_entry {
+       ib_net16_t shift_multiplier;
+} PACK_SUFFIX ib_cc_tbl_entry_t;
+#include <complib/cl_packoff.h>
+/*
+* FIELDS
+*
+*      shift_multiplier
+*              bits [15..14] - CCT Shift
+*                used when calculating the injection rate delay
+*              bits [13..0] - CCT Multiplier
+*                used when calculating the injection rate delay
+*
+* SEE ALSO
+*      ib_cc_mad_t
+*********/
+
+/****s* IBA Base: Types/ib_cc_tbl_t
+* NAME
+*      ib_cc_tbl_t
+*
+* DESCRIPTION
+*      IBA defined CongestionControlTable attribute (A10.4.3.9)
+*
+* SYNOPSIS
+*/
+#include <complib/cl_packon.h>
+typedef struct _ib_cc_tbl {
+       ib_net16_t ccti_limit;
+       ib_net16_t resv;
+       ib_cc_tbl_entry_t entry_list[64];
+} PACK_SUFFIX ib_cc_tbl_t;
+#include <complib/cl_packoff.h>
+/*
+* FIELDS
+*
+*      ccti_limit
+*              Maximum valid CCTI for this table.
+*
+*      entry_list
+*              List of up to 64 CongestionControlTableEntries.
+*
+* SEE ALSO
+*      ib_cc_mad_t
+*********/
+
+/****s* IBA Base: Types/ib_time_stamp_t
+* NAME
+*      ib_time_stamp_t
+*
+* DESCRIPTION
+*      IBA defined TimeStamp attribute (A10.4.3.10)
+*
+* SOURCE
+*/
+#include <complib/cl_packon.h>
+typedef struct _ib_time_stamp {
+       ib_net32_t value;
+} PACK_SUFFIX ib_time_stamp_t;
+#include <complib/cl_packoff.h>
+/*
+* FIELDS
+*
+*      value
+*              Free running clock that provides relative time info
+*              for a device. Time is kept in 1.024 usec units.
+*
+* SEE ALSO
+*      ib_cc_mad_t
+*********/

 #define IB_REQ_CM_RDMA_SID_PREFIX                      0x0000000001000000
 #define IB_REQ_CM_RDMA_PDATA_SIZE                      56



More information about the ofw mailing list