[ofw] RE: [PATCH] OpenSM 3.3.2 required items added to ib_types.h

Leonid Keller leonid at mellanox.co.il
Sun Oct 25 03:36:25 PDT 2009


Why opensm contains complib header and c-files ?
What are they different with from IBAL complib ? 

> -----Original Message-----
> From: Smith, Stan [mailto:stan.smith at intel.com] 
> Sent: Saturday, October 24, 2009 4:15 AM
> To: Leonid Keller
> Cc: ofw at lists.openfabrics.org
> Subject: [PATCH] OpenSM 3.3.2 required items added to ib_types.h
> 
> 
> In order to build openSM 3.3.2 using only trunk\inc\* items 
> were added to ib_types.h.
>  trunk\inc\iba\ib_types.h is now very close to matching 
> management/opensm/include/iba/ib_types.h.
> Whitespace is the prime offender.
> 
> These mods have been tested by building & installing the 
> entire tree on ia64/x86/x64 Svr2008/3 Using both the existing 
> trunk\ulp\opensm and the newer 3.3.2 version; both successful.
> 
> 
> Signed-off-by: stan smith <stan.smith at intel.com>
> 
> Revision: 2498
> Author: stansmith
> Date: 5:32:28 PM, Friday, October 23, 2009
> Message:
> [INC] add defines and inline functions from OFED management 
> ib_types.h in order to build OpenSM 3.3.2 using only 
> trunk\inc\*. Tested by building & installing WinOF releases 
> x86,x64) using current openSM and newer openSM; no observed 
> differences.
> ----
> Modified : /gen1/trunk/inc/iba/ib_types.h
> 
> 
> --- a/trunk/inc/iba/ib_types.h  Fri Oct 23 16:21:30 2009
> +++ b/trunk/inc/iba/ib_types.h  Fri Oct 23 14:48:44 2009
> @@ -270,6 +270,32 @@
>  #define IB_SUBNET_PATH_HOPS_MAX                                64
>  /*********/
> 
> +/****d* IBA Base: Constants/IB_HOPLIMIT_MAX
> +* NAME
> +*      IB_HOPLIMIT_MAX
> +*
> +* DESCRIPTION
> +*       Maximum number of router hops allowed.
> +*
> +* SOURCE
> +*/
> +#define IB_HOPLIMIT_MAX                                        255
> +/*********/
> +
> +/*********/
> +/****d* IBA Base: Constants/IB_MC_SCOPE_*
> +* NAME
> +*      IB_MC_SCOPE_*
> +*
> +* DESCRIPTION
> +*      Scope component definitions from IBA 1.2.1 (Table 3 p. 148)
> +*/
> +#define IB_MC_SCOPE_LINK_LOCAL         0x2
> +#define IB_MC_SCOPE_SITE_LOCAL         0x5
> +#define IB_MC_SCOPE_ORG_LOCAL          0x8
> +#define IB_MC_SCOPE_GLOBAL             0xE
> +/*********/
> +
>  /****d* IBA Base: Constants/IB_PKEY_MAX_BLOCKS
>  * NAME
>  *      IB_PKEY_MAX_BLOCKS
> @@ -1577,6 +1603,18 @@
>  #define IB_NOTICE_NODE_TYPE_ROUTER                     
> (CL_NTOH32(0x000003))
>  /**********/
> 
> +/****d* IBA Base: Constants/IB_NOTICE_PRODUCER_TYPE_CLASS_MGR
> +* NAME
> +*      IB_NOTICE_PRODUCER_TYPE_CLASS_MGR
> +*
> +* DESCRIPTION
> +*      Encoded generic producer type used in Notice 
> attribute (13.4.8.2)
> +*
> +* SOURCE
> +*/
> +#define IB_NOTICE_PRODUCER_TYPE_CLASS_MGR      (CL_HTON32(0x000004))
> +/**********/
> +
>  /****d* IBA Base: Constants/IB_NOTICE_NODE_TYPE_SUBN_MGMT
>  * NAME
>  *      IB_NOTICE_NODE_TYPE_SUBN_MGMT
> @@ -1695,6 +1733,17 @@
>  */
>  #define IB_PATH_REC_SL_MASK                            0x000F
> 
> +/****d* IBA Base: Constants/IB_MULTIPATH_REC_SL_MASK
> +* NAME
> +*      IB_MILTIPATH_REC_SL_MASK
> +*
> +* DESCRIPTION
> +*      Mask for the sl field for MultiPath record
> +*
> +* SOURCE
> +*/
> +#define IB_MULTIPATH_REC_SL_MASK                       0x000F
> +
>  /****d* IBA Base: Constants/IB_PATH_REC_QOS_CLASS_MASK
>  * NAME
>  *      IB_PATH_REC_QOS_CLASS_MASK
> @@ -1706,6 +1755,17 @@
>  */
>  #define IB_PATH_REC_QOS_CLASS_MASK                     0xFFF0
> 
> +/****d* IBA Base: Constants/IB_MULTIPATH_REC_QOS_CLASS_MASK
> +* NAME
> +*      IB_MULTIPATH_REC_QOS_CLASS_MASK
> +*
> +* DESCRIPTION
> +*      Mask for the QoS class field for MultiPath record
> +*
> +* SOURCE
> +*/
> +#define IB_MULTIPATH_REC_QOS_CLASS_MASK                        0xFFF0
> +
>  /****d* IBA Base: Constants/IB_PATH_REC_SELECTOR_MASK
>  * NAME
>  *      IB_PATH_REC_SELECTOR_MASK
> @@ -1870,6 +1930,48 @@
>  * ib_node_info_t
>  *********/
> 
> +static const char *const __ib_producer_type_str[] = {
> +       "UNKNOWN",
> +       "Channel Adapter",
> +       "Switch",
> +       "Router",
> +       "Class Manager"
> +};
> +
> +/****f* IBA Base: Types/ib_get_producer_type_str
> +* NAME
> +*      ib_get_producer_type_str
> +*
> +* DESCRIPTION
> +*      Returns a string for the specified producer type
> +*      13.4.8.2 Notice
> +*      13.4.8.3 InformInfo
> +*
> +* SYNOPSIS
> +*/
> +static inline const char *AL_API
> +ib_get_producer_type_str(IN ib_net32_t producer_type) {
> +       if (cl_ntoh32(producer_type) >
> +           CL_NTOH32(IB_NOTICE_PRODUCER_TYPE_CLASS_MGR))
> +               producer_type = 0;
> +       return (__ib_producer_type_str[cl_ntoh32(producer_type)]);
> +}
> +
> +/*
> +* PARAMETERS
> +*      producer_type
> +*              [in] Encoded producer type from the Notice attribute
> +
> +* RETURN VALUES
> +*      Pointer to the producer type string.
> +*
> +* NOTES
> +*
> +* SEE ALSO
> +* ib_notice_get_prod_type
> +*********/
> +
>  static const char* const __ib_port_state_str[] =  {
>         "No State Change (NOP)",
> @@ -2643,12 +2745,12 @@
>  #define IB_MPR_COMPMASK_RATE           (CL_HTON64(((uint64_t)1)<<13))
>  #define IB_MPR_COMPMASK_PKTLIFETIMESELEC 
> (CL_HTON64(((uint64_t)1)<<14))
>  #define IB_MPR_COMPMASK_PKTLIFETIME    (CL_HTON64(((uint64_t)1)<<15))
> -#define IB_MPR_COMPMASK_RESV2          (CL_HTON64(((uint64_t)1)<<16))
> +#define IB_MPR_COMPMASK_SERVICEID_MSB  (CL_HTON64(((uint64_t)1)<<16))
>  #define IB_MPR_COMPMASK_INDEPSELEC     (CL_HTON64(((uint64_t)1)<<17))
>  #define IB_MPR_COMPMASK_RESV3          (CL_HTON64(((uint64_t)1)<<18))
>  #define IB_MPR_COMPMASK_SGIDCOUNT      (CL_HTON64(((uint64_t)1)<<19))
>  #define IB_MPR_COMPMASK_DGIDCOUNT      (CL_HTON64(((uint64_t)1)<<20))
> -#define IB_MPR_COMPMASK_RESV4          (CL_HTON64(((uint64_t)1)<<21))
> +#define IB_MPR_COMPMASK_SERVICEID_LSB  (CL_HTON64(((uint64_t)1)<<21))
> 
>  /* SMInfo Record Component Masks */
>  #define IB_SMIR_COMPMASK_LID           (CL_HTON64(((uint64_t)1)<<0))
> @@ -4472,10 +4574,11 @@
>         ib_net16_t                      p_key_violations;
>         ib_net16_t                      q_key_violations;
>         uint8_t                         guid_cap;
> -       uint8_t                         subnet_timeout; /* 
> cli_rereg(1b), resrv(
> -2b), timeout(5b) */
> +       uint8_t                         subnet_timeout; /* 
> cli_rereg(1b), mcast_pkey_trap_suppr(1b), resrv(1b), timeout(5b) */
>         uint8_t                         resp_time_value;
>         uint8_t                         error_threshold;
> +       ib_net16_t                      max_credit_hint;
> +       ib_net32_t                      link_rt_latency; /* 
> reserv(8b), link round trip lat(24b) */
> 
>  }      PACK_SUFFIX ib_port_info_t;
>  #include <complib/cl_packoff.h>
> @@ -4528,12 +4631,12 @@
>  #define IB_PORT_CAP_HAS_BM                     
> (CL_NTOH32(0x00800000))
>  #define IB_PORT_CAP_HAS_LINK_RT_LATENCY 
> (CL_NTOH32(0x01000000))  #define IB_PORT_CAP_HAS_CLIENT_REREG 
> (CL_NTOH32(0x02000000))
> -#define IB_PORT_CAP_RESV26                     
> (CL_NTOH32(0x04000000))
> -#define IB_PORT_CAP_RESV27                     
> (CL_NTOH32(0x08000000))
> -#define IB_PORT_CAP_RESV28                     
> (CL_NTOH32(0x10000000))
> -#define IB_PORT_CAP_RESV29                     
> (CL_NTOH32(0x20000000))
> -#define IB_PORT_CAP_RESV30                     
> (CL_NTOH32(0x40000000))
> -#define IB_PORT_CAP_RESV31                     
> (CL_NTOH32(0x80000000))
> +#define IB_PORT_CAP_HAS_OTHER_LOCAL_CHANGES_NTC 
> (CL_HTON32(0x04000000)) 
> +#define IB_PORT_CAP_HAS_LINK_SPEED_WIDTH_PAIRS_TBL 
> (CL_HTON32(0x08000000))
> +#define IB_PORT_CAP_HAS_VEND_MADS      (CL_HTON32(0x10000000))
> +#define IB_PORT_CAP_HAS_MCAST_PKEY_TRAP_SUPPRESS 
> +(CL_HTON32(0x20000000)) #define 
> IB_PORT_CAP_HAS_MCAST_FDB_TOP (CL_HTON32(0x40000000))
> +#define IB_PORT_CAP_HAS_HIER_INFO      (CL_HTON32(0x80000000))
> 
>  /****f* IBA Base: Types/ib_port_info_get_port_state
>  * NAME
> @@ -4964,6 +5067,7 @@
> 
>  #define IB_LINK_WIDTH_ACTIVE_1X                        1
>  #define IB_LINK_WIDTH_ACTIVE_4X                        2
> +#define IB_LINK_WIDTH_ACTIVE_8X                        4
>  #define IB_LINK_WIDTH_ACTIVE_12X               8
>  #define IB_LINK_SPEED_ACTIVE_2_5               1
>  #define IB_LINK_SPEED_ACTIVE_5                 2
> @@ -5241,6 +5345,66 @@
>  * SEE ALSO
>  *********/
> 
> +/****f* IBA Base: Types/ib_port_info_get_master_smsl
> +* NAME
> +*      ib_port_info_get_master_smsl
> +*
> +* DESCRIPTION
> +*      Returns the encoded value for the Master SMSL at this port.
> +*
> +* SYNOPSIS
> +*/
> +static inline uint8_t AL_API
> +ib_port_info_get_master_smsl(IN const ib_port_info_t * const p_pi) {
> +       return (uint8_t) (p_pi->mtu_smsl & 0x0F); }
> +
> +/*
> +* PARAMETERS
> +*      p_pi
> +*              [in] Pointer to a PortInfo attribute.
> +*
> +* RETURN VALUES
> +*      Returns the encoded value for the Master SMSL at this port.
> +*
> +* NOTES
> +*
> +* SEE ALSO
> +*********/
> +
> +/****f* IBA Base: Types/ib_port_info_set_master_smsl
> +* NAME
> +*      ib_port_info_set_master_smsl
> +*
> +* DESCRIPTION
> +*      Sets the Master SMSL value in the PortInfo attribute.
> +*
> +* SYNOPSIS
> +*/
> +static inline void AL_API
> +ib_port_info_set_master_smsl(IN ib_port_info_t * const p_pi,
> +                            IN const uint8_t smsl) {
> +       p_pi->mtu_smsl = (uint8_t) ((p_pi->mtu_smsl & 0xF0) | smsl); }
> +
> +/*
> +* PARAMETERS
> +*      p_pi
> +*              [in] Pointer to a PortInfo attribute.
> +*
> +*      mtu
> +*              [in] Encoded Master SMSL value to set
> +*
> +* RETURN VALUES
> +*      None.
> +*
> +* NOTES
> +*
> +* SEE ALSO
> +*********/
> +
> 
>  /****f* IBA Base: Types/ib_port_info_get_sm_sl
>  * NAME
> @@ -5319,8 +5483,7 @@
>  {
>         CL_ASSERT( timeout <= 0x1F );
>         p_pi->subnet_timeout =
> -     (uint8_t)(
> -       (p_pi->subnet_timeout & 0x80) | (timeout & 0x1F));
> +     (uint8_t) ((p_pi->subnet_timeout & 0xE0) | (timeout & 0x1F));
>  }
>  /*
>  * PARAMETERS
> @@ -5354,8 +5517,7 @@
>  {
>         CL_ASSERT( client_rereg <= 0x1 );
>         p_pi->subnet_timeout =
> -     (uint8_t)(
> -       (p_pi->subnet_timeout & 0x1F) | ((client_rereg << 7) & 0x80));
> +               (uint8_t) ((p_pi->subnet_timeout & 0x7F) | 
> (client_rereg 
> + << 7));
>  }
>  /*
>  * PARAMETERS
> @@ -5373,6 +5535,71 @@
>  * SEE ALSO
>  *********/
> 
> +/****f* IBA Base: Types/ib_port_info_get_mcast_pkey_trap_suppress
> +* NAME
> +*      ib_port_info_get_mcast_pkey_trap_suppress
> +*
> +* DESCRIPTION
> +*      Gets the encoded multicast pkey trap suppresion 
> enabled bit value
> +*      in the PortInfo attribute.
> +*
> +* SYNOPSIS
> +*/
> +static inline uint8_t AL_API
> +ib_port_info_get_mcast_pkey_trap_suppress(IN ib_port_info_t const 
> +*p_pi) {
> +       return ((p_pi->subnet_timeout & 0x40) >> 6); }
> +
> +/*
> +* PARAMETERS
> +*      p_pi
> +*              [in] Pointer to a PortInfo attribute.
> +*
> +* RETURN VALUES
> +*      Multicast PKey trap suppression enabled value (either 1 or 0).
> +*
> +* NOTES
> +*
> +* SEE ALSO
> +*********/
> +
> +/****f* IBA Base: Types/ib_port_info_set_mcast_pkey_trap_suppress
> +* NAME
> +*      ib_port_info_set_mcast_pkey_trap_suppress
> +*
> +* DESCRIPTION
> +*      Sets the encoded multicast pkey trap suppresion 
> enabled bit value
> +*      in the PortInfo attribute.
> +*
> +* SYNOPSIS
> +*/
> +static inline void AL_API
> +ib_port_info_set_mcast_pkey_trap_suppress(IN ib_port_info_t 
> * const p_pi,
> +                                         IN const uint8_t 
> +trap_suppress) {
> +       CL_ASSERT(trap_suppress <= 0x1);
> +       p_pi->subnet_timeout =
> +           (uint8_t) ((p_pi->subnet_timeout & 0xBF) | 
> (trap_suppress << 
> +6)); }
> +
> +/*
> +* PARAMETERS
> +*      p_pi
> +*              [in] Pointer to a PortInfo attribute.
> +*
> +*      trap_suppress
> +*              [in] Multicast pkey trap suppresion enabled 
> value to set
> +*                   (either 1 or 0).
> +*
> +* RETURN VALUES
> +*      None.
> +*
> +* NOTES
> +*
> +* SEE ALSO
> +*********/
> +
>  /****f* IBA Base: Types/ib_port_info_get_timeout
>  * NAME
>  *      ib_port_info_get_timeout
> @@ -5950,6 +6177,8 @@
>         ib_net16_t                      lids_per_port;
>         ib_net16_t                      enforce_cap;
>         uint8_t                         flags;
> +       uint8_t                         resvd;
> +       ib_net16_t                      mcast_top;
> 
>  }      PACK_SUFFIX ib_switch_info_t;
>  #include <complib/cl_packoff.h>
> @@ -6094,16 +6323,15 @@
>         uint8_t                 tclass;
>         uint8_t                 num_path;
>         ib_net16_t              pkey;
> -       uint8_t                 resv0;
> -       uint8_t                 sl;
> +       ib_net16_t              qos_class_sl;
>         uint8_t                 mtu;
>         uint8_t                 rate;
>         uint8_t                 pkt_life;
> -       uint8_t                 resv1;
> +       uint8_t                 service_id_8msb;
>         uint8_t                 independence;   /* formerly resv2 */
>         uint8_t                 sgid_count;
>         uint8_t                 dgid_count;
> -       uint8_t                 resv3[7];
> +       uint8_t                 service_id_56lsb[7];
>         ib_gid_t                gids[IB_MULTIPATH_MAX_GIDS];
>  }      PACK_SUFFIX ib_multipath_rec_t;
>  #include <complib/cl_packoff.h>
> @@ -6170,6 +6398,41 @@
>  *       ib_multipath_rec_t
>  *********/
> 
> +/****f* IBA Base: Types/ib_multipath_rec_set_sl
> +* NAME
> +*      ib_multipath_rec_set_sl
> +*
> +* DESCRIPTION
> +*      Set path service level.
> +*
> +* SYNOPSIS
> +*/
> +static inline void AL_API
> +ib_multipath_rec_set_sl(
> +       IN ib_multipath_rec_t* const p_rec,
> +       IN const uint8_t sl )
> +{
> +       p_rec->qos_class_sl =
> +               (p_rec->qos_class_sl & 
> CL_HTON16(IB_MULTIPATH_REC_QOS_CLASS_MASK)) |
> +                       cl_hton16(sl & IB_MULTIPATH_REC_SL_MASK); }
> +/*
> +* PARAMETERS
> +*      p_rec
> +*              [in] Pointer to the MultiPath record object.
> +*
> +*      sl
> +*              [in] Service level to set.
> +*
> +* RETURN VALUES
> +*      None
> +*
> +* NOTES
> +*
> +* SEE ALSO
> +*      ib_multipath_rec_t
> +*********/
> +
>  /****f* IBA Base: Types/ib_multipath_rec_sl
>  * NAME
>  *       ib_multipath_rec_sl
> @@ -6183,7 +6446,7 @@
>  ib_multipath_rec_sl(
>         IN      const   ib_multipath_rec_t* const       p_rec )
>  {
> -        return( (uint8_t)((cl_ntoh16( p_rec->sl )) & 0xF) );
> +       return ((uint8_t) ((cl_ntoh16(p_rec->qos_class_sl)) & 
> + IB_MULTIPATH_REC_SL_MASK));
>  }
>  /*
>  * PARAMETERS
> @@ -6199,6 +6462,70 @@
>  *       ib_multipath_rec_t
>  *********/
> 
> +/****f* IBA Base: Types/ib_multipath_rec_set_qos_class
> +* NAME
> +*      ib_multipath_rec_set_qos_class
> +*
> +* DESCRIPTION
> +*      Set path QoS class.
> +*
> +* SYNOPSIS
> +*/
> +static inline void     AL_API
> +ib_multipath_rec_set_qos_class(
> +       IN ib_multipath_rec_t* const p_rec,
> +       IN const uint16_t qos_class )
> +{
> +       p_rec->qos_class_sl =
> +               (p_rec->qos_class_sl & 
> CL_HTON16(IB_MULTIPATH_REC_SL_MASK)) |
> +                       cl_hton16(qos_class << 4); }
> +/*
> +* PARAMETERS
> +*      p_rec
> +*              [in] Pointer to the MultiPath record object.
> +*
> +*      qos_class
> +*              [in] QoS class to set.
> +*
> +* RETURN VALUES
> +*      None
> +*
> +* NOTES
> +*
> +* SEE ALSO
> +*      ib_multipath_rec_t
> +*********/
> +
> +/****f* IBA Base: Types/ib_multipath_rec_qos_class
> +* NAME
> +*      ib_multipath_rec_qos_class
> +*
> +* DESCRIPTION
> +*      Get QoS class.
> +*
> +* SYNOPSIS
> +*/
> +static inline uint16_t AL_API
> +ib_multipath_rec_qos_class(
> +       IN      const   ib_multipath_rec_t* const       p_rec )
> +{
> +       return (cl_ntoh16( p_rec->qos_class_sl ) >> 4); }
> +/*
> +* PARAMETERS
> +*      p_rec
> +*              [in] Pointer to the MultiPath record object.
> +*
> +* RETURN VALUES
> +*      QoS class of the MultiPath record.
> +*
> +* NOTES
> +*
> +* SEE ALSO
> +*      ib_multipath_rec_t
> +*********/
> +
>  /****f* IBA Base: Types/ib_multipath_rec_mtu
>  * NAME
>  *       ib_multipath_rec_mtu
> @@ -6395,6 +6722,41 @@
>  *       ib_multipath_rec_t
>  *********/
> 
> +/****f* IBA Base: Types/ib_multipath_rec_service_id
> +* NAME
> +*      ib_multipath_rec_service_id
> +*
> +* DESCRIPTION
> +*      Get multipath service id.
> +*
> +* SYNOPSIS
> +*/
> +static inline ib_net64_t AL_API
> +ib_multipath_rec_service_id(IN const ib_multipath_rec_t * 
> const p_rec) 
> +{
> +       union {
> +               ib_net64_t sid;
> +               uint8_t sid_arr[8];
> +       } sid_union;
> +       sid_union.sid_arr[0] = p_rec->service_id_8msb;
> +       memcpy(&sid_union.sid_arr[1], p_rec->service_id_56lsb, 7);
> +       return sid_union.sid;
> +}
> +
> +/*
> +* PARAMETERS
> +*      p_rec
> +*              [in] Pointer to the multipath record object.
> +*
> +* RETURN VALUES
> +*      Service ID
> +*
> +* NOTES
> +*
> +* SEE ALSO
> +*      ib_multipath_rec_t
> +*********/
> +
>  #define IB_NUM_PKEY_ELEMENTS_IN_BLOCK          32
>  /****s* IBA Base: Types/ib_pkey_table_t
>  * NAME
> @@ -6452,7 +6814,7 @@
>  #include <complib/cl_packon.h>
>  typedef struct _ib_slvl_table
>  {
> -       uint8_t         vl_table[IB_MAX_NUM_VLS/2];
> +       uint8_t         raw_vl_by_sl[IB_MAX_NUM_VLS/2];
> 
>  }      PACK_SUFFIX ib_slvl_table_t;
>  #include <complib/cl_packoff.h>
> @@ -6499,15 +6861,17 @@
>         CL_ASSERT(vl <= 15);
>         CL_ASSERT(sl_index <= 15);
> 
> -       if (sl_index%2)
> +       if (sl_index % 2)
>         {
>         /* this is an odd sl. Need to update the ls bits */
> -               p_slvl_tbl->vl_table[idx] = ( 
> p_slvl_tbl->vl_table[idx] & 0xF0 ) | vl ;
> +               p_slvl_tbl->raw_vl_by_sl[idx] =
> +                       ( p_slvl_tbl->raw_vl_by_sl[idx] & 
> 0xF0 ) | vl ;
>         }
>         else
>         {
>         /* this is an even sl. Need to update the ms bits */
> -               p_slvl_tbl->vl_table[idx] = ( vl << 4 ) | ( 
> p_slvl_tbl->vl_table[idx] & 0x0F );
> +               p_slvl_tbl->raw_vl_by_sl[idx] =
> +                       ( vl << 4 ) | ( 
> p_slvl_tbl->raw_vl_by_sl[idx] & 
> + 0x0F );
>         }
>  }
>  /*
> @@ -6547,15 +6911,15 @@
>         uint8_t idx = sl_index/2;
>         CL_ASSERT(sl_index <= 15);
> 
> -       if (sl_index%2)
> +       if (sl_index % 2)
>         {
>                 /* this is an odd sl. Need to return the ls bits. */
> -               return ( p_slvl_tbl->vl_table[idx] & 0x0F );
> +               return ( p_slvl_tbl->raw_vl_by_sl[idx] & 0x0F );
>         }
>         else
>         {
>                 /* this is an even sl. Need to return the ms bits. */
> -               return ( (p_slvl_tbl->vl_table[idx] & 0xF0) >> 4 );
> +               return ( (p_slvl_tbl->raw_vl_by_sl[idx] & 
> 0xF0) >> 4 );
>         }
>  }
>  /*
> @@ -7314,22 +7678,32 @@
>                  ib_gid_t      gid2;                   // 16
>           } PACK_SUFFIX ntc_257_258;
> 
> -         struct _ntc_259 // p/q_key violation with sw info 53
> +         struct _ntc_259 // p/q_key violation from switch 51
>           {
>                  ib_net16_t    data_valid;   // 2
>                  ib_net16_t    lid1;         // 2
>                  ib_net16_t    lid2;         // 2
> -                ib_net32_t    key;          // 4
> -                uint8_t       sl;           // 1
> -                ib_net32_t    qp1;          // 4
> -                uint8_t       qp2_msb;      // 1
> -                ib_net16_t    qp2_lsb;      // 2
> +                ib_net16_t    pkey;         // 2
> +                ib_net32_t    sl_qp1;       // 4b sl, 4b pad, 24b qp1
> +                ib_net32_t    qp2;          // 8b pad, 24b qp2
>                  ib_gid_t      gid1;         // 16
>                  ib_gid_t      gid2;         // 16
>                  ib_net16_t    sw_lid;       // 2
>                  uint8_t       port_no;      // 1
>           } PACK_SUFFIX ntc_259;
> 
> +         struct _ntc_bkey_259  // bkey violation
> +         {
> +                ib_net16_t lidaddr;
> +                uint8_t method;
> +                uint8_t reserved;
> +                ib_net16_t attribute_id;
> +                ib_net32_t attribute_modifier;
> +                ib_net32_t qp;         // qp is low 24 bits
> +                ib_net64_t bkey;
> +                ib_gid_t gid;
> +         } PACK_SUFFIX ntc_bkey_259;
> +
>         } data_details;
> 
>    ib_gid_t                     issuer_gid;    // 16          80
> @@ -7352,6 +7726,258 @@
>  #define TRAP_144_MASK_LINK_WIDTH_ENABLE_CHANGE 
> (CL_HTON16(0x0002))  #define 
> TRAP_144_MASK_NODE_DESCRIPTION_CHANGE  (CL_HTON16(0x0001))
> 
> +/****f* IBA Base: Types/ib_notice_is_generic
> +* NAME
> +*      ib_notice_is_generic
> +*
> +* DESCRIPTION
> +*      Check if the notice is generic
> +*
> +* SYNOPSIS
> +*/
> +static inline boolean_t AL_API
> +ib_notice_is_generic(IN const ib_mad_notice_attr_t * p_ntc) {
> +       return (p_ntc->generic_type & 0x80); }
> +
> +/*
> +* PARAMETERS
> +*      p_ntc
> +*              [in] Pointer to  the notice MAD attribute
> +*
> +* RETURN VALUES
> +*      TRUE if mad is generic
> +*
> +* SEE ALSO
> +*      ib_mad_notice_attr_t
> +*********/
> +
> +/****f* IBA Base: Types/ib_notice_get_type
> +* NAME
> +*      ib_notice_get_type
> +*
> +* DESCRIPTION
> +*      Get the notice type
> +*
> +* SYNOPSIS
> +*/
> +static inline uint8_t AL_API
> +ib_notice_get_type(IN const ib_mad_notice_attr_t * p_ntc) {
> +       return p_ntc->generic_type & 0x7f; }
> +
> +/*
> +* PARAMETERS
> +*      p_ntc
> +*              [in] Pointer to  the notice MAD attribute
> +*
> +* RETURN VALUES
> +*      TRUE if mad is generic
> +*
> +* SEE ALSO
> +*      ib_mad_notice_attr_t
> +*********/
> +
> +/****f* IBA Base: Types/ib_notice_get_prod_type
> +* NAME
> +*      ib_notice_get_prod_type
> +*
> +* DESCRIPTION
> +*      Get the notice Producer Type of Generic Notice
> +*
> +* SYNOPSIS
> +*/
> +static inline ib_net32_t AL_API
> +ib_notice_get_prod_type(IN const ib_mad_notice_attr_t * p_ntc) {
> +       uint32_t pt;
> +
> +       pt = cl_ntoh16(p_ntc->g_or_v.generic.prod_type_lsb) |
> +           (p_ntc->g_or_v.generic.prod_type_msb << 16);
> +       return cl_hton32(pt);
> +}
> +
> +/*
> +* PARAMETERS
> +*      p_ntc
> +*              [in] Pointer to the notice MAD attribute
> +*
> +* RETURN VALUES
> +*      The producer type
> +*
> +* SEE ALSO
> +*      ib_mad_notice_attr_t
> +*********/
> +
> +/****f* IBA Base: Types/ib_notice_set_prod_type
> +* NAME
> +*      ib_notice_set_prod_type
> +*
> +* DESCRIPTION
> +*      Set the notice Producer Type of Generic Notice
> +*
> +* SYNOPSIS
> +*/
> +static inline void AL_API
> +ib_notice_set_prod_type(IN ib_mad_notice_attr_t * p_ntc,
> +                       IN ib_net32_t prod_type_val) {
> +       uint32_t ptv = cl_ntoh32(prod_type_val);
> +       p_ntc->g_or_v.generic.prod_type_lsb =
> +           cl_hton16((uint16_t) (ptv & 0x0000ffff));
> +       p_ntc->g_or_v.generic.prod_type_msb =
> +           (uint8_t) ((ptv & 0x00ff0000) >> 16); }
> +
> +/*
> +* PARAMETERS
> +*      p_ntc
> +*              [in] Pointer to the notice MAD attribute
> +*
> +*  prod_type
> +*     [in] The producer Type code
> +*
> +* RETURN VALUES
> +*      None
> +*
> +* SEE ALSO
> +*      ib_mad_notice_attr_t
> +*********/
> +
> +/****f* IBA Base: Types/ib_notice_set_prod_type_ho
> +* NAME
> +*      ib_notice_set_prod_type_ho
> +*
> +* DESCRIPTION
> +*      Set the notice Producer Type of Generic Notice given 
> Host Order
> +*
> +* SYNOPSIS
> +*/
> +static inline void AL_API
> +ib_notice_set_prod_type_ho(IN ib_mad_notice_attr_t * p_ntc,
> +                          IN uint32_t prod_type_val_ho) {
> +       p_ntc->g_or_v.generic.prod_type_lsb =
> +           cl_hton16((uint16_t) (prod_type_val_ho & 0x0000ffff));
> +       p_ntc->g_or_v.generic.prod_type_msb =
> +           (uint8_t) ((prod_type_val_ho & 0x00ff0000) >> 16); }
> +
> +/*
> +* PARAMETERS
> +*      p_ntc
> +*              [in] Pointer to the notice MAD attribute
> +*
> +*      prod_type
> +*              [in] The producer Type code in host order
> +*
> +* RETURN VALUES
> +*      None
> +*
> +* SEE ALSO
> +*      ib_mad_notice_attr_t
> +*********/
> +
> +/****f* IBA Base: Types/ib_notice_get_vend_id
> +* NAME
> +*      ib_notice_get_vend_id
> +*
> +* DESCRIPTION
> +*      Get the Vendor Id of Vendor type Notice
> +*
> +* SYNOPSIS
> +*/
> +static inline ib_net32_t AL_API
> +ib_notice_get_vend_id(IN const ib_mad_notice_attr_t * p_ntc) {
> +       uint32_t vi;
> +
> +       vi = cl_ntoh16(p_ntc->g_or_v.vend.vend_id_lsb) |
> +           (p_ntc->g_or_v.vend.vend_id_msb << 16);
> +       return cl_hton32(vi);
> +}
> +
> +/*
> +* PARAMETERS
> +*      p_ntc
> +*              [in] Pointer to the notice MAD attribute
> +*
> +* RETURN VALUES
> +*      The Vendor Id of Vendor type Notice
> +*
> +* SEE ALSO
> +*      ib_mad_notice_attr_t
> +*********/
> +
> +/****f* IBA Base: Types/ib_notice_set_vend_id
> +* NAME
> +*      ib_notice_set_vend_id
> +*
> +* DESCRIPTION
> +*      Set the notice Producer Type of Generic Notice
> +*
> +* SYNOPSIS
> +*/
> +static inline void AL_API
> +ib_notice_set_vend_id(IN ib_mad_notice_attr_t * p_ntc, IN ib_net32_t 
> +vend_id) {
> +       uint32_t vi = cl_ntoh32(vend_id);
> +       p_ntc->g_or_v.vend.vend_id_lsb =
> +           cl_hton16((uint16_t) (vi & 0x0000ffff));
> +       p_ntc->g_or_v.vend.vend_id_msb = (uint8_t) ((vi & 
> 0x00ff0000) >> 
> +16); }
> +
> +/*
> +* PARAMETERS
> +*      p_ntc
> +*              [in] Pointer to the notice MAD attribute
> +*
> +*      vend_id
> +*              [in] The producer Type code
> +*
> +* RETURN VALUES
> +*      None
> +*
> +* SEE ALSO
> +*      ib_mad_notice_attr_t
> +*********/
> +
> +/****f* IBA Base: Types/ib_notice_set_vend_id_ho
> +* NAME
> +*      ib_notice_set_vend_id_ho
> +*
> +* DESCRIPTION
> +*      Set the notice Producer Type of Generic Notice given 
> a host order value
> +*
> +* SYNOPSIS
> +*/
> +static inline void AL_API
> +ib_notice_set_vend_id_ho(IN ib_mad_notice_attr_t * p_ntc,
> +                        IN uint32_t vend_id_ho) {
> +       p_ntc->g_or_v.vend.vend_id_lsb =
> +           cl_hton16((uint16_t) (vend_id_ho & 0x0000ffff));
> +       p_ntc->g_or_v.vend.vend_id_msb =
> +           (uint8_t) ((vend_id_ho & 0x00ff0000) >> 16); }
> +
> +/*
> +* PARAMETERS
> +*      p_ntc
> +*              [in] Pointer to the notice MAD attribute
> +*
> +*      vend_id_ho
> +*              [in] The producer Type code in host order
> +*
> +* RETURN VALUES
> +*      None
> +*
> +* SEE ALSO
> +*      ib_mad_notice_attr_t
> +*********/
> +
>  #include <complib/cl_packon.h>
>  typedef struct _ib_inform_info
>  {
> @@ -7537,6 +8163,40 @@
>  }      PACK_SUFFIX ib_inform_info_record_t;
>  #include <complib/cl_packoff.h>
>  /********/
> +
> +/****s* IBA Base: Types/ib_perfmgt_mad_t
> +* NAME
> +*      ib_perfmgt_mad_t
> +*
> +* DESCRIPTION
> +*      IBA defined Perf Management MAD (16.3.1)
> +*
> +* SYNOPSIS
> +*/
> +#include <complib/cl_packon.h>
> +typedef struct _ib_perfmgt_mad {
> +       ib_mad_t header;
> +       uint8_t resv[40];
> +#define        IB_PM_DATA_SIZE         192
> +       uint8_t data[IB_PM_DATA_SIZE];
> +} PACK_SUFFIX ib_perfmgt_mad_t;
> +#include <complib/cl_packoff.h>
> +/*
> +* FIELDS
> +*      header
> +*              Common MAD header.
> +*
> +*      resv
> +*              Reserved.
> +*
> +*      data
> +*              Performance Management payload.  The 
> structure and content of this field
> +*              depends upon the method, attr_id, and 
> attr_mod fields in the header.
> +*
> +* SEE ALSO
> +* ib_mad_t
> +*********/
> +
>  /****d* IBA Base: Types/DM_SVC_NAME
>  * NAME
>  *      DM_SVC_NAME
> 
> 
> 



More information about the ofw mailing list