[ofa-general] [RFC] OpenSM vendor layer

Hal Rosenstock hal.rosenstock at gmail.com
Sat Feb 7 04:39:49 PST 2009


On Sat, Feb 7, 2009 at 7:33 AM, Sasha Khapyorsky <sashak at voltaire.com> wrote:
> On 14:12 Fri 06 Feb     , Hal Rosenstock wrote:
>>
>> I'm looking at adding pkey support into the OpenSM vendor layer. The
>> pkey table is a per port structure and is part of ib_port_attr_t. That
>> structure also include num_pkeys. There is only related API:
>> osm_vendor_get_all_port_attr which takes several pointers, the second
>> one is a pointer to a preallocated array of port attributes (memory
>> allocation for that is done by the client). ib_port_attr_t includes a
>> pointer to the pkey table. So the only way this can work is if that
>> allocation is also done by the client which makes that a valid
>> parameter on input (as well as output).
>
> This could be a client choice: if pkey table pointer is initialized as
> NULL osm_vendor_get_all_port_attr() allocates memory and initialize the
> table and its size, otherwise it fills up only provided by client pkey
> table entries.

Right; that's what I was trying to describe. The downside of this
approach is that it breaks in and out of tree uses of this API as the
passed in structure is uninitialized. I can fix the in tree ones (I
know about).

-- Hal

> Sasha
>



More information about the general mailing list