[ofw] API breakage in trunk

Sean Hefty sean.hefty at intel.com
Fri Feb 19 11:01:50 PST 2010


>How is the array created? Doesn't it still use old size when the array is
>created? When will the new size come into picture for old apps? Thx.

The app calls into the library to discover the total size of the allocation that
is needed.  The library calculates the size, using the new definition.  The app
allocates some huge buffer and passes that to the library.

The library fills out the buffer, part of which is the port_attr array.  The
issue is that the location of p_ca_attr->p_port_attr[1] is not the same for the
library as it is for the app.  The library will have moved the location of the
second attribute by 32 or 64 bits, depending on padding.

The address of p_ca_attr->p_port_attr[index] can be calculated as:

p_ca_attr->p_port_attr + sizeof(ib_port_attr_t) * index

but sizeof(ib_port_attr_t) is not the same for the library and the app.

- Sean




More information about the ofw mailing list