From 580aca6cf9d300f74365b24cb0e3eafeb17bf478 Mon Sep 17 00:00:00 2001 From: sleybo Date: Wed, 4 Apr 2007 14:19:19 +0000 Subject: [PATCH] [IBAL] update ib_types.h from Linux . mainly white spaces and adding of function/defines git-svn-id: svn://openib.tc.cornell.edu/gen1@623 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86 --- trunk/inc/iba/ib_types.h | 739 ++++++++++++++++++++++++++++++--------- 1 file changed, 581 insertions(+), 158 deletions(-) diff --git a/trunk/inc/iba/ib_types.h b/trunk/inc/iba/ib_types.h index 37977eae..51ed6401 100644 --- a/trunk/inc/iba/ib_types.h +++ b/trunk/inc/iba/ib_types.h @@ -2064,7 +2064,16 @@ typedef union _ib_gid * * SEE ALSO *********/ - + +/****f* IBA Base: Types/ib_gid_is_multicast +* NAME +* ib_gid_is_multicast +* +* DESCRIPTION +* Returns a boolean indicating whether a GID is a multicast GID. +* +* SYNOPSIS +*/ AL_INLINE boolean_t AL_API ib_gid_is_multicast( IN const ib_gid_t* p_gid ) @@ -2072,6 +2081,40 @@ ib_gid_is_multicast( return( p_gid->raw[0] == 0xFF ); } +/****f* IBA Base: Types/ib_gid_get_scope +* NAME +* ib_gid_get_scope +* +* DESCRIPTION +* Returns scope of (assumed) multicast GID. +* +* SYNOPSIS +*/ +AL_INLINE uint8_t AL_API +ib_mgid_get_scope( + IN const ib_gid_t* p_gid ) +{ + return( p_gid->raw[1] & 0x0F ); +} + +/****f* IBA Base: Types/ib_gid_set_scope +* NAME +* ib_gid_set_scope +* +* DESCRIPTION +* Sets scope of (assumed) multicast GID. +* +* SYNOPSIS +*/ +AL_INLINE void AL_API +ib_mgid_set_scope( + IN ib_gid_t* const p_gid, + IN const uint8_t scope ) +{ + p_gid->raw[1] &= 0xF0; + p_gid->raw[1] |= scope & 0x0F; +} + /****f* IBA Base: Types/ib_gid_set_default * NAME * ib_gid_set_default @@ -2345,28 +2388,27 @@ typedef __declspec(align(8)) struct _ib_path_rec * SEE ALSO *********/ -/* Port Record Component Masks */ -#define IB_PR_COMPMASK_LID (CL_HTON64(1<<0)) -#define IB_PR_COMPMASK_DGID (CL_HTON64(1<<2)) -#define IB_PR_COMPMASK_SGID (CL_HTON64(1<<3)) -#define IB_PR_COMPMASK_DLID (CL_HTON64(1<<4)) -#define IB_PR_COMPMASK_SLID (CL_HTON64(1<<5)) -#define IB_PR_COMPMASK_RAWTRAFIC (CL_HTON64(1<<6)) -#define IB_PR_COMPMASK_RESV0 (CL_HTON64(1<<7)) -#define IB_PR_COMPMASK_FLOWLABEL (CL_HTON64(1<<8)) -#define IB_PR_COMPMASK_HOPLIMIT (CL_HTON64(1<<9)) -#define IB_PR_COMPMASK_TCLASS (CL_HTON64(1<<10)) -#define IB_PR_COMPMASK_REVERSIBLE (CL_HTON64(1<<11)) -#define IB_PR_COMPMASK_NUM_PATH (CL_HTON64(1<<12)) -#define IB_PR_COMPMASK_PKEY (CL_HTON64(1<<13)) -#define IB_PR_COMPMASK_RESV1 (CL_HTON64(1<<14)) -#define IB_PR_COMPMASK_SL (CL_HTON64(1<<15)) -#define IB_PR_COMPMASK_MTU_SEL (CL_HTON64(1<<16)) -#define IB_PR_COMPMASK_MTU (CL_HTON64(1<<17)) -#define IB_PR_COMPMASK_RATE_SEL (CL_HTON64(1<<18)) -#define IB_PR_COMPMASK_RATE (CL_HTON64(1<<19)) -#define IB_PR_COMPMASK_PKTLIFETIME_SEL (CL_HTON64(1<<20)) -#define IB_PR_COMPMASK_PFTLIFETIME (CL_HTON64(1<<21)) +/* Path Record Component Masks */ +#define IB_PR_COMPMASK_DGID (CL_HTON64(((uint64_t)1)<<2)) +#define IB_PR_COMPMASK_SGID (CL_HTON64(((uint64_t)1)<<3)) +#define IB_PR_COMPMASK_DLID (CL_HTON64(((uint64_t)1)<<4)) +#define IB_PR_COMPMASK_SLID (CL_HTON64(((uint64_t)1)<<5)) +#define IB_PR_COMPMASK_RAWTRAFFIC (CL_HTON64(((uint64_t)1)<<6)) +#define IB_PR_COMPMASK_RESV0 (CL_HTON64(((uint64_t)1)<<7)) +#define IB_PR_COMPMASK_FLOWLABEL (CL_HTON64(((uint64_t)1)<<8)) +#define IB_PR_COMPMASK_HOPLIMIT (CL_HTON64(((uint64_t)1)<<9)) +#define IB_PR_COMPMASK_TCLASS (CL_HTON64(((uint64_t)1)<<10)) +#define IB_PR_COMPMASK_REVERSIBLE (CL_HTON64(((uint64_t)1)<<11)) +#define IB_PR_COMPMASK_NUM_PATH (CL_HTON64(((uint64_t)1)<<12)) +#define IB_PR_COMPMASK_PKEY (CL_HTON64(((uint64_t)1)<<13)) +#define IB_PR_COMPMASK_RESV1 (CL_HTON64(((uint64_t)1)<<14)) +#define IB_PR_COMPMASK_SL (CL_HTON64(((uint64_t)1)<<15)) +#define IB_PR_COMPMASK_MTUSELEC (CL_HTON64(((uint64_t)1)<<16)) +#define IB_PR_COMPMASK_MTU (CL_HTON64(((uint64_t)1)<<17)) +#define IB_PR_COMPMASK_RATESELEC (CL_HTON64(((uint64_t)1)<<18)) +#define IB_PR_COMPMASK_RATE (CL_HTON64(((uint64_t)1)<<19)) +#define IB_PR_COMPMASK_PKTLIFETIMESELEC (CL_HTON64(((uint64_t)1)<<20)) +#define IB_PR_COMPMASK_PKTLIFETIME (CL_HTON64(((uint64_t)1)<<21)) /* Link Record Component Masks */ #define IB_LR_COMPMASK_FROM_LID (CL_HTON64(((uint64_t)1)<<0)) @@ -2461,54 +2503,56 @@ typedef __declspec(align(8)) struct _ib_path_rec #define IB_SR_COMPMASK_SDATA64_1 (CL_HTON64(((uint64_t)1)<<36)) /* Port Info Record Component Masks */ -#define IB_PIR_COMPMASK_LID (CL_HTON64(1<<0)) -#define IB_PIR_COMPMASK_PORTNUM (CL_HTON64(1<<1)) -#define IB_PIR_COMPMASK_RESV1 (CL_HTON64(1<<2)) -#define IB_PIR_COMPMASK_MKEY (CL_HTON64(1<<3)) -#define IB_PIR_COMPMASK_GIDPRE (CL_HTON64(1<<4)) -#define IB_PIR_COMPMASK_BASELID (CL_HTON64(1<<5)) -#define IB_PIR_COMPMASK_SMLID (CL_HTON64(1<<6)) -#define IB_PIR_COMPMASK_CAPMASK (CL_HTON64(1<<7)) -#define IB_PIR_COMPMASK_DIAGCODE (CL_HTON64(1<<8)) -#define IB_PIR_COMPMASK_MKEYLEASEPRD (CL_HTON64(1<<9)) -#define IB_PIR_COMPMASK_LOCALPORTNUM (CL_HTON64(1<<10)) -#define IB_PIR_COMPMASK_LNKWIDTHSUPPORT (CL_HTON64(1<<11)) -#define IB_PIR_COMPMASK_LNKWIDTHACTIVE (CL_HTON64(1<<12)) -#define IB_PIR_COMPMASK_LINKWIDTHENABLED (CL_HTON64(1<<13)) -#define IB_PIR_COMPMASK_LNKSPEEDSUPPORT (CL_HTON64(1<<14)) -#define IB_PIR_COMPMASK_PORTSTATE (CL_HTON64(1<<15)) -#define IB_PIR_COMPMASK_PORTPHYSTATE (CL_HTON64(1<<16)) -#define IB_PIR_COMPMASK_LINKDWNDFLTSTATE (CL_HTON64(1<<17)) -#define IB_PIR_COMPMASK_MKEYPROTBITS (CL_HTON64(1<<18)) -#define IB_PIR_COMPMASK_LMC (CL_HTON64(1<<19)) -#define IB_PIR_COMPMASK_LINKSPEEDACTIVE (CL_HTON64(1<<20)) -#define IB_PIR_COMPMASK_LINKSPEEDENABLE (CL_HTON64(1<<21)) -#define IB_PIR_COMPMASK_NEIGHBORMTU (CL_HTON64(1<<22)) -#define IB_PIR_COMPMASK_MASTERSMSL (CL_HTON64(1<<23)) -#define IB_PIR_COMPMASK_VLCAP (CL_HTON64(1<<24)) -#define IB_PIR_COMPMASK_INITTYPE (CL_HTON64(1<<25)) -#define IB_PIR_COMPMASK_VLHIGHLIMIT (CL_HTON64(1<<26)) -#define IB_PIR_COMPMASK_VLARBHIGHCAP (CL_HTON64(1<<27)) -#define IB_PIR_COMPMASK_VLARBLOWCAP (CL_HTON64(1<<28)) -#define IB_PIR_COMPMASK_INITTYPEREPLY (CL_HTON64(1<<29)) -#define IB_PIR_COMPMASK_MTUCAP (CL_HTON64(1<<30)) -#define IB_PIR_COMPMASK_VLSTALLCNT (CL_HTON64(1<<31)) -#define IB_PIR_COMPMASK_HOQLIFE (CL_HTON64(((uint64_t)1)<<32)) -#define IB_PIR_COMPMASK_OPVLS (CL_HTON64(((uint64_t)1)<<33)) -#define IB_PIR_COMPMASK_PARENFIN (CL_HTON64(((uint64_t)1)<<34)) -#define IB_PIR_COMPMASK_PARENFOUT (CL_HTON64(((uint64_t)1)<<35)) -#define IB_PIR_COMPMASK_FILTERRAWIN (CL_HTON64(((uint64_t)1)<<36)) -#define IB_PIR_COMPMASK_FILTERRAWOUT (CL_HTON64(((uint64_t)1)<<37)) -#define IB_PIR_COMPMASK_MKEYVIO (CL_HTON64(((uint64_t)1)<<38)) -#define IB_PIR_COMPMASK_PKEYVIO (CL_HTON64(((uint64_t)1)<<39)) -#define IB_PIR_COMPMASK_QKEYVIO (CL_HTON64(((uint64_t)1)<<40)) -#define IB_PIR_COMPMASK_GUIDCAP (CL_HTON64(((uint64_t)1)<<41)) -#define IB_PIR_COMPMASK_RESV2 (CL_HTON64(((uint64_t)1)<<42)) -#define IB_PIR_COMPMASK_SUBNTO (CL_HTON64(((uint64_t)1)<<43)) -#define IB_PIR_COMPMASK_RESV3 (CL_HTON64(((uint64_t)1)<<44)) -#define IB_PIR_COMPMASK_RESPTIME (CL_HTON64(((uint64_t)1)<<45)) -#define IB_PIR_COMPMASK_LOCALPHYERR (CL_HTON64(((uint64_t)1)<<46)) -#define IB_PIR_COMPMASK_OVERRUNERR (CL_HTON64(((uint64_t)1)<<47)) +#define IB_PIR_COMPMASK_LID (CL_HTON64(((uint64_t)1)<<0)) +#define IB_PIR_COMPMASK_PORTNUM (CL_HTON64(((uint64_t)1)<<1)) +#define IB_PIR_COMPMASK_RESV1 (CL_HTON64(((uint64_t)1)<<2)) +#define IB_PIR_COMPMASK_MKEY (CL_HTON64(((uint64_t)1)<<3)) +#define IB_PIR_COMPMASK_GIDPRE (CL_HTON64(((uint64_t)1)<<4)) +#define IB_PIR_COMPMASK_BASELID (CL_HTON64(((uint64_t)1)<<5)) +#define IB_PIR_COMPMASK_SMLID (CL_HTON64(((uint64_t)1)<<6)) +#define IB_PIR_COMPMASK_CAPMASK (CL_HTON64(((uint64_t)1)<<7)) +#define IB_PIR_COMPMASK_DIAGCODE (CL_HTON64(((uint64_t)1)<<8)) +#define IB_PIR_COMPMASK_MKEYLEASEPRD (CL_HTON64(((uint64_t)1)<<9)) +#define IB_PIR_COMPMASK_LOCALPORTNUM (CL_HTON64(((uint64_t)1)<<10)) +#define IB_PIR_COMPMASK_LINKWIDTHENABLED (CL_HTON64(((uint64_t)1)<<11)) +#define IB_PIR_COMPMASK_LNKWIDTHSUPPORT (CL_HTON64(((uint64_t)1)<<12)) +#define IB_PIR_COMPMASK_LNKWIDTHACTIVE (CL_HTON64(((uint64_t)1)<<13)) +#define IB_PIR_COMPMASK_LNKSPEEDSUPPORT (CL_HTON64(((uint64_t)1)<<14)) +#define IB_PIR_COMPMASK_PORTSTATE (CL_HTON64(((uint64_t)1)<<15)) +#define IB_PIR_COMPMASK_PORTPHYSTATE (CL_HTON64(((uint64_t)1)<<16)) +#define IB_PIR_COMPMASK_LINKDWNDFLTSTATE (CL_HTON64(((uint64_t)1)<<17)) +#define IB_PIR_COMPMASK_MKEYPROTBITS (CL_HTON64(((uint64_t)1)<<18)) +#define IB_PIR_COMPMASK_RESV2 (CL_HTON64(((uint64_t)1)<<19)) +#define IB_PIR_COMPMASK_LMC (CL_HTON64(((uint64_t)1)<<20)) +#define IB_PIR_COMPMASK_LINKSPEEDACTIVE (CL_HTON64(((uint64_t)1)<<21)) +#define IB_PIR_COMPMASK_LINKSPEEDENABLE (CL_HTON64(((uint64_t)1)<<22)) +#define IB_PIR_COMPMASK_NEIGHBORMTU (CL_HTON64(((uint64_t)1)<<23)) +#define IB_PIR_COMPMASK_MASTERSMSL (CL_HTON64(((uint64_t)1)<<24)) +#define IB_PIR_COMPMASK_VLCAP (CL_HTON64(((uint64_t)1)<<25)) +#define IB_PIR_COMPMASK_INITTYPE (CL_HTON64(((uint64_t)1)<<26)) +#define IB_PIR_COMPMASK_VLHIGHLIMIT (CL_HTON64(((uint64_t)1)<<27)) +#define IB_PIR_COMPMASK_VLARBHIGHCAP (CL_HTON64(((uint64_t)1)<<28)) +#define IB_PIR_COMPMASK_VLARBLOWCAP (CL_HTON64(((uint64_t)1)<<29)) +#define IB_PIR_COMPMASK_INITTYPEREPLY (CL_HTON64(((uint64_t)1)<<30)) +#define IB_PIR_COMPMASK_MTUCAP (CL_HTON64(((uint64_t)1)<<31)) +#define IB_PIR_COMPMASK_VLSTALLCNT (CL_HTON64(((uint64_t)1)<<32)) +#define IB_PIR_COMPMASK_HOQLIFE (CL_HTON64(((uint64_t)1)<<33)) +#define IB_PIR_COMPMASK_OPVLS (CL_HTON64(((uint64_t)1)<<34)) +#define IB_PIR_COMPMASK_PARENFIN (CL_HTON64(((uint64_t)1)<<35)) +#define IB_PIR_COMPMASK_PARENFOUT (CL_HTON64(((uint64_t)1)<<36)) +#define IB_PIR_COMPMASK_FILTERRAWIN (CL_HTON64(((uint64_t)1)<<37)) +#define IB_PIR_COMPMASK_FILTERRAWOUT (CL_HTON64(((uint64_t)1)<<38)) +#define IB_PIR_COMPMASK_MKEYVIO (CL_HTON64(((uint64_t)1)<<39)) +#define IB_PIR_COMPMASK_PKEYVIO (CL_HTON64(((uint64_t)1)<<40)) +#define IB_PIR_COMPMASK_QKEYVIO (CL_HTON64(((uint64_t)1)<<41)) +#define IB_PIR_COMPMASK_GUIDCAP (CL_HTON64(((uint64_t)1)<<42)) +#define IB_PIR_COMPMASK_RESV3 (CL_HTON64(((uint64_t)1)<<43)) +#define IB_PIR_COMPMASK_SUBNTO (CL_HTON64(((uint64_t)1)<<44)) +#define IB_PIR_COMPMASK_RESV4 (CL_HTON64(((uint64_t)1)<<45)) +#define IB_PIR_COMPMASK_RESPTIME (CL_HTON64(((uint64_t)1)<<46)) +#define IB_PIR_COMPMASK_LOCALPHYERR (CL_HTON64(((uint64_t)1)<<47)) +#define IB_PIR_COMPMASK_OVERRUNERR (CL_HTON64(((uint64_t)1)<<48)) + /* Multicast Member Record Component Masks */ #define IB_MCR_COMPMASK_GID (CL_HTON64(((uint64_t)1)<<0)) #define IB_MCR_COMPMASK_MGID (CL_HTON64(((uint64_t)1)<<0)) @@ -4215,21 +4259,21 @@ typedef struct _ib_port_info #define IB_PORT_CAP_HAS_NV_PKEY (CL_NTOH32(0x00000100)) #define IB_PORT_CAP_HAS_LED_INFO (CL_NTOH32(0x00000200)) #define IB_PORT_CAP_SM_DISAB (CL_NTOH32(0x00000400)) -#define IB_PORT_CAP_HAS_SYS_GUID (CL_NTOH32(0x00000800)) +#define IB_PORT_CAP_HAS_SYS_IMG_GUID (CL_NTOH32(0x00000800)) #define IB_PORT_CAP_HAS_PKEY_SW_EXT_PORT_TRAP (CL_NTOH32(0x00001000)) #define IB_PORT_CAP_RESV13 (CL_NTOH32(0x00002000)) #define IB_PORT_CAP_RESV14 (CL_NTOH32(0x00004000)) #define IB_PORT_CAP_RESV15 (CL_NTOH32(0x00008000)) #define IB_PORT_CAP_HAS_COM_MGT (CL_NTOH32(0x00010000)) #define IB_PORT_CAP_HAS_SNMP (CL_NTOH32(0x00020000)) -#define IB_PORT_CAP_HAS_REINIT (CL_NTOH32(0x00040000)) +#define IB_PORT_CAP_REINIT (CL_NTOH32(0x00040000)) #define IB_PORT_CAP_HAS_DEV_MGT (CL_NTOH32(0x00080000)) #define IB_PORT_CAP_HAS_VEND_CLS (CL_NTOH32(0x00100000)) #define IB_PORT_CAP_HAS_DR_NTC (CL_NTOH32(0x00200000)) #define IB_PORT_CAP_HAS_CAP_NTC (CL_NTOH32(0x00400000)) #define IB_PORT_CAP_HAS_BM (CL_NTOH32(0x00800000)) -#define IB_PORT_CAP_HAS_LINK_TRIP (CL_NTOH32(0x01000000)) -#define IB_PORT_CAP_HAS_CLI_REREG (CL_NTOH32(0x02000000)) +#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)) @@ -4647,8 +4691,9 @@ AL_INLINE uint8_t AL_API ib_port_info_get_link_speed_active( IN const ib_port_info_t* const p_pi ) { - return( (uint8_t)((p_pi->link_speed & IB_PORT_LINK_SPEED_ACTIVE_MASK) >> - IB_PORT_LINK_SPEED_SHIFT) ); + return( (uint8_t)((p_pi->link_speed & + IB_PORT_LINK_SPEED_ACTIVE_MASK) >> + IB_PORT_LINK_SPEED_SHIFT) ); } /* * PARAMETERS @@ -4697,36 +4742,76 @@ AL_INLINE uint8_t AL_API ib_port_info_compute_rate( IN const ib_port_info_t* const p_pi ) { - switch( p_pi->link_width_active * p_pi->link_width_active * - ib_port_info_get_link_speed_active( p_pi ) ) + uint8_t rate = 0; + + switch (ib_port_info_get_link_speed_active(p_pi)) { - case 1: - return IB_PATH_RECORD_RATE_2_5_GBS; - - case 2: - return IB_PATH_RECORD_RATE_5_GBS; - - case 4: - return IB_PATH_RECORD_RATE_10_GBS; - - case 8: - return IB_PATH_RECORD_RATE_20_GBS; - - case 16: - return IB_PATH_RECORD_RATE_40_GBS; - - case 64: - return IB_PATH_RECORD_RATE_30_GBS; - - case 128: - return IB_PATH_RECORD_RATE_60_GBS; - - case 256: - return IB_PATH_RECORD_RATE_120_GBS; + case IB_LINK_SPEED_ACTIVE_2_5: + switch (p_pi->link_width_active) + { + case IB_LINK_WIDTH_ACTIVE_1X: + rate = IB_PATH_RECORD_RATE_2_5_GBS; + break; + + case IB_LINK_WIDTH_ACTIVE_4X: + rate = IB_PATH_RECORD_RATE_10_GBS; + break; + + case IB_LINK_WIDTH_ACTIVE_12X: + rate = IB_PATH_RECORD_RATE_30_GBS; + break; + + default: + rate = IB_PATH_RECORD_RATE_2_5_GBS; + break; + } + break; + case IB_LINK_SPEED_ACTIVE_5: + switch (p_pi->link_width_active) + { + case IB_LINK_WIDTH_ACTIVE_1X: + rate = IB_PATH_RECORD_RATE_5_GBS; + break; + + case IB_LINK_WIDTH_ACTIVE_4X: + rate = IB_PATH_RECORD_RATE_20_GBS; + break; + + case IB_LINK_WIDTH_ACTIVE_12X: + rate = IB_PATH_RECORD_RATE_60_GBS; + break; + + default: + rate = IB_PATH_RECORD_RATE_5_GBS; + break; + } + break; + case IB_LINK_SPEED_ACTIVE_10: + switch (p_pi->link_width_active) + { + case IB_LINK_WIDTH_ACTIVE_1X: + rate = IB_PATH_RECORD_RATE_10_GBS; + break; + + case IB_LINK_WIDTH_ACTIVE_4X: + rate = IB_PATH_RECORD_RATE_40_GBS; + break; + + case IB_LINK_WIDTH_ACTIVE_12X: + rate =IB_PATH_RECORD_RATE_120_GBS; + break; default: - return IB_PATH_RECORD_RATE_2_5_GBS; + rate = IB_PATH_RECORD_RATE_10_GBS; + break; + } + break; + default: + rate = IB_PATH_RECORD_RATE_2_5_GBS; + break; } + + return rate; } /* * PARAMETERS @@ -4979,7 +5064,9 @@ ib_port_info_set_timeout( IN const uint8_t timeout ) { CL_ASSERT( timeout <= 0x1F ); - p_pi->subnet_timeout = (uint8_t)(timeout & 0x1F); + p_pi->subnet_timeout = + (uint8_t)( + (p_pi->subnet_timeout & 0x80) | (timeout & 0x1F)); } /* * PARAMETERS @@ -5733,6 +5820,326 @@ typedef struct _ib_guid_info #include /************/ +#include +typedef struct _ib_guidinfo_record +{ + ib_net16_t lid; + uint8_t block_num; + uint8_t resv; + uint32_t reserved; + ib_guid_info_t guid_info; +} PACK_SUFFIX ib_guidinfo_record_t; +#include + +#define IB_MULTIPATH_MAX_GIDS 11 /* Support max that can fit into first MAD (for now) */ + +#include +typedef struct _ib_multipath_rec_t +{ + ib_net32_t hop_flow_raw; + uint8_t tclass; + uint8_t num_path; + ib_net16_t pkey; + uint8_t resv0; + uint8_t sl; + uint8_t mtu; + uint8_t rate; + uint8_t pkt_life; + uint8_t resv1; + uint8_t independence; /* formerly resv2 */ + uint8_t sgid_count; + uint8_t dgid_count; + uint8_t resv3[7]; + ib_gid_t gids[IB_MULTIPATH_MAX_GIDS]; +} PACK_SUFFIX ib_multipath_rec_t; +#include +/* +* FIELDS +* hop_flow_raw +* Global routing parameters: hop count, flow label and raw bit. +* +* tclass +* Another global routing parameter. +* +* num_path +* Reversible path - 1 bit to say if path is reversible. +* num_path [6:0] In queries, maximum number of paths to return. +* In responses, undefined. +* +* pkey +* Partition key (P_Key) to use on this path. +* +* sl +* Service level to use on this path. +* +* mtu +* MTU and MTU selector fields to use on this path +* rate +* Rate and rate selector fields to use on this path. +* +* pkt_life +* Packet lifetime +* +* preference +* Indicates the relative merit of this path versus other path +* records returned from the SA. Lower numbers are better. +* +* SEE ALSO +*********/ + +/****f* IBA Base: Types/ib_multipath_rec_num_path +* NAME +* ib_multipath_rec_num_path +* +* DESCRIPTION +* Get max number of paths to return. +* +* SYNOPSIS +*/ +AL_INLINE uint8_t AL_API +ib_multipath_rec_num_path( + IN const ib_multipath_rec_t* const p_rec ) +{ + return( p_rec->num_path &0x7F ); +} +/* +* PARAMETERS +* p_rec +* [in] Pointer to the multipath record object. +* +* RETURN VALUES +* Maximum number of paths to return for each unique SGID_DGID combination. +* +* NOTES +* +* SEE ALSO +* ib_multipath_rec_t +*********/ + +/****f* IBA Base: Types/ib_multipath_rec_sl +* NAME +* ib_multipath_rec_sl +* +* DESCRIPTION +* Get multipath service level. +* +* SYNOPSIS +*/ +AL_INLINE uint8_t AL_API +ib_multipath_rec_sl( + IN const ib_multipath_rec_t* const p_rec ) +{ + return( (uint8_t)((cl_ntoh16( p_rec->sl )) & 0xF) ); +} +/* +* PARAMETERS +* p_rec +* [in] Pointer to the multipath record object. +* +* RETURN VALUES +* SL. +* +* NOTES +* +* SEE ALSO +* ib_multipath_rec_t +*********/ + +/****f* IBA Base: Types/ib_multipath_rec_mtu +* NAME +* ib_multipath_rec_mtu +* +* DESCRIPTION +* Get encoded path MTU. +* +* SYNOPSIS +*/ +AL_INLINE uint8_t AL_API +ib_multipath_rec_mtu( + IN const ib_multipath_rec_t* const p_rec ) +{ + return( (uint8_t)(p_rec->mtu & IB_MULTIPATH_REC_BASE_MASK) ); +} +/* +* PARAMETERS +* p_rec +* [in] Pointer to the multipath record object. +* +* RETURN VALUES +* Encoded path MTU. +* 1: 256 +* 2: 512 +* 3: 1024 +* 4: 2048 +* 5: 4096 +* others: reserved +* +* NOTES +* +* SEE ALSO +* ib_multipath_rec_t +*********/ + +/****f* IBA Base: Types/ib_multipath_rec_mtu_sel +* NAME +* ib_multipath_rec_mtu_sel +* +* DESCRIPTION +* Get encoded multipath MTU selector. +* +* SYNOPSIS +*/ +AL_INLINE uint8_t AL_API +ib_multipath_rec_mtu_sel( + IN const ib_multipath_rec_t* const p_rec ) +{ + return( (uint8_t)((p_rec->mtu & IB_MULTIPATH_REC_SELECTOR_MASK) >> 6) ); +} +/* +* PARAMETERS +* p_rec +* [in] Pointer to the multipath record object. +* +* RETURN VALUES +* Encoded path MTU selector value (for queries). +* 0: greater than MTU specified +* 1: less than MTU specified +* 2: exactly the MTU specified +* 3: largest MTU available +* +* NOTES +* +* SEE ALSO +* ib_multipath_rec_t +*********/ + +/****f* IBA Base: Types/ib_multipath_rec_rate +* NAME +* ib_multipath_rec_rate +* +* DESCRIPTION +* Get encoded multipath rate. +* +* SYNOPSIS +*/ +AL_INLINE uint8_t AL_API +ib_multipath_rec_rate( + IN const ib_multipath_rec_t* const p_rec ) +{ + return( (uint8_t)(p_rec->rate & IB_MULTIPATH_REC_BASE_MASK) ); +} +/* +* PARAMETERS +* p_rec +* [in] Pointer to the multipath record object. +* +* RETURN VALUES +* Encoded multipath rate. +* 2: 2.5 Gb/sec. +* 3: 10 Gb/sec. +* 4: 30 Gb/sec. +* others: reserved +* +* NOTES +* +* SEE ALSO +* ib_multipath_rec_t +*********/ + +/****f* IBA Base: Types/ib_multipath_rec_rate_sel +* NAME +* ib_multipath_rec_rate_sel +* +* DESCRIPTION +* Get encoded multipath rate selector. +* +* SYNOPSIS +*/ +AL_INLINE uint8_t AL_API +ib_multipath_rec_rate_sel( + IN const ib_multipath_rec_t* const p_rec ) +{ + return( (uint8_t)((p_rec->rate & IB_MULTIPATH_REC_SELECTOR_MASK) >> 6) ); +} +/* +* PARAMETERS +* p_rec +* [in] Pointer to the multipath record object. +* +* RETURN VALUES +* Encoded path rate selector value (for queries). +* 0: greater than rate specified +* 1: less than rate specified +* 2: exactly the rate specified +* 3: largest rate available +* +* NOTES +* +* SEE ALSO +* ib_multipath_rec_t +*********/ + +/****f* IBA Base: Types/ib_multipath_rec_pkt_life +* NAME +* ib_multipath_rec_pkt_life +* +* DESCRIPTION +* Get encoded multipath pkt_life. +* +* SYNOPSIS +*/ +AL_INLINE uint8_t AL_API +ib_multipath_rec_pkt_life( + IN const ib_multipath_rec_t* const p_rec ) +{ + return( (uint8_t)(p_rec->pkt_life & IB_MULTIPATH_REC_BASE_MASK) ); +} +/* +* PARAMETERS +* p_rec +* [in] Pointer to the multipath record object. +* +* RETURN VALUES +* Encoded multipath pkt_life = 4.096 µsec * 2 ** PacketLifeTime. +* +* NOTES +* +* SEE ALSO +* ib_multipath_rec_t +*********/ + +/****f* IBA Base: Types/ib_multipath_rec_pkt_life_sel +* NAME +* ib_multipath_rec_pkt_life_sel +* +* DESCRIPTION +* Get encoded multipath pkt_lifetime selector. +* +* SYNOPSIS +*/ +AL_INLINE uint8_t AL_API +ib_multipath_rec_pkt_life_sel( + IN const ib_multipath_rec_t* const p_rec ) +{ + return( (uint8_t)((p_rec->pkt_life & IB_MULTIPATH_REC_SELECTOR_MASK) >> 6 )); +} +/* +* PARAMETERS +* p_rec +* [in] Pointer to the multipath record object. +* +* RETURN VALUES +* Encoded path pkt_lifetime selector value (for queries). +* 0: greater than rate specified +* 1: less than rate specified +* 2: exactly the rate specified +* 3: smallest packet lifetime available +* +* NOTES +* +* SEE ALSO +* ib_multipath_rec_t +*********/ /****s* IBA Base: Types/ib_pkey_table_info_t * NAME * ib_pkey_table_info_t @@ -6198,7 +6605,7 @@ typedef struct _ib_member_rec * ib_member_get_sl_flow_hop * * DESCRIPTION -* Get encoded sl flow label and hop limit +* Get encoded sl, flow label, and hop limit * * SYNOPSIS */ @@ -6227,7 +6634,7 @@ ib_member_get_sl_flow_hop( /* * PARAMETERS * sl_flow_hop -* [in] the sl flow label and hop limit of MC Group +* [in] the sl, flow label, and hop limit of MC Group * * RETURN VALUES * p_sl @@ -6250,7 +6657,7 @@ ib_member_get_sl_flow_hop( * ib_member_set_sl_flow_hop * * DESCRIPTION -* Set encoded version, sl flow and hop +* Set encoded sl, flow label, and hop limit * * SYNOPSIS */ @@ -6282,7 +6689,7 @@ ib_member_set_sl_flow_hop( * * RETURN VALUES * sl_flow_hop -* [out] the sl flow label and hop limit +* [out] the encoded sl, flow label, and hop limit * * NOTES * @@ -7463,7 +7870,6 @@ ib_inform_set_vend_id( * ib_mad_inform_info_t, ib_inform_get_vend_id *********/ - /****s* IBA Base: Types/ib_inform_info_record_t * NAME * ib_inform_info_record_t @@ -7864,7 +8270,6 @@ typedef struct _ib_svc_entry * ib_svc_entries_t *********/ - /****s* IBA Base: Types/ib_svc_entries_t * NAME * ib_svc_entries_t @@ -7961,6 +8366,7 @@ typedef struct _ib_ioc_info * Defines known Communication management class versions */ #define IB_MCLASS_CM_VER_2 2 +#define IB_MCLASS_CM_VER_1 1 /* * Defines the size of user available data in communication management MADs @@ -7980,7 +8386,6 @@ typedef struct _ib_ioc_info #define IB_ARI_SIZE 72 // redefine #define IB_APR_INFO_SIZE 72 - /****d* Access Layer/ib_rej_status_t * NAME * ib_rej_status_t @@ -8029,8 +8434,9 @@ typedef ib_net16_t ib_rej_status_t; #define IB_REJ_INVALID_CLASS_VER CL_HTON16(31) #define IB_REJ_INVALID_FLOW_LBL CL_HTON16(32) #define IB_REJ_INVALID_ALT_FLOW_LBL CL_HTON16(33) -/******/ +#define IB_REJ_SERVICE_HANDOFF CL_HTON16(65535) +/******/ /****d* Access Layer/ib_apr_status_t * NAME @@ -8086,7 +8492,6 @@ typedef uint8_t ib_apr_status_t; * *******/ - /* * Service ID resolution status */ @@ -8312,7 +8717,6 @@ ib_get_err_str( * SEE ALSO *********/ - /****d* Verbs/ib_async_event_t * NAME * ib_async_event_t -- Async event types @@ -8359,7 +8763,7 @@ typedef enum _ib_async_event_t /* * VALUES * IB_AE_SQ_ERROR -* An error occurred when accessing the send queue of the QP. +* An error occurred when accessing the send queue of the QP or EEC. * This event is optional. * * IB_AE_SQ_DRAINED @@ -8368,7 +8772,7 @@ typedef enum _ib_async_event_t * applicable, has received all acknowledgements for those messages. * * IB_AE_RQ_ERROR -* An error occurred when accessing the receive queue of the QP. +* An error occurred when accessing the receive queue of the QP or EEC. * This event is optional. * * IB_AE_CQ_ERROR @@ -8490,7 +8894,6 @@ ib_get_async_event_str( * SEE ALSO *********/ - /****s* Verbs/ib_event_rec_t * NAME * ib_event_rec_t -- Async event notification record @@ -8556,7 +8959,6 @@ typedef struct _ib_event_rec } ib_event_rec_t; /*******/ - /****d* Access Layer/ib_atomic_t * NAME * ib_atomic_t @@ -8586,7 +8988,6 @@ typedef enum _ib_atomic_t * in the system. *****/ - /****s* Access Layer/ib_port_cap_t * NAME * ib_port_cap_t @@ -8629,7 +9030,6 @@ typedef struct _ib_port_cap } ib_port_cap_t; /*****/ - /****d* Access Layer/ib_init_type_t * NAME * ib_init_type_t @@ -8650,7 +9050,6 @@ typedef uint8_t ib_init_type_t; #define IB_INIT_TYPE_DO_NOT_RESUSCITATE 0x08 /*****/ - /****s* Access Layer/ib_port_attr_mod_t * NAME * ib_port_attr_mod_t @@ -8675,7 +9074,6 @@ typedef struct _ib_port_attr_mod * ib_port_cap_t *****/ - /****s* Access Layer/ib_port_attr_t * NAME * ib_port_attr_t @@ -8737,7 +9135,6 @@ typedef struct _ib_port_attr * uint8_t, ib_port_cap_t, ib_link_states_t *****/ - /****s* Access Layer/ib_ca_attr_t * NAME * ib_ca_attr_t @@ -8957,7 +9354,7 @@ typedef struct _ib_ca_attr * Indicates ability to check port number in address handles. * * change_primary_port -* Indicates ability to change primary port for a QP during a +* Indicates ability to change primary port for a QP or EEC during a * SQD->RTS transition. * * modify_wr_depth @@ -9115,7 +9512,6 @@ typedef struct _ib_av_attr * ib_gid_t *****/ - /****d* Access Layer/ib_qp_type_t * NAME * ib_qp_type_t @@ -9129,7 +9525,8 @@ typedef enum _ib_qp_type { IB_QPT_RELIABLE_CONN = 0, /* Matches CM REQ transport type */ IB_QPT_UNRELIABLE_CONN = 1, /* Matches CM REQ transport type */ - IB_QPT_UNRELIABLE_DGRM = 3, /* Purposefully skip RDD type. */ + IB_QPT_RELIABLE_DGRM = 2, /* Matches CM REQ transport type */ + IB_QPT_UNRELIABLE_DGRM, IB_QPT_QP0, IB_QPT_QP1, IB_QPT_RAW_IPV6, @@ -9147,6 +9544,9 @@ typedef enum _ib_qp_type * IB_QPT_UNRELIABLE_CONN * Unreliable, connected queue pair. * +* IB_QPT_RELIABLE_DGRM +* Reliable, datagram queue pair. +* * IB_QPT_UNRELIABLE_DGRM * Unreliable, datagram queue pair. * @@ -9230,7 +9630,6 @@ typedef uint32_t ib_access_t; * RDMA read and write access. *****/ - /****d* Access Layer/ib_qp_state_t * NAME * ib_qp_state_t @@ -9255,7 +9654,6 @@ typedef uint32_t ib_qp_state_t; #define IB_QPS_TIME_WAIT 0xDEAD0000 /* InfiniBand Access Layer */ /*****/ - /****d* Access Layer/ib_apm_state_t * NAME * ib_apm_state_t @@ -9400,7 +9798,6 @@ typedef struct _ib_qp_create * ib_qp_type_t, ib_qp_attr_t *****/ - /****s* Access Layer/ib_qp_attr_t * NAME * ib_qp_attr_t @@ -9462,7 +9859,6 @@ typedef struct _ib_qp_attr * ib_qp_type_t, ib_access_t, ib_qp_state_t, ib_av_attr_t, ib_apm_state_t *****/ - /****d* Access Layer/ib_qp_opts_t * NAME * ib_qp_opts_t @@ -9489,13 +9885,11 @@ typedef uint32_t ib_qp_opts_t; #define IB_MOD_QP_RETRY_CNT 0x00002000 #define IB_MOD_QP_LOCAL_ACK_TIMEOUT 0x00004000 #define IB_MOD_QP_RNR_RETRY_CNT 0x00008000 - /* * SEE ALSO * ib_qp_mod_t *****/ - /****s* Access Layer/ib_qp_mod_t * NAME * ib_qp_mod_t @@ -9652,7 +10046,6 @@ typedef struct _ib_local_ds } ib_local_ds_t; /*****/ - /****d* Access Layer/ib_send_opt_t * NAME * ib_send_opt_t @@ -9680,8 +10073,8 @@ typedef uint32_t ib_send_opt_t; * Send immediate data with the given request. * * IB_SEND_OPT_FENCE -* The operation is fenced. Complete all pending send operations before -* processing this request. +* The operation is fenced. Complete all pending send operations +* before processing this request. * * IB_SEND_OPT_SIGNALED * If the queue pair is configured for signaled completion, then @@ -9698,11 +10091,13 @@ typedef uint32_t ib_send_opt_t; * vendor specific restrictions on the size of send operation that may * be performed as inline. * +* * IB_SEND_OPT_LOCAL * Indicates that a sent MAD request should be given to the local VPD for * processing. MADs sent using this option are not placed on the wire. * This send option is only valid for MAD send operations. * +* * IB_SEND_OPT_VEND_MASK * This mask indicates bits reserved in the send options that may be used * by the verbs provider to indicate vendor specific options. Bits set @@ -9711,7 +10106,6 @@ typedef uint32_t ib_send_opt_t; * *****/ - /****s* Access Layer/ib_send_wr_t * NAME * ib_send_wr_t @@ -9744,6 +10138,14 @@ typedef struct _ib_send_wr } ud; + struct _send_rd + { + ib_net32_t remote_qp; + ib_net32_t remote_qkey; + ib_net32_t eecn; + + } rd; + struct _send_raw_ether { ib_net16_t dest_lid; @@ -9878,7 +10280,6 @@ typedef struct _ib_send_wr * ib_wr_type_t, ib_local_ds_t, ib_send_opt_t *****/ - /****s* Access Layer/ib_recv_wr_t * NAME * ib_recv_wr_t @@ -9919,7 +10320,6 @@ typedef struct _ib_recv_wr * ib_local_ds_t *****/ - /****s* Access Layer/ib_bind_wr_t * NAME * ib_bind_wr_t @@ -9967,7 +10367,6 @@ typedef struct _ib_bind_wr * ib_send_opt_t, ib_access_t, ib_local_ds_t *****/ - /****d* Access Layer/ib_wc_status_t * NAME * ib_wc_status_t @@ -10107,7 +10506,6 @@ ib_get_wc_status_str( * SEE ALSO *********/ - /****d* Access Layer/ib_wc_type_t * NAME * ib_wc_type_t @@ -10192,7 +10590,6 @@ typedef uint32_t ib_recv_opt_t; * but may have specific meaning to the underlying VPD. *****/ - /****s* Access Layer/ib_wc_t * NAME * ib_wc_t @@ -10233,6 +10630,16 @@ typedef struct _ib_wc } ud; + struct _wc_rd + { + ib_net32_t remote_eecn; + ib_net32_t remote_qp; + ib_net16_t remote_lid; + uint8_t remote_sl; + uint32_t free_cnt; + + } rd; + struct _wc_raw_ipv6 { ib_net16_t remote_lid; @@ -10268,6 +10675,7 @@ typedef struct _ib_wc * wc_type * Indicates the type of work completion. * +* * length * The total length of the data sent or received with the work request. * @@ -10299,8 +10707,8 @@ typedef struct _ib_wc * Identifies the source queue pair of a received datagram. * * recv.ud.pkey_index -* The pkey index of the source queue pair. This is valid only for -* IB_QPT_QP1 and IB_QPT_QP1_ALIAS QP types. +* The pkey index for the source queue pair. This is valid only for +* GSI type QP's. * * recv.ud.remote_lid * The source LID of the received datagram. @@ -10311,6 +10719,23 @@ typedef struct _ib_wc * recv.ud.path_bits * path bits... * +* recv.rd.remote_eecn +* The remote end-to-end context number that sent the received message. +* +* recv.rd.remote_qp +* Identifies the source queue pair of a received message. +* +* recv.rd.remote_lid +* The source LID of the received message. +* +* recv.rd.remote_sl +* The service level used by the source of the received message. +* +* recv.rd.free_cnt +* The number of available entries in the completion queue. Reliable +* datagrams may complete out of order, so this field may be used to +* determine the number of additional completions that may occur. +* * recv.raw_ipv6.remote_lid * The source LID of the received message. * @@ -10344,7 +10769,6 @@ typedef struct _ib_wc * ib_wc_type_t, ib_qp_type_t, ib_wc_status_t, ib_recv_opt_t *****/ - /****s* Access Layer/ib_mr_create_t * NAME * ib_mr_create_t @@ -10359,7 +10783,6 @@ typedef struct _ib_mr_create void* __ptr64 vaddr; uint64_t length; ib_access_t access_ctrl; - } ib_mr_create_t; /* * FIELDS @@ -10466,7 +10889,6 @@ typedef struct _ib_phys_create uint32_t buf_offset; uint32_t hca_page_size; ib_access_t access_ctrl; - } ib_phys_create_t; /* * FIELDS @@ -10494,7 +10916,6 @@ typedef struct _ib_phys_create * ib_access_t *****/ - /****s* Access Layer/ib_mr_attr_t * NAME * ib_mr_attr_t @@ -10558,7 +10979,6 @@ typedef struct _ib_mr_attr * ib_access_t *****/ - /****d* Access Layer/ib_ca_mod_t * NAME * ib_ca_mod_t -- Modify port attributes and error counters @@ -10604,26 +11024,28 @@ typedef uint32_t ib_ca_mod_t; * Indicates if there is an SNMP agent accessible through the port. * * IB_CA_MOD_IS_DEV_MGMT_SUPPORTED -* Indicates if there is a device management agent accessible through -* the port. +* Indicates if there is a device management agent accessible +* through the port. * * IB_CA_MOD_IS_VEND_SUPPORTED -* Indicates if there is a vendor supported agent accessible through -* the port. +* Indicates if there is a vendor supported agent accessible +* through the port. * * IB_CA_MOD_IS_SM * Indicates if there is a subnet manager accessible through * the port. * * IB_CA_MOD_IS_SM_DISABLED -* Indicates if the port has been disabled for configuration by the subnet -* manager. +* Indicates if the port has been disabled for configuration by the +* subnet manager. * * IB_CA_MOD_QKEY_CTR -* Used to reset the qkey violation counter associated with the port. +* Used to reset the qkey violation counter associated with the +* port. * * IB_CA_MOD_PKEY_CTR -* Used to reset the pkey violation counter associated with the port. +* Used to reset the pkey violation counter associated with the +* port. * * IB_CA_MOD_IS_NOTICE_SUPPORTED * Indicates that this CA supports ability to generate Notices for @@ -10634,7 +11056,8 @@ typedef uint32_t ib_ca_mod_t; * trap messages. (only applicable to switches) * * IB_CA_MOD_IS_APM_SUPPORTED -* Indicates that this port is capable of performing Automatic Migration. +* Indicates that this port is capable of performing Automatic +* Path Migration. * * IB_CA_MOD_IS_SLMAP_SUPPORTED * Indicates this port supports SLMAP capability. @@ -10681,7 +11104,6 @@ typedef uint32_t ib_ca_mod_t; * ib_modify_ca will return IB_INVALID_PARAMETER. *****/ - /****d* Access Layer/ib_mr_mod_t * NAME * ib_mr_mod_t @@ -10842,3 +11264,4 @@ typedef struct _ib_ci_op #endif /* __IB_TYPES_H__ */ + -- 2.41.0