[ofw] ib_portinfo_record_t padding history?

Sean Hefty sean.hefty at intel.com
Tue May 18 14:38:22 PDT 2010


>AL_INLINE ib_net16_t AL_API
>ib_get_attr_offset(
>	IN		const	uint32_t
attr_size )
>{
>	if( attr_size & 0x07 )
>		return( cl_hton16( (uint16_t)(attr_size >> 3) + 1 ) );
>	else
>		return( cl_hton16( (uint16_t)(attr_size >> 3) ) );
>}
>
>Linux
>
>static inline ib_net16_t AL_API
>ib_get_attr_offset(const uint32_t attr_size )
>{
>	return( cl_hton16( (uint16_t)(attr_size >> 3) ) );
>}

AttributeOffset is the number of 8-byte words from the beginning of an attribute
to the next.  So... let's say that the size of an attribute is 5, then you'd
want AttributeOffset set to 1.  Each attribute would be 5 bytes, plus 3 bytes of
padding.  I think the Windows version is correct.

- Sean




More information about the ofw mailing list