[ofa-general] Re: why does ibv_device_attr.*_guid are in network order?

Dotan Barak dotanb at dev.mellanox.co.il
Thu Jan 24 05:43:09 PST 2008


Roland Dreier wrote:
>  > I noticed that the following attributes in ibv_device_attr are in
>  > network order:
>  >    node_guid
>  >    sys_image_guid
>  > 
>  > What is the reason for this?
>
> It's hard for me to see any reason to byte-swap them.  GUIDs are
> really byte-strings and it seems sensible to keep them into network
> order, since you're not likely to do any arithmetic with them.
> Another point in favor of network byte order is that GIDs are IPv6
> addresses, and so they should be stored in network byte order by the
> verbs just as IP addresses are kept in network byte order everywhere
> else.  Given that GIDs are in network byte order, I think it would be
> very confusing and error-prone if GUIDs were in host byte order.
>
>   
I don't know if this mail thread is the place for it, but why 
ibv_query_pkey return the pkey value in network order?

thanks
Dotan



More information about the general mailing list