[ofw] ib_portinfo_record_t padding history?

Sean Hefty sean.hefty at intel.com
Tue May 18 12:08:08 PDT 2010


>Thoughts?

The padding looks wrong based on the IB spec.  PortInfoRecord should have
PortInfo as its last field.  The size of PortInfoRecord should be 58 bytes.

>#include <complib/cl_packon.h>
>typedef struct _ib_portinfo_record
>{
>        ib_net16_t              lid;
>        uint8_t         port_num;
>        uint8_t         resv;
>        ib_port_info_t  port_info;
>        uint8_t         pad[6];         <-- ??
>
>}       PACK_SUFFIX ib_portinfo_record_t;
>#include <complib/cl_packoff.h>

My guess (and this is only a guess) is that the padding was added to make
PortInfoRecord align on a 64-bit boundary, probably in case it were sent as part
of an RMPP mad.  The PortInfo structure contains 64-bit values at the top of the
structure.

You should be safe removing the padding.  It may cause Itanium to complain about
unaligned fields, but I would expect it to work.

- Sean




More information about the ofw mailing list