[ofw] API breakage in trunk

James Yang jyang at xsigo.com
Fri Feb 19 11:19:11 PST 2010


It seems we have to stuck with old ib_port_attr_t.

To get new port attribute, we can add these new definition at the end of
ib_ca_attr_t, I'm assuming its size is OK to expand...

Thanks,
James

-----Original Message-----
From: Sean Hefty [mailto:sean.hefty at intel.com] 
Sent: Friday, February 19, 2010 11:02 AM
To: James Yang; Tzachi Dar; ofw_list
Subject: RE: [ofw] API breakage in trunk

>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