[openib-general] Re: why does the value of the node_guid don't have the machine endianess?

Fab Tillier ftillier at silverstorm.com
Wed Aug 3 10:38:24 PDT 2005


> From: Dotan Barak [mailto:dotanb at mellanox.co.il]
> Sent: Tuesday, August 02, 2005 11:02 PM
> 
> I expect to get this values with the endianess of the host that i'm working
on,
> and if i will print the node_guid as a number it will be the same as the
> sys_fs value.
>
> I don't see any reason for the driver to return this value in the endianess of
> the network, i think that it is better that the driver will return the value
> of this attribute in the host order, instead of every application that query
> for this attribute will change the order of it.

It's a matter of consistency.  The stack doesn't perform byte swapping on MAD
payloads either, and SA requests (for NodeInfo, for example) will return node
GUIDs.  It's simpler to set the expectation for the client that all GUIDs are
always treated in network order, that way the client doesn't have to distinguish
between getting a GUID from a SA response, or getting a GUID from the device
directly.  It also removes the need to perform byte swapping to put the GUID in
network order when issuing SA requests that need that information (if there are
any).

Personally, I would prefer to see the GUIDs always reported in network order in
all places.  We don't want to add byte swapping policy to the MAD layer.

- Fab





More information about the general mailing list